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

Exception when executing switch statement in static interface method

XMLWordPrintable

    • x86_64
    • os_x

      FULL PRODUCT VERSION :
      titan:bin tvo$ java -version
      java version "9.0.1"
      Java(TM) SE Runtime Environment (build 9.0.1+11)
      Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      titan:bin tvo$ uname -a
      Darwin titan.fritz.box 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      irrelevant

      A DESCRIPTION OF THE PROBLEM :
      running my program produces:

      Exception in thread "main" java.lang.IllegalAccessError: Update to static final field de.thomasvogler.xxx.I.$SWITCH_TABLE$de$thomasvogler$xxx$V$T attempted from a different method ($SWITCH_TABLE$de$thomasvogler$xxx$V$T) than the initializer method <clinit>
      at de.thomasvogler.xxx.I.$SWITCH_TABLE$de$thomasvogler$xxx$V$T(I.java:7)
      at de.thomasvogler.xxx.I.getH(I.java:29)
      at de.thomasvogler.xxx.I.create(I.java:15)
      at de.thomasvogler.xxx.Main.run(Main.java:11)
      at de.thomasvogler.xxx.Main.main(Main.java:6)


      REGRESSION. Last worked in version 8u162

      ADDITIONAL REGRESSION INFORMATION:
      titan:bin tvo$ java -version
      java version "9.0.1"
      Java(TM) SE Runtime Environment (build 9.0.1+11)
      Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run main in attached document

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      that the code does not throw an exception
      ACTUAL -
      exception as noted

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      see above

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      downloadable from http://www.thomas-vogler.de/javabug.tgz
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      none available

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: