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

Support throwing exceptions out of a java.lang.instrument ClassFileTransformer

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 7
    • Fix Version/s: 10
    • Component/s: core-svc

      Description

      Currently if an exception is thrown out of a java.lang.instrument.ClassFileTransformer's transform method, the instrumentation agent considers this a bug in the transformer and for robustness purposes simply passes the original bytecodes to the virtual machine for definition. There are situations where it would be very useful to be able to cause that exception (such as a VerifyError, ClassFormatError, etc.) to be propagated to the caller of ClassLoader.defineClass(). Obviously the default behavior of the instrumentation agent can not be changed, but perhaps the Instrumentation APIs can be extended so that for a particular ClassFileTransformer, it can be selected whether to propagate exceptions out to the caller.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kbr Kenneth Russell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: