Copilot commented on code in PR #2944:
URL:
https://github.com/apache/incubator-hugegraph/pull/2944#discussion_r2724261894
##########
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://)
+ value = normalizeUrlOptionIfNeeded(option.name(), value);
+
return (R) value;
Review Comment:
The URL normalization happens at retrieval time in the get() method rather
than at storage time.
This means:
1. the original unnormalized value remains in the underlying configuration
storage and will be returned by direct access methods like getProperty() if
they exist
2. if the configuration is saved using save(), the unnormalized values will
be written to the file, potentially causing confusion.
Consider documenting this behavior or normalizing at storage time instead to
maintain consistency.
--
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]