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

java.lang.InternalError thrown by ResourceBundle.getBundle

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.9.0-ea"
      Java(TM) SE Runtime Environment (build 1.9.0-ea-jigsaw-nightly-h3477-20150929-b83)
      Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-jigsaw-nightly-h3477-20150929-b83, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux 3.13.0-53-generic #89-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      This code throws a java.lang.InternalError

                  Field field = Toolkit.class.getDeclaredField("resources");
                  field.setAccessible(true);
                  field.set(null, ResourceBundle.getBundle("sun.awt.resources.awt"));

      We use this piece of code in JOSM as a workaround for JDK-6292739 (unresolved) whic causes https://josm.openstreetmap.de/ticket/6345

      With Jigsaw EA b83, it results in java.lang.InternalError. I assume a proper Exception should be thrown instead.

      REGRESSION. Last worked in version 8u60

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      AWT toolkit updates its internal preferences
      ACTUAL -
      java.lang.InternalError: legacy getBundle can't be used to find sun.awt.resources.awt in module java.desktop

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.InternalError: legacy getBundle can't be used to find sun.awt.resources.awt in module java.desktop
      at java.util.ResourceBundle$Control.newBundle(java.base@9.0/ResourceBundle.java:3103)
      at java.util.ResourceBundle.loadBundle(java.base@9.0/ResourceBundle.java:1913)
      at java.util.ResourceBundle.findBundle(java.base@9.0/ResourceBundle.java:1741)
      at java.util.ResourceBundle.findBundle(java.base@9.0/ResourceBundle.java:1692)
      at java.util.ResourceBundle.findBundle(java.base@9.0/ResourceBundle.java:1692)
      at java.util.ResourceBundle.getBundleImpl(java.base@9.0/ResourceBundle.java:1633)
      at java.util.ResourceBundle.getBundleImpl(java.base@9.0/ResourceBundle.java:1573)
      at java.util.ResourceBundle.getBundleImpl(java.base@9.0/ResourceBundle.java:1542)
      at java.util.ResourceBundle.getBundle(java.base@9.0/ResourceBundle.java:910)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
                  Field field = Toolkit.class.getDeclaredField("resources");
                  field.setAccessible(true);
                  field.set(null, ResourceBundle.getBundle("sun.awt.resources.awt"));
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      add a catch(InternalError)

      SUPPORT :
      YES

        Issue Links

          Activity

          Hide
          alanb Alan Bateman added a comment -
          Show
          alanb Alan Bateman added a comment - See JDK-8136804 .

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: