imbajin commented on code in PR #2944:
URL:
https://github.com/apache/incubator-hugegraph/pull/2944#discussion_r2749523489
##########
hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/config/ConfigOption.java:
##########
@@ -20,6 +20,22 @@
import com.google.common.base.Predicate;
public class ConfigOption<T> extends TypedOption<T, T> {
+ private boolean urlNormalize = false;
+ private String defaultScheme = null;
+
+ public ConfigOption<T> withUrlNormalization(String scheme) {
Review Comment:
⚠️ **API Design: Builder pattern requires mutation**
The `withUrlNormalization()` method mutates the `ConfigOption` instance and
returns `this`, but it's called during option declaration:
```java
new ConfigOption<>(...).withUrlNormalization("http://");
```
**Issue:** If `ConfigOption` instances are ever shared or reused, this
mutation could cause race conditions.
**Suggested improvement:** Make `withUrlNormalization()` immutable or ensure
`ConfigOption` is only constructed once during static initialization (add final
modifier or documentation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]