mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-26 19:11:29 +01:00
updated log message to assist in debugging an issue
This commit is contained in:
@@ -743,7 +743,7 @@ public final class Settings {
|
|||||||
try {
|
try {
|
||||||
value = Integer.parseInt(Settings.getString(key));
|
value = Integer.parseInt(Settings.getString(key));
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
LOGGER.trace("Could not convert property '{}={}' to an int.", key, Settings.getString(key));
|
LOGGER.debug("Could not convert property '{}={}' to an int; using {} instead.", key, Settings.getString(key), defaultValue);
|
||||||
value = defaultValue;
|
value = defaultValue;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -139,6 +139,18 @@ public class SettingsTest extends BaseTest {
|
|||||||
Assert.assertEquals(expResult, result);
|
Assert.assertEquals(expResult, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test of getInt method, of class Settings.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testGetIntDefault() throws InvalidSettingException {
|
||||||
|
String key = "SomeKey";
|
||||||
|
int expResult = 85;
|
||||||
|
Settings.setString(key, "blue");
|
||||||
|
int result = Settings.getInt(key, expResult);
|
||||||
|
Assert.assertEquals(expResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test of getLong method, of class Settings.
|
* Test of getLong method, of class Settings.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user