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


##########
hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/config/HugeConfig.java:
##########
@@ -88,8 +88,12 @@ private void setLayoutIfNeeded(Configuration conf) {
     public <T, R> R get(TypedOption<T, R> option) {
         Object value = this.getProperty(option.name());
         if (value == null) {
-            return option.defaultValue();
+            value = option.defaultValue();
         }
+
+        // Normalize URL options if needed (add scheme like http://)

Review Comment:
   ```java
   // Introduces a fromDefault flag to separate system defaults from user input,
   // avoiding redundant normalization of valid defaults while preserving 
safety for user values.
   ```
   ```java
   public <T, R> R get(TypedOption<T, R> option) {
       Object value = this.getProperty(option.name());
       boolean fromDefault = false;
   
       if (value == null) {
           value = option.defaultValue();
           fromDefault = true;
       }
   
       if (!fromDefault) {
           value = normalizeUrlOptionIfNeeded(option.name(), value);
       }
   
       return (R) value;
   }
   ```
   



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