-
Enhancement
-
Resolution: Fixed
-
P4
-
8
-
b04
-
Verified
Consider the following source code:
---
public class Test {
private void test(int i,) { }
}
---
Compiling this leads to three compile-time errors:
---
$ javac Test.java
Test.java:2: error: illegal start of type
private void test(int i,) { }
^
Test.java:2: error: ')' expected
private void test(int i,) { }
^
Test.java:2: error: ';' expected
private void test(int i,) { }
^
3 errors
---
Out of these, only the first error is really significant, the other two errors are follow-up errors caused by tokens removed by code in JavacParser (in reportSyntaxError around line 459):
---
if (token.pos == errorPos)
nextToken(); // guarantee progress
---
---
public class Test {
private void test(int i,) { }
}
---
Compiling this leads to three compile-time errors:
---
$ javac Test.java
Test.java:2: error: illegal start of type
private void test(int i,) { }
^
Test.java:2: error: ')' expected
private void test(int i,) { }
^
Test.java:2: error: ';' expected
private void test(int i,) { }
^
3 errors
---
Out of these, only the first error is really significant, the other two errors are follow-up errors caused by tokens removed by code in JavacParser (in reportSyntaxError around line 459):
---
if (token.pos == errorPos)
nextToken(); // guarantee progress
---
- relates to
-
JDK-8065753 javac crashing on a html-like file
-
- Closed
-
-
JDK-8036019 Insufficient alternatives listed in some errors produced by the parser
-
- Resolved
-
-
JDK-8030091 Request to update error messages from javac for negative varargs test cases
-
- Closed
-