Skip to content

Commit

Permalink
Set canRetransform flag to false in instrumentation.
Browse files Browse the repository at this point in the history
We do not need to retransform classes once they are loaded.
All instrumentation byte-code is pushed at loading time.

This fixes a problem with Java 7 that was failing to add
a transformer because we did not declare retransformation
capability in `MANIFEST.MF` file in Java agent jar.
Java 6 allowed to add transformer due to a bug.
  • Loading branch information
gkossakowski committed Nov 10, 2012
1 parent 27f1b0a commit 90f12c4
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -20,6 +20,6 @@ public static void premain(String args, Instrumentation inst) throws Unmodifiabl
// and the test-case itself won't be loaded yet. We rely here on the fact that ASMTransformer does
// not depend on Scala library. In case our assumptions are wrong we can always insert call to
// inst.retransformClasses.
inst.addTransformer(new ASMTransformer(), true);
inst.addTransformer(new ASMTransformer(), false);
}
}

0 comments on commit 90f12c4

Please sign in to comment.