Uploaded image for project: 'JikesRVM'
  1. JikesRVM
  2. RVM-814

Wrong exception from Java reflection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: hg tip, 3.0.1
    • Fix Version/s: 3.1.0
    • Component/s: Runtime: Class Library
    • Labels:
      None
    • Environment:

      Intel IA32, Linux 2.6.27, Ubuntu 8.10

      Description

      It appears that Jikes RVM has a bug in the implementation of its reflection.
      For the detail, look at the patch and the test case: reflection.patch and
      Reflection.java. Try the following.

      1. To see the bug, try the following three command lines.

      $javac ReflectionTest.java

      $java -showversion ReflectionTest
      java version "1.6.0_10"
      Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
      Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)

      newInstance: pass
      invokeVirtual: pass
      invokeStatic: pass

      $rvm ReflectionTest
      ...
      newInstance: pass
      invokeVirtual: fail
      unexpected cause of the Invocation target exception:
      java.lang.reflect.InvocationTargetException
      ...
      invokeStatic: fail
      unexpected cause of the Invocation target exception:

      2. To correct the bug, try the following.

      • Apply the patch: reflection.patch
      • Build Jikes RVM
      • Run it

      $rvm ReflectionTest
      newInstance: pass
      invokeVirtual: pass
      invokeStatic: pass

        Gliffy Diagrams

          Attachments

            Activity

            dgrove David Grove created issue -
            Hide
            ianrogers Ian Rogers added a comment -

            Also tracked with a better break down of the actual problem in MRP: http://jira.codehaus.org/browse/MRP-3

            Show
            ianrogers Ian Rogers added a comment - Also tracked with a better break down of the actual problem in MRP: http://jira.codehaus.org/browse/MRP-3
            Hide
            pizlo Filip Pizlo added a comment -

            Patch committed in r15700.

            Show
            pizlo Filip Pizlo added a comment - Patch committed in r15700.
            Hide
            ianrogers Ian Rogers added a comment -

            Just FYI, MRP won't apply this patch as it is incorrect.

            Show
            ianrogers Ian Rogers added a comment - Just FYI, MRP won't apply this patch as it is incorrect.
            Hide
            dgrove David Grove added a comment -

            testing alternate fix.

            Show
            dgrove David Grove added a comment - testing alternate fix.
            Hide
            dgrove David Grove added a comment -

            alternate fix committed in r15701.

            Show
            dgrove David Grove added a comment - alternate fix committed in r15701.
            dgrove David Grove made changes -
            Field Original Value New Value
            Workflow jira [ 17405 ] X10 Workflow [ 18686 ]
            dgrove David Grove made changes -
            Attachment reflection.patch [ 11048 ]
            dgrove David Grove made changes -
            Attachment ReflectionTest.java [ 11049 ]
            dgrove David Grove made changes -
            Priority Critical [ 9 ] High [ 2 ]

              People

              • Assignee:
                dgrove David Grove
                Reporter:
                bclee Byeong Lee
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: