-
Bug
-
Resolution: Fixed
-
P4
-
5.0u2
-
b53
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
It appears that Properties.keys() is used instead of Properties.propertyNames() in the implementation of sun.management.RuntimeImpl's SystemProperties attribute. It only shows the properties from the given Properties instance itself. This leads to partial results when one does
Properties myProps = new Properties( System.getProperties() );
myProps.load(...);
System.setProperties( myProps );
Worse, these partial results never include the original system properties!
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See above.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would expect that Properties.propertyNames() and Properties.getProperty() would be used to produce comprehensive results inclusive of any/all nested/default Properties objects.
ACTUAL -
The actual result in the example above is that only the properties from the 'myProp' level are included.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
None -- other than to write your own replacement MBean...
###@###.### 2005-04-22 17:48:22 GMT
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
It appears that Properties.keys() is used instead of Properties.propertyNames() in the implementation of sun.management.RuntimeImpl's SystemProperties attribute. It only shows the properties from the given Properties instance itself. This leads to partial results when one does
Properties myProps = new Properties( System.getProperties() );
myProps.load(...);
System.setProperties( myProps );
Worse, these partial results never include the original system properties!
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See above.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would expect that Properties.propertyNames() and Properties.getProperty() would be used to produce comprehensive results inclusive of any/all nested/default Properties objects.
ACTUAL -
The actual result in the example above is that only the properties from the 'myProp' level are included.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
None -- other than to write your own replacement MBean...
###@###.### 2005-04-22 17:48:22 GMT
- relates to
-
JDK-6253413 java.util.Properties should offer an Iterator<String> for keys
-
- Resolved
-