# HG changeset patch # User sadayapalam # Date 1445568701 -19800 # Node ID f563e436a81f11f6e29dc4c2f495bcc5b351cea2 # Parent e0404c48dca772e03395e1f75a91bb094e80d87d 8057685: javac should not crash compiling type annotations Reviewed-by: jlahoda diff -r e0404c48dca7 -r f563e436a81f langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Thu Oct 22 11:12:55 2015 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Fri Oct 23 08:21:41 2015 +0530 @@ -356,7 +356,7 @@ if (sym.getKind() == ElementKind.METHOD) { sym.type.asMethodType().restype = type; - } else if (sym.getKind() == ElementKind.PARAMETER) { + } else if (sym.getKind() == ElementKind.PARAMETER && currentLambda == null) { sym.type = type; if (sym.getQualifiedName().equals(names._this)) { sym.owner.type.asMethodType().recvtype = type; diff -r e0404c48dca7 -r f563e436a81f langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java Thu Oct 22 11:12:55 2015 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java Fri Oct 23 08:21:41 2015 +0530 @@ -1117,11 +1117,11 @@ @Override public void visitNewClass(JCNewClass tree) { - if (tree.def == null) { - // For an anonymous class instantiation the class - // will be visited separately. - super.visitNewClass(tree); - } + scan(tree.encl); + scan(tree.typeargs); + scan(tree.clazz); + scan(tree.args); + // the anonymous class instantiation if any will be visited separately. } } diff -r e0404c48dca7 -r f563e436a81f langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AllLocations.java --- a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AllLocations.java Thu Oct 22 11:12:55 2015 -0700 +++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AllLocations.java Fri Oct 23 08:21:41 2015 +0530 @@ -25,7 +25,6 @@ * @test * @bug 8027262 * @summary Stress test for type annotatons - * @ignore 8057685 javac should not crash compiling type annotations * @compile AllLocations.java */