# HG changeset patch # User coleenp # Date 1366217445 14400 # Node ID 7f9f69729934812800cbc6616e882b9d8ef2675c # Parent 7ded74ffea36c647914d76799c19be8f508b2297 8009531: Crash when redefining class with annotated method Summary: Add code to annotated methods and command line flags to the tests to verify bug above Reviewed-by: acorn, sspitsyn, dcubed, dholmes, alanb diff -r 7ded74ffea36 -r 7f9f69729934 test/java/lang/instrument/RedefineMethodWithAnnotations.sh --- a/test/java/lang/instrument/RedefineMethodWithAnnotations.sh Wed Apr 17 16:11:19 2013 +0100 +++ b/test/java/lang/instrument/RedefineMethodWithAnnotations.sh Wed Apr 17 12:50:45 2013 -0400 @@ -68,11 +68,12 @@ RedefineMethodWithAnnotationsAnnotations.java "${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodWithAnnotationsAgent.jar \ + -XX:+StressLdcRewrite -XX:+IgnoreUnrecognizedVMOptions \ -cp "${TESTCLASSES}" RedefineMethodWithAnnotationsApp > output.log 2>&1 cat output.log -MESG="Exception" -grep "$MESG" output.log +MESG="Exception|fatal" +egrep "$MESG" output.log result=$? if [ "$result" = 0 ]; then echo "FAIL: found '$MESG' in the test output" diff -r 7ded74ffea36 -r 7f9f69729934 test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java --- a/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java Wed Apr 17 16:11:19 2013 +0100 +++ b/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java Wed Apr 17 12:50:45 2013 -0400 @@ -27,7 +27,13 @@ */ public class RedefineMethodWithAnnotationsTarget { public void annotatedMethod(@ParameterAnnotation( - value = ParameterAnnotation.STRING_VALUE_1) String parameter) { } + value = ParameterAnnotation.STRING_VALUE_1) String parameter) { + System.out.println("First version of annotatedMethod(String)"); + System.out.println("parameter is " + parameter); + } public void annotatedMethod(@ParameterAnnotation( - value = ParameterAnnotation.INT_VALUE_1) int parameter) { } + value = ParameterAnnotation.INT_VALUE_1) int parameter) { + System.out.println("First version of annotatedMethod(int)"); + System.out.println("parameter is " + parameter); + } } diff -r 7ded74ffea36 -r 7f9f69729934 test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java --- a/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java Wed Apr 17 16:11:19 2013 +0100 +++ b/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java Wed Apr 17 12:50:45 2013 -0400 @@ -29,7 +29,13 @@ */ public class RedefineMethodWithAnnotationsTarget { public void annotatedMethod(@ParameterAnnotation( - value = ParameterAnnotation.INT_VALUE_2) int parameter) { } + value = ParameterAnnotation.INT_VALUE_2) int parameter) { + System.out.println("Second version of annotatedMethod(int)"); + System.out.println("parameter is " + parameter); + } public void annotatedMethod(@ParameterAnnotation( - value = ParameterAnnotation.STRING_VALUE_2) String parameter) { } + value = ParameterAnnotation.STRING_VALUE_2) String parameter) { + System.out.println("Second version of annotatedMethod(String)"); + System.out.println("parameter is " + parameter); + } }