Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6260131

sun.management.RuntimeImpl's SystemProperties attribute gives partial results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0u2
    • core-svc

      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

            mchung Mandy Chung (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: