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

sun.instrument.TransformerManager eats up exceptions thrown by ClassFileTransformer.transform() method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 24
    • core-svc
    • None

      The sun.instrument.TransformerManager.transform() method implementation, currently has this:

          try {
              transformedBytes = transformer.transform( module,
                                                          loader,
                                                          classname,
                                                          classBeingRedefined,
                                                          protectionDomain,
                                                          bufferToUse);
          }
          catch (Throwable t) {
              // don't let any one transformer mess it up for the others.
              // This is where we need to put some logging. What should go here? FIXME
          }

      As you will notice, anything thrown from the ClassFileTransformer's transform() method gets eaten up in the catch block without it ever being reported. There's even a FIXME code comment about it.

      Addressing this may not be straightforward since java.lang.instrument.Instrument.addTransformer(...) notes (among other things):

      > If a transformer throws an exception during execution, the JVM will still call the other registered transformers in order.

      So it might need some additional thought on how/when these exceptions can be reported.

            Unassigned Unassigned
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: