jdk-24/test/langtools/tools/javac/6563143/InvalidAnonymous.java
Jan Lahoda df82d9a4b5 8242802: javac crashes when checking equals and hashCode in unresolvable anonymous class
Preventing NullPointerException when a class has an erroneous supertype and does not have an implementation of the equals method.

Reviewed-by: darcy, vromero
2020-04-20 12:36:09 +02:00

13 lines
410 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8242802
* @summary Verify javac does not crash while checking for equals/hashCode overrides
* @compile/fail/ref=InvalidAnonymous.out -XDrawDiagnostics InvalidAnonymous.java
* @compile/fail/ref=InvalidAnonymous.out -XDrawDiagnostics -Xlint:overrides InvalidAnonymous.java
*/
public class InvalidAnonymous {
private void t() {
new Undefined() {};
}
}