bitflicker64 commented on code in PR #2944:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2944#discussion_r2750995189


##########
hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/config/HugeConfig.java:
##########
@@ -87,9 +87,17 @@ private void setLayoutIfNeeded(Configuration conf) {
     @SuppressWarnings("unchecked")
     public <T, R> R get(TypedOption<T, R> option) {
         Object value = this.getProperty(option.name());
+        boolean fromDefault = false;
+
         if (value == null) {
-            return option.defaultValue();
+            value = option.defaultValue();
+            fromDefault = true;
+        }
+
+        if (!fromDefault) {

Review Comment:
   Yes, this is intentional.
   The default values already have http://, so they are already correct. There 
is nothing to fix, so normalization is skipped. User values may not have the 
scheme (for example: 127.0.0.1:8080), so only those need normalization.
    .withUrlNormalization() is just metadata. It tells the system: “this option 
is a URL, and use this scheme when fixing user input.”
   
   ```
   So:
   Default → already correct → no change
   User value → may be incomplete → normalize
   ```



-- 
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]

Reply via email to