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

Wrong charset cached during VM start-up

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 6u14
    • core-libs

      FULL PRODUCT VERSION :
      1.6.0_14

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP SR-3

      A DESCRIPTION OF THE PROBLEM :
      After VM start-up, sun.nio.cs.ext.ExtendedCharsets may be customized according system property "sun.nio.cs.map".
      If a charset is yet cached in java.nio.charset.Charset before VM start-up finish, it will remain there, causing that customization by system property "sun.nio.cs.map" has no effect.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - Set sun.nio.cs.map="Windows-31J/Shift_JIS"
      - Invoke Charset.forName("Shift_JIS") before sun.misc.VM.isBooted() returns true
      - Invoke Charset.forName("Shift_JIS") after sun.misc.VM.isBooted() returns true
      - Check charset object's name() methode

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      windows-31j
      ACTUAL -
      Shift_JIS

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      class java.nio.charset.Charset should have interface to clear it's cache, that could be invoked from charset provider in case of update.
      or:
      interface java.nio.charset.spi.CharsetProvider should have method, to determine, if the charset provider is finally initialized.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: