8057685: javac should not crash compiling type annotations
Reviewed-by: jlahoda
This commit is contained in:
parent
ccdbe5b3a1
commit
2d8d2e83ba
@ -356,7 +356,7 @@ public class TypeAnnotations {
|
|||||||
|
|
||||||
if (sym.getKind() == ElementKind.METHOD) {
|
if (sym.getKind() == ElementKind.METHOD) {
|
||||||
sym.type.asMethodType().restype = type;
|
sym.type.asMethodType().restype = type;
|
||||||
} else if (sym.getKind() == ElementKind.PARAMETER) {
|
} else if (sym.getKind() == ElementKind.PARAMETER && currentLambda == null) {
|
||||||
sym.type = type;
|
sym.type = type;
|
||||||
if (sym.getQualifiedName().equals(names._this)) {
|
if (sym.getQualifiedName().equals(names._this)) {
|
||||||
sym.owner.type.asMethodType().recvtype = type;
|
sym.owner.type.asMethodType().recvtype = type;
|
||||||
|
@ -1117,11 +1117,11 @@ public class Annotate {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visitNewClass(JCNewClass tree) {
|
public void visitNewClass(JCNewClass tree) {
|
||||||
if (tree.def == null) {
|
scan(tree.encl);
|
||||||
// For an anonymous class instantiation the class
|
scan(tree.typeargs);
|
||||||
// will be visited separately.
|
scan(tree.clazz);
|
||||||
super.visitNewClass(tree);
|
scan(tree.args);
|
||||||
}
|
// the anonymous class instantiation if any will be visited separately.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
* @test
|
* @test
|
||||||
* @bug 8027262
|
* @bug 8027262
|
||||||
* @summary Stress test for type annotatons
|
* @summary Stress test for type annotatons
|
||||||
* @ignore 8057685 javac should not crash compiling type annotations
|
|
||||||
* @compile AllLocations.java
|
* @compile AllLocations.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user