Community
Participate
Working Groups
DiagnoseParser as of 06/13/2003 When following syntax error (in #newLibraryEntry()) is diagnosed, the end result is confusing, especially due to the highlighting. public class X { public static void main(String[] args) { } public static int newLibraryEntry() { if (sourceAttachmentPath != null) { if (sourceAttachmentPath.isEmpty()) { && ! sourceAttachmentPath.isAbsolute()) { foo(); } return null; } } public void foo() { } public void bar() { } } Error diagnosis is: Severity Description Resource In Folder Location Creation Time Syntax error on token "{", invalid AssignmentOperator X.java Crap/src line 12 June 13, 2003 6:02:40 PM Syntax error on token "&&", invalid PushLPAREN X.java Crap/src line 12 June 13, 2003 6:02:40 PM Syntax error on token(s), misplaced construct(s) X.java Crap/src line 9 June 13, 2003 6:02:40 PM
Change milestone.
In build 20040428 the error messages are Syntax error on token "&&", invalid ( Syntax error on token "{", invalid AssignmentOperator The corrected code is if (sourceAttachmentPath.isEmpty()) { (!sourceAttachmentPath.isAbsolute()) = foo(); } This code is not semanticaly correct but is syntaxicaly correct Grammar rules Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression PostfixExpression -> Primary Primary -> PrimaryNoNewArray PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN Are you agree to consider this bug as fixed ?
Ok for me.
Problem solved in a previous build Test added ParserTests#test20()