Copilot commented on code in PR #10456:
URL: https://github.com/apache/cloudstack/pull/10456#discussion_r2726702692
##########
framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java:
##########
@@ -120,10 +120,18 @@ public String toString() {
static ConfigDepotImpl s_depot = null;
- static public void init(ConfigDepotImpl depot) {
+ private String _defaultValueIfEmpty = null;
+
+ public static void init(ConfigDepotImpl depot) {
s_depot = depot;
}
+ public ConfigKey(Class<T> type, String name, String category, String
defaultValue, String description, boolean isDynamic, Scope scope, T multiplier,
+ String displayText, String parent, Ternary<String,
String, Long> group, Pair<String, Long> subGroup, Kind kind, String options,
String defaultValueIfEmpty) {
+ this(type, name, category, defaultValue, description, isDynamic,
scope, multiplier, displayText, parent, group, subGroup, kind, options);
+ this._defaultValueIfEmpty = defaultValueIfEmpty;
+ }
Review Comment:
Consider adding JavaDoc documentation for this new constructor to explain
the purpose and usage of the `defaultValueIfEmpty` parameter. This would help
other developers understand when and why to use this constructor variant.
##########
framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java:
##########
@@ -120,10 +120,18 @@ public String toString() {
static ConfigDepotImpl s_depot = null;
Review Comment:
Consider adding JavaDoc documentation for the new `_defaultValueIfEmpty`
field to explain its purpose. This field represents the value to use when the
configuration is explicitly set to empty string, as opposed to using the
default value. This distinction is important for understanding the behavior
when users clear a configuration value.
```suggestion
/**
* Alternative default value used when the configuration value is
explicitly set
* to the empty string. This allows distinguishing between:
* <ul>
* <li>a missing or unset configuration value, which uses {@link
#_defaultValue}, and</li>
* <li>a configuration value explicitly cleared to "", which uses this
value instead.</li>
* </ul>
*/
```
--
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]