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

(rb) REGRESSION: ResourceBundle buggy in JRE6.0 b68

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6
    • core-libs

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b68)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b68, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      ResourceBundle seems buggy and won't return any key/value pairs for one particular properties file in my project. I've seen this in every 6.0 beta I've tried since Mustang betas began. 1.4.x and 1.5 JRE's are all okay reading this properties file.

      Unfortunately, I cannot seem to make a "simple" test case, as every attempt to do so makes the problem go away. You have to run a test program with the jar file from my project containing the properties file on the classpath to see the problem. I tried putting the problematic properties file in its own jar, but then the problem did not surface.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Go to http://sourceforge.net/projects/rtext and download the latest RText version (0.9.4.0). Unfortunately, attempts to make a simple test case failed; you have to include a jar from this project on your classpath to see ResourceBundle fail.
      2. Run the example Java program from this bug report with RText.jar on the classpath as follows:

      <jdk-6-path>\java -classpath RText.jar;. test org.fife.ui.rsyntaxtextarea.TemplateOptionPanel

      Here, the "org.fife.ui.rsyntaxtextarea.TemplateOptionPanel" parameter is the properties file to read and display the key/value pairs for. With any JDK 6.0 beta, Java throws a NullPointerException getting the key enumeration and fails.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The program should read the properties file and list the key/value pairs from the specified properties file. Giving it any other properties file from RText.,jar seems to work; for example,

      <jdk-6-path>\java -classpath C:\RJava\rtext\dist\RText.jar;. test org.fife.ui.rsyntaxtextarea.OptionPanel

      works as expected. Only org.fife.ui.rsyntaxtextarea.TemplateOptionPanel fails.
      ACTUAL -
      Java returns a null value for the key enumeration, when the properties file clearly contains key/value pairs.

      C:\>c:\java\jdk6.0-b68\bin\java -classpath RText.jar;. test org.fife.ui.rsyntaxtextarea.TemplateOptionPanel
      Exception in thread "main" java.lang.NullPointerException
              at test.main(test.java:14)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.NullPointerException
              at test.main(test.java:14)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.util.*;

      public class test {

      public static void main(String[] args) {

      if (args.length!=1) {
      System.err.println("Usage: test <resource-bundle>");
      System.exit(0);
      }

      ResourceBundle msg = ResourceBundle.getBundle(args[0]);
      Enumeration keys = msg.getKeys();
      while (keys.hasMoreElements()) {
      String key = (String)keys.nextElement();
      System.err.println(key + " => " + msg.getObject(key));
      }

      }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None. My project will not run on a 6.0 JDK/JRE unless this is fixed.

      Release Regression From : 5.0
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

            okutsu Masayoshi Okutsu
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: