Bug 62472 - [1.5] Suspicious syntax errors for missing semicolon
Summary: [1.5] Suspicious syntax errors for missing semicolon
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-17 09:40 EDT by Philipe Mulet CLA
Modified: 2004-09-23 08:09 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2004-05-17 09:40:05 EDT
Build 20040513

Compiling the following test case in 1.5 mode issues numerous syntax errors, 
where there is only one missing semicolon (at end of Local innerclass 
declaration).

public class X {
	public <T> X(T t){
		System.out.println(t);
	}
	}
	public static void main(String[] args) {
		class Local extends X {
			Local() {
				<String>super("SUCCESS");
			}
		}
		new Local();
	}
}
	


		"----------\n" + 
		"1. ERROR in X.java (at line 6)\r\n" + 
		"	public static void main(String[] args) {\r\n" + 
		"	              ^^^^\n" + 
		"Syntax error on token \"void\", AT expected\n" + 
		"----------\n" + 
		"2. ERROR in X.java (at line 6)\r\n" + 
		"	public static void main(String[] args) {\r\n" + 
		"	                               ^\n" + 
		"Syntax error on token \"]\", invalid (\n" + 
		"----------\n" + 
		"3. ERROR in X.java (at line 6)\r\n" + 
		"	public static void main(String[] args) {\r\n" + 
		"	                                     ^\n" + 
		"Syntax error, insert \"]\" to complete ArrayAccess\n" + 
		"----------\n" + 
		"4. ERROR in X.java (at line 6)\r\n" + 
		"	public static void main(String[] args) {\r\n" + 
		"	                                     ^\n" + 
		"Syntax error, insert \")\" to complete 
SingleMemberAnnotation\n" + 
		"----------\n" + 
		"5. ERROR in X.java (at line 6)\r\n" + 
		"	public static void main(String[] args) {\r\n" + 
		"	                                     ^\n" + 
		"Syntax error, insert \"enum Identifier\" to complete 
EnumHeader\n" + 
		"----------\n" + 
		"6. ERROR in X.java (at line 14)\r\n" + 
		"	}\r\n" + 
		"	^\n" + 
		"Syntax error on token \"}\", delete this token\n" + 
		"----------\n"
Comment 1 Philipe Mulet CLA 2004-05-17 09:42:34 EDT
Actually, there is also an extra closing curly brace at end of generic 
constructor X<T>. Still syntax errors are a bit cryptic.
Comment 2 David Audel CLA 2004-09-08 06:48:45 EDT
There is no missing semicolon inside this test case.

Fixed and tests added
  DietRecoveryTest#test111()
  ComplianceDiagnoseTest#test0044()
  ComplianceDiagnoseTest#test0045()

Fix is inside RecoveredUnit#add(AbstractMethodDeclaration,int). An Initializer 
is added when an extra closing curly brace is detected.
Comment 3 David Audel CLA 2004-09-23 08:09:34 EDT
Verified in I200409240100.