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

JDWP/JVMDI: JDI sourceDebugExtension() throws UnsupportedOperationException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-svc
    • beta2
    • generic
    • generic
    • Not verified

      A simple test shows that although canGetSourceDebugExtension() is true,
      sourceDebugExtension() throws UnsupportedOperationException.

      % java SourceDebugExtensionTest
      run args: [SourceDebugExtensionTarg]
      JVM version:1.4.0-internal
      JDI version: 1.4
      JVM description: Java Debug Interface (Reference Implementation) version 1.4
      Java Debug Wire Protocol (Reference Implementation) version 1.4
      JVM Debug Interface version 1.1
      JVM version 1.4.0-internal (Java HotSpot(TM) Client VM, interpreted mode)
      canGetSourceDebugExtension() is true
      Exception in thread "main" java.lang.UnsupportedOperationException
              at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:41)
              at com.sun.tools.jdi.ReferenceTypeImpl.sourceDebugExtension(ReferenceTypeImpl.java:601)
              at SourceDebugExtensionTest.runTests(SourceDebugExtensionTest.java:51)
              at TestScaffold.startTests(TestScaffold.java:301)
              at SourceDebugExtensionTest.main(SourceDebugExtensionTest.java:31)

      ----

      Significant code of test:

              if (!vm().canGetSourceDebugExtension()) {
                  failure("FAIL: canGetSourceDebugExtension() is false");
              } else {
                  println("canGetSourceDebugExtension() is true");
              }

              String expected = "An expected attribute string";
              String sde = targetClass.sourceDebugExtension();
              if (!sde.equals(expected)) {
                  failure("FAIL: got '" + sde +
                          "' expected: '" + expected + "'");
              }

            rfield Robert Field (Inactive)
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: