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

PropertyResourceBundle.getBundle(class, ...) gives recursion, OutOfMemoryError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.7
    • core-libs



      Name: tb29552 Date: 10/06/98


      /*

      JDK 1.1.5, 1.1.6, 1.1.7 and JDK 1.2:

      1. Compile this source code (T.java) and create a properties
         file called T.properties. Application will abend with
         "Out of Memory" Exception.

      2. T.java :

      --------------------------------------------------
      */
      import java.util.*;
      public class T {
          public T() {
              final String fileName = getClass().getName();
              System.out.println("Looking for properties file " + fileName);
              PropertyResourceBundle m =
                  (PropertyResourceBundle) PropertyResourceBundle.getBundle(fileName, Locale.getDefault());
              System.out.println("Found: "+m);
          }
       
          public static void main(String[] args) {
              new T();
          }
      }
      /*

      3. Output:
        Looking for properties file T
        Looking for properties file T
        java.lang.OutOfMemoryError
              at java.util.ResourceBundle.getLoader(ResourceBundle.java)
              at java.util.ResourceBundle.getBundle(ResourceBundle.java)
              at T.<init>(T.java:9)
        ...
      */

      (Review ID: 37712)
      ======================================================================

            duke J. Duke
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: