8057685: javac should not crash compiling type annotations

Reviewed-by: jlahoda
This commit is contained in:
Srikanth Adayapalam 2015-10-23 08:21:41 +05:30
parent ccdbe5b3a1
commit 2d8d2e83ba
3 changed files with 6 additions and 7 deletions

View File

@ -356,7 +356,7 @@ public class TypeAnnotations {
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;

View File

@ -1117,11 +1117,11 @@ public class Annotate {
@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.
}
}

View File

@ -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
*/