mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 00:03:43 +01:00
Slight simplification to standard getInt and getLong.
This commit is contained in:
@@ -659,13 +659,11 @@ public final class Settings {
|
||||
* @throws InvalidSettingException is thrown if there is an error retrieving the setting
|
||||
*/
|
||||
public static int getInt(String key) throws InvalidSettingException {
|
||||
int value;
|
||||
try {
|
||||
value = Integer.parseInt(Settings.getString(key));
|
||||
return Integer.parseInt(Settings.getString(key));
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new InvalidSettingException("Could not convert property '" + key + "' to an int.", ex);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -699,13 +697,11 @@ public final class Settings {
|
||||
* @throws InvalidSettingException is thrown if there is an error retrieving the setting
|
||||
*/
|
||||
public static long getLong(String key) throws InvalidSettingException {
|
||||
long value;
|
||||
try {
|
||||
value = Long.parseLong(Settings.getString(key));
|
||||
return Long.parseLong(Settings.getString(key));
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new InvalidSettingException("Could not convert property '" + key + "' to a long.", ex);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user