Details
-
Bug
-
Resolution: Fixed
-
P2
-
24
Description
The method could be simplified like so:
static int powerOfPropertyOr(String name, int defaultPower) {
final String property = GetPropertyAction.privilegedGetProperty(PROPERTY_PATH + name, Integer.toString(defaultPower));
try {
return 1 << Math.clamp(Integer.parseInt(property), 0, Integer.SIZE - 2);
} catch (NumberFormatException _) {
// ignore
}
return defaultPower;
}
static int powerOfPropertyOr(String name, int defaultPower) {
final String property = GetPropertyAction.privilegedGetProperty(PROPERTY_PATH + name, Integer.toString(defaultPower));
try {
return 1 << Math.clamp(Integer.parseInt(property), 0, Integer.SIZE - 2);
} catch (NumberFormatException _) {
// ignore
}
return defaultPower;
}
Attachments
Issue Links
- relates to
-
JDK-8340081 Test java/foreign/TestLinker.java failed failed: missing permission java.lang.foreign.native.threshold.power.fill
- Resolved
- links to
-
Commit(master) openjdk/jdk/0c36177f
-
Review(master) openjdk/jdk/20985