Consider code like this:
---
int i = "".
@Deprecated void t() {}
---
The AST for this will not include any sensible initializer, the initializer will be an erroneous node with no subnodes, and "@Deprecated" will be subsumed by the initializer as well. The errors are:
---
/tmp/E.java:2: error: <identifier> expected
int i = "".
^
/tmp/E.java:3: error: illegal start of expression
@Deprecated void t() {}
^
/tmp/E.java:3: error: ';' expected
@Deprecated void t() {}
^
3 errors
----
There is a relation toJDK-8253584.
---
int i = "".
@Deprecated void t() {}
---
The AST for this will not include any sensible initializer, the initializer will be an erroneous node with no subnodes, and "@Deprecated" will be subsumed by the initializer as well. The errors are:
---
/tmp/E.java:2: error: <identifier> expected
int i = "".
^
/tmp/E.java:3: error: illegal start of expression
@Deprecated void t() {}
^
/tmp/E.java:3: error: ';' expected
@Deprecated void t() {}
^
3 errors
----
There is a relation to
- relates to
-
JDK-8253584 Redunant errors for partial member selects
- Resolved