Bug 47227

Summary: Syntax error diagnosis shouldn't expose internal goal tokens
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2003-11-21 09:41:09 EST
Build 20031120

On the following incorrect source, I would expect the bogus import to be 
flagged in error, but I get:

Severity	Description	Resource	In Folder	Location
	Creation Time
	Syntax error on token "~", >>> expected	X.java	Crap/src	line 2
	November 21, 2003 3:39:06 PM
	Syntax error on tokens, delete these tokens	X.java	Crap/src
	line 5	November 21, 2003 3:39:06 PM
	Syntax error on token "{", , expected	X.java	Crap/src	line 6
	November 21, 2003 3:39:06 PM
	Syntax error on token "if", Identifier expected	X.java	Crap/src
	line 8	November 21, 2003 3:39:06 PM
	Syntax error on tokens, StaticOnly expected instead	X.java	Crap/src
	line 8	November 21, 2003 3:39:06 PM
	Syntax error on token "else", invalid StaticOnly	X.java	Crap/src
	line 10	November 21, 2003 3:39:06 PM
	Syntax error on token "}", { expected	X.java	Crap/src	line 12
	November 21, 2003 3:39:06 PM
	Syntax error, insert "}" to complete Block	X.java	Crap/src
	line 14	November 21, 2003 3:39:06 PM


public class X {
public static void hundretAssignmentsToFinalVariable( final boolean bStop, 
final String s ) { 
	import java.io.*;
	final int iCount;
            int i = 0; 
	while (true) { 
		iCount = i; 
		if (i < 100) { 
			continue; 
		} else { 
			break; 
		} 
	} 
	System.out.println(iCount); } 

}
Comment 1 David Audel CLA 2003-11-21 11:17:18 EST
Another testcase:
public class X {
	public void foo() { 
		import java.lang.*;
	} 
}

Syntax error on token "~", ++ expected	X.java	P	line 2
Comment 2 David Audel CLA 2004-05-03 06:15:07 EDT
Fixed and tests added
   ParserTest#test014()
   ParserTest#test015()

Start and end of the error are correct (see bug 60722)
Comment 3 Olivier Thomann CLA 2004-05-18 11:13:47 EDT
Verified in 200405180816