UIDefaultsLoader and FlatStylingSupport: explicitly specify throws IllegalArgumentException and improved catching

This commit is contained in:
Karl Tauber
2023-05-20 12:09:17 +02:00
parent 97018df2f9
commit bad0428f5b
5 changed files with 170 additions and 62 deletions

View File

@@ -50,12 +50,15 @@ public class UIDefaultsLoaderAccessor
public static Object NULL = ValueType.NULL;
public static Object LAZY = ValueType.LAZY;
public static String resolveValue( String value, Function<String, String> propertiesGetter ) {
public static String resolveValue( String value, Function<String, String> propertiesGetter )
throws IllegalArgumentException
{
return UIDefaultsLoader.resolveValue( value, propertiesGetter );
}
public static Object parseValue( String key, String value, Object[] resultValueType,
Function<String, String> resolver )
throws IllegalArgumentException
{
ValueType[] resultValueType2 = new ValueType[1];
Object result = UIDefaultsLoader.parseValue( key, value, null,
@@ -64,7 +67,9 @@ public class UIDefaultsLoaderAccessor
return result;
}
public static int parseColorRGBA( String value ) {
public static int parseColorRGBA( String value )
throws IllegalArgumentException
{
return UIDefaultsLoader.parseColorRGBA( value );
}
}

View File

@@ -376,7 +376,7 @@ class FlatSyntaxTextAreaActions
dialog.setVisible( true );
lastLocation = dialog.getLocation();
} catch( BadLocationException | IndexOutOfBoundsException | NumberFormatException ex ) {
} catch( BadLocationException | IndexOutOfBoundsException | IllegalArgumentException ex ) {
ex.printStackTrace();
}
}

View File

@@ -82,7 +82,9 @@ class FlatThemePropertiesSupport
this.basePropertyProvider = basePropertyProvider;
}
private String resolveValue( String value ) {
private String resolveValue( String value )
throws IllegalArgumentException
{
return UIDefaultsLoaderAccessor.resolveValue( value, propertiesGetter );
}