diff --git a/test/java/lang/instrument/RedefineMethodWithAnnotations.sh b/test/java/lang/instrument/RedefineMethodWithAnnotations.sh index 9bde206f17a1d33b9e8539a7240985ff858ffaa6..b8f869cd02a6af8ab5b4a9005dab766fb7bdff5e 100644 --- a/test/java/lang/instrument/RedefineMethodWithAnnotations.sh +++ b/test/java/lang/instrument/RedefineMethodWithAnnotations.sh @@ -68,11 +68,12 @@ cp "${TESTSRC}"/RedefineMethodWithAnnotationsAnnotations.java \ 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 --git a/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java b/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java index 6cfbe21eb894d0a58266789a03b420f034dccbfe..2b67e09871ac6d350f4b09c0d90788987a6dadff 100644 --- a/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java +++ b/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java @@ -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 --git a/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java b/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java index 85c430472310be07a0f9dd78d25eae52b14af65b..eb71d2ab80f9e53ad58bf1a27eb926d642bea102 100644 --- a/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java +++ b/test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java @@ -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); + } }