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

Unexpected ClassCastException in ThreadReference.forceEarlyReturn

XMLWordPrintable

    • b89
    • generic
    • generic
    • Verified

      Attached test suspend debugee VM in void method and try call ThreadReference.forceEarlyReturn with PrimitiveValue and ObjectReference and expect InvalidTypeException. When call forceEarlyReturn with PrimitiveValue it throws unexpected ClassCastException.

      Test output:

      Waiting for event by request:
      breakpoint request ForceReturnInvalidTypeTest_Debuggee:14 (enabled)
      Got requested event:
      BreakpointEvent@ForceReturnInvalidTypeTest_Debuggee:14 in thread main
      Call forceEarlyReturn with 0
      Unexpected exception: java.lang.ClassCastException: com.sun.tools.jdi.VoidTypeImpl cannot be cast to com.sun.tools.jdi.PrimitiveTypeImpl
      java.lang.ClassCastException: com.sun.tools.jdi.VoidTypeImpl cannot be cast to com.sun.tools.jdi.PrimitiveTypeImpl
      at com.sun.tools.jdi.PrimitiveValueImpl.convertForAssignmentTo(PrimitiveValueImpl.java:93)
      at com.sun.tools.jdi.PrimitiveValueImpl.prepareForAssignmentTo(PrimitiveValueImpl.java:79)
      at com.sun.tools.jdi.ValueImpl.prepareForAssignment(ValueImpl.java:30)
      at com.sun.tools.jdi.ThreadReferenceImpl.forceEarlyReturn(ThreadReferenceImpl.java:509)
      at ForceReturnInvalidTypeTest.main(ForceReturnInvalidTypeTest.java:181)
      Call
      Waiting for event by request:
      breakpoint request ForceReturnInvalidTypeTest_Debuggee:14 (enabled)
      Got requested event:
      BreakpointEvent@ForceReturnInvalidTypeTest_Debuggee:14 in thread main
      Call forceEarlyReturn with instance of java.lang.Object(id=32)
      Expected com.sun.jdi.InvalidTypeException: Can't assign object value to primitive
      <comment deleted - it was a copy/paste from 6431720.
      See next comment for proper description.
      Failing test names:
      nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn001
      nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn006
      nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn007

            jjh James Holmlund (Inactive)
            sboikovsunw Semen Boikov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: