mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8178966: Don't swallow early bootstrap exceptions in Boolean.getBoolean, Integer.getInteger and Long.getLong
Co-authored-by: Peter Levart <plevart@openjdk.org> Reviewed-by: jpai, rriggs
This commit is contained in:
parent
d6b40d3033
commit
e03b1506d3
3 changed files with 3 additions and 16 deletions
|
@ -275,12 +275,7 @@ public final class Boolean implements java.io.Serializable,
|
|||
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public static boolean getBoolean(String name) {
|
||||
boolean result = false;
|
||||
try {
|
||||
result = parseBoolean(System.getProperty(name));
|
||||
} catch (IllegalArgumentException | NullPointerException e) {
|
||||
}
|
||||
return result;
|
||||
return name != null && !name.isEmpty() && parseBoolean(System.getProperty(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue