UIDefaultsLoader: do not add properties with empty values to UI defaults (value was an empty string)

This commit is contained in:
Karl Tauber
2021-11-04 00:21:57 +01:00
parent 52f6e7fc32
commit e49459fd8b
2 changed files with 1 additions and 2 deletions

View File

@@ -355,7 +355,7 @@ class UIDefaultsLoader
value = value.trim();
// null
if( value.equals( "null" ) ) {
if( value.equals( "null" ) || value.isEmpty() ) {
resultValueType[0] = ValueType.NULL;
return null;
}

View File

@@ -79,7 +79,6 @@ public class TestUIDefaultsLoader
void parseFonts() {
// style
UIManager.put( "defaultFont", new Font( Font.DIALOG, Font.PLAIN, 10 ) );
assertFontEquals( Font.DIALOG, Font.PLAIN, 10, "" );
assertFontEquals( Font.DIALOG, Font.PLAIN, 10, "normal" );
assertFontEquals( Font.DIALOG, Font.BOLD, 10, "bold" );
assertFontEquals( Font.DIALOG, Font.ITALIC, 10, "italic" );