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

Add classfile modification code to RedefineClassHelper

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • hotspot
    • None

      In order to write test classes for redefinition, you have to either:

      1. use RedefineClassHelper with a String that calls inMemoryJavacompiler,
      2. use asm or Classfile API to programmatically provide new bytes for redefinition, or
      3. compile an old and new version of the class, and read and modify the bytes of the new class so that it can be used to replace the old class.

      With jtreg you can't just provide both versions of the class files because if they have the same name, they'll overwrite each other.

      RedefineClassHelper provides a way of doing 1 and 2. We should add 3 so we can use it for some new tests that need jasm files. There are also tests in java/lang/instrument that do #3 that use NamedBuffer.java that could use RedefineClassHelper instead.

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: