-
Bug
-
Resolution: Fixed
-
P5
-
8
-
b07
In some cases, the errors produced by the parser do not list all viable "expected" tokens. For example:
{code}
enum E {
E(String s) { }
A("");
}
{code}
Will produce:
{code}
$ javac E.java
E.java:2: error: ')' expected
E(String s) { }
^
<snip>
{code}
But at least ',' is also allowed in this context.
Another case:
{code}
public class TP {
Foo<? extends A|B> foo1 = null;
}
{code}
errors:
{code}
$ javac TP.java
TP.java:2: error: > expected
Foo<? extends A|B> foo1 = null;
^
<snip>
{code}
In addition to '>', at least ',' and '&' is allowed at this point.
Another example that should be investigated:
{code}
@SuppressWarnings({,0})
public class AV {
}
{code}
Errors:
{code}
$ javac AV.java
AV.java:1: error: '}' expected
@SuppressWarnings({,0})
^
<snip>
{code}
This is all with:
$ javac -fullversion
javac full version "1.8.0-b129"
{code}
enum E {
E(String s) { }
A("");
}
{code}
Will produce:
{code}
$ javac E.java
E.java:2: error: ')' expected
E(String s) { }
^
<snip>
{code}
But at least ',' is also allowed in this context.
Another case:
{code}
public class TP {
Foo<? extends A|B> foo1 = null;
}
{code}
errors:
{code}
$ javac TP.java
TP.java:2: error: > expected
Foo<? extends A|B> foo1 = null;
^
<snip>
{code}
In addition to '>', at least ',' and '&' is allowed at this point.
Another example that should be investigated:
{code}
@SuppressWarnings({,0})
public class AV {
}
{code}
Errors:
{code}
$ javac AV.java
AV.java:1: error: '}' expected
@SuppressWarnings({,0})
^
<snip>
{code}
This is all with:
$ javac -fullversion
javac full version "1.8.0-b129"
- relates to
-
JDK-8031383 Error recovery in JavacParser could be improved
-
- Closed
-