jdk-24/langtools/test/tools/javac/7086595/T7086595.java
Maurizio Cimadamore 8db2f8de59 7086595: Error message bug: name of initializer is 'null'
Implementation of MethodSymbol.location() should take into account static/instance initializers

Reviewed-by: jjg
2011-09-13 14:14:57 +01:00

33 lines
559 B
Java

/*
* @test /nodynamiccopyright/
* @bug 7086595
* @summary Error message bug: name of initializer is 'null'
* @compile/fail/ref=T7086595.out -XDrawDiagnostics T7086595.java
*/
class T7086595 {
String s = "x";
String s = nonExistent;
int foo() {
String s = "x";
String s = nonExistent;
}
static int bar() {
String s = "x";
String s = nonExistent;
}
{
String s = "x";
String s = nonExistent;
}
static {
String s = "x";
String s = nonExistent;
}
}