-
Enhancement
-
Resolution: Fixed
-
P5
-
5.0u2
-
b03
-
generic
-
generic
-
Not verified
From the java.lang.Boolean(boolean) API:
"It is rarely appropriate to use this constructor. Unless a new instance is required, the static factory valueOf(boolean) is generally a better choice. It is likely to yield significantly better space and time performance."
Boolean objects are immutable, but method java.util.prefs.AbstractPreferences.isUserNode() still uses the Constructor rather than the static method.
public boolean isUserNode() {
Boolean result = (Boolean)
AccessController.doPrivileged( new PrivilegedAction() {
public Object run() {
return new Boolean(root == Preferences.userRoot()); // <--- here
}
});
return result.booleanValue();
}
###@###.### 2005-03-21 11:46:44 GMT
"It is rarely appropriate to use this constructor. Unless a new instance is required, the static factory valueOf(boolean) is generally a better choice. It is likely to yield significantly better space and time performance."
Boolean objects are immutable, but method java.util.prefs.AbstractPreferences.isUserNode() still uses the Constructor rather than the static method.
public boolean isUserNode() {
Boolean result = (Boolean)
AccessController.doPrivileged( new PrivilegedAction() {
public Object run() {
return new Boolean(root == Preferences.userRoot()); // <--- here
}
});
return result.booleanValue();
}
###@###.### 2005-03-21 11:46:44 GMT