DaanHoogland commented on code in PR #11770:
URL: https://github.com/apache/cloudstack/pull/11770#discussion_r2401079047


##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -982,6 +982,19 @@ private void 
updateCustomDisplayNameOnHypervisorsList(String previousValue, Stri
         }
     }
 
+    protected String getNormalizedEmptyValueForConfig(final String name, final 
String inputValue,
+                          final Long configStorageId) {
+        String value = inputValue.trim();
+        if (!value.isEmpty() && !value.equals("null")) {
+            return value;
+        }
+        if (configStorageId != null) {
+            return "";
+        }
+        ConfigKey<?> key = _configDepot.get(name);
+        return (key != null && key.type() == String.class) ? "" : null;

Review Comment:
   edge case: can the default value of a String be NULL?
   we have the key here so we could as well check the default value for that. 
However, when “” is passed is it meant to be a reset or an explicit set to “”…?
   I think this is the best we can do now, except maybe for making the value 
field non-null completely.



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

Reply via email to