-
Enhancement
-
Resolution: Duplicate
-
P5
-
6
-
generic
-
generic
Due to ###@###.###:
class Test {
{
if (true)
String[] s = null;
}
}
Produces two error messsages:
Test.java:4: '.class' expected
String[] s = null;
^
Test.java:4: not a statement
String[] s = null;
^
2 errors
Also, if the [] is removed, two errors are produced:
Test.java:4: not a statement
String s = null;
^
Test.java:4: ';' expected
String s = null;
^
2 errors
Ideally, only the error messages saying "not a statement" should be given.
###@###.### 2004-07-08
class Test {
{
if (true)
String[] s = null;
}
}
Produces two error messsages:
Test.java:4: '.class' expected
String[] s = null;
^
Test.java:4: not a statement
String[] s = null;
^
2 errors
Also, if the [] is removed, two errors are produced:
Test.java:4: not a statement
String s = null;
^
Test.java:4: ';' expected
String s = null;
^
2 errors
Ideally, only the error messages saying "not a statement" should be given.
###@###.### 2004-07-08
- duplicates
-
JDK-7156633 (javac) incorrect errors when parsing variable declaration in block statements.
-
- Closed
-
- relates to
-
JDK-5069984 javac incorrectness
-
- Closed
-