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

Exception in thread "main" java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: hs25
    • Fix Version/s: None
    • Component/s: hotspot
    • Subcomponent:
    • Introduced In Build:
      b53
    • Introduced In Version:
    • CPU:
      x86
    • OS:
      linux

      Description

      Apache reported the following regression issue with jdk 8 ea b111:

      Exception in thread "main" java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object; from class TestCloneInterface
              at TestCloneInterface.test(TestCloneInterface.java:15)
              at TestCloneInterface.main(TestCloneInterface.java:19)

      The testcase TestCloneInterface.java is attached. Testcase appear to pass with jdk 8 ea b109 (and b110).


      Below is email from Apache:
      ----------------------------------------------------------------------------------------------------
      Hi,

      I was able to reproduce with a simple test case that emulates the UIMA code.
      See attached test case, just compile it with any JDK and run with b111:

      With Java 7 or JDK8b109:

      > javac TestCloneInterface.java
      > java TestCloneInterface
      >

      With JDK8b111:

      > java TestCloneInterface
      Exception in thread "main" java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object; from class TestCloneInterface
              at TestCloneInterface.test(TestCloneInterface.java:15)
              at TestCloneInterface.main(TestCloneInterface.java:19)
      >

      The bug happens if the clone() method is declared in a superinterface only. Without the additional interface inbetween, test passes.
      Instead of the real interface (the "o" local variable, which is of type "FoobarIntf") it checks access flags on "this", which is of type "TestCloneInterface".

      Uwe

      -----
      Uwe Schindler
      uschindler@apache.org
      Apache Lucene PMC Chair / Committer
      Bremen, Germany
      http://lucene.apache.org/


      -----------------------------------------------------------------------------------------------------------------


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              bvaidya Balchandra Vaidya
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: