Harmony
  1. Harmony
  2. HARMONY-1931

[drlvm][unit] Classlib test javax.swing.AbstractActionTest.testClone fails on drlvm r. 465143

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None

      Description

      The test fails with the following assertion:
      A member of the "class javax.swing.AbstractActionTest$1" with "public" modifiers can not be accessed from the "class javax.swing.AbstractActionTest"

      Error
      java.lang.IllegalAccessException: A member of the "class javax.swing.AbstractActionTest$1" with "public" modifiers can not be accessed from the "class javax.swing.AbstractActionTest" at java.lang.reflect.ReflectExporter.checkMemberAccess(Unknown Source) at javax.swing.AbstractActionTest.testClone(AbstractActionTest.java:232) at java.lang.reflect.VMReflection.invokeMethod(Native Method) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:118) at javax.swing.SwingTestCase$1.run(SwingTestCase.java:49) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:86) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:74) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:131) at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:74) at java.awt.EventDispatchThread.run(EventDispatchThread.java:45)

      To reproduce the bug run

      ant -Dtest.jre.home=%DRLVM_HOME% -Dbuild.module=swing -Dtest.case=javax.swing.AbstractActionTest test

      1. Test1931.java
        0.5 kB
      2. Test1931_2.java
        0.8 kB
        Gregory Shimansky
      3. H-1931kernel_test.patch
        3 kB
        Elena Semukhina
      4. H-1931_ReflectExporter.patch
        2 kB
        Elena Semukhina

        Activity

        Hide
        Gregory Shimansky added a comment -

        VERIFIED

        Show
        Gregory Shimansky added a comment - VERIFIED
        Hide
        Elena Semukhina added a comment -

        Verified. All affected tests pass.

        Show
        Elena Semukhina added a comment - Verified. All affected tests pass.
        Hide
        Gregory Shimansky added a comment -

        Patch applied at 473357. Please check that it was applied as expected.

        Show
        Gregory Shimansky added a comment - Patch applied at 473357. Please check that it was applied as expected.
        Hide
        Elena Semukhina added a comment -

        As the patch fixes one more issue additionally to the reported one, I attached a H-1931kernel_test.patch with a test class which should be added to drlvm kernel tests.
        The test class contains two tests. If compiled with ECJ, both tests should fail and if compiled with javac, the second one should fail. After the fix is applied, both tests should pass on both compilers.

        Show
        Elena Semukhina added a comment - As the patch fixes one more issue additionally to the reported one, I attached a H-1931kernel_test.patch with a test class which should be added to drlvm kernel tests. The test class contains two tests. If compiled with ECJ, both tests should fail and if compiled with javac, the second one should fail. After the fix is applied, both tests should pass on both compilers.
        Hide
        Elena Semukhina added a comment -

        The test fails on checking accessibility of the public method of a local class. Such methods should be accessible from the class that encloses the local class.
        Eclipse compiler provides a private modifier to local classes while Sun's compiler does not provide any modifiers.

        I attached the patch which fixes the algorithm of checking accessibility in ReflectExporter.java.

        Show
        Elena Semukhina added a comment - The test fails on checking accessibility of the public method of a local class. Such methods should be accessible from the class that encloses the local class. Eclipse compiler provides a private modifier to local classes while Sun's compiler does not provide any modifiers. I attached the patch which fixes the algorithm of checking accessibility in ReflectExporter.java.
        Hide
        Gregory Shimansky added a comment -

        Another test written by Elena Semukhina which she sent to me while JIRA was down.

        Show
        Gregory Shimansky added a comment - Another test written by Elena Semukhina which she sent to me while JIRA was down.
        Hide
        Elena Semukhina added a comment -

        The problem appeared after the classlib build system switched to use ECJ as default compiler. I attached the test which being compiled with javac passes but being compiled with Eclipse compiler throws the following exception:

        >%DRLVM% Test1931
        java.lang.IllegalAccessException: A member of the "class Test1931$1" with "public" modifiers can not be accessed from the "class Test1931"
        at java.lang.reflect.ReflectExporter.checkMemberAccess(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at Test1931.test(Test1931.java:14)
        at Test1931.main(Test1931.java:19)

        To compile with Eclipse compiler please use the following command:
        java -classpath org.eclipse.jdt.core_3.1.1.jar org.eclipse.jdt.internal.compiler.batch.Main Test1931.java

        Show
        Elena Semukhina added a comment - The problem appeared after the classlib build system switched to use ECJ as default compiler. I attached the test which being compiled with javac passes but being compiled with Eclipse compiler throws the following exception: >%DRLVM% Test1931 java.lang.IllegalAccessException: A member of the "class Test1931$1" with "public" modifiers can not be accessed from the "class Test1931" at java.lang.reflect.ReflectExporter.checkMemberAccess(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at Test1931.test(Test1931.java:14) at Test1931.main(Test1931.java:19) To compile with Eclipse compiler please use the following command: java -classpath org.eclipse.jdt.core_3.1.1.jar org.eclipse.jdt.internal.compiler.batch.Main Test1931.java
        Show
        Alexei Fedotov added a comment - See http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM

          People

          • Assignee:
            Gregory Shimansky
            Reporter:
            Elena Semukhina
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development