Bug 26266 - java syntax error for missing ";" is reported as belonging to a different line
Summary: java syntax error for missing ";" is reported as belonging to a different line
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-14 06:44 EST by Yiannis Mavroukakis CLA
Modified: 2002-11-14 08:48 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yiannis Mavroukakis CLA 2002-11-14 06:44:24 EST
I am not particulary sure if this is a bug so apologies if it is not and I 
have wasted your time.
Using Eclipse 2.0 Build 200210181211 and JDT 2.1.0. While compiling a file 
with a syntax error -missing semicolon- I get the following error.

java.lang.Error: Unresolved compilation problem: 
	Syntax error on token "data", ";" expected

However, the error is attributed to the next line of code not the one that is 
at fault.
==Code Snippet==
String storeStatement = new String("csv")
data.put("Poll Question 1");
==Code Snippet==

Obviously,when compiling from command line the error is reported properly:

WebServiceClient.java:37: ';' expected
           String storeStatement = new String("csv")

Thank you.
Comment 1 Olivier Thomann CLA 2002-11-14 08:22:34 EST
You have a syntax error, because "data" in encountered instead of ";". Therefore
we report properly (IMHO) the problem saying that "data" was found instead of ";".
You could have both statements on the same line or you can have several blank
lines before the semi-colon. It would still be valid code.
Comment 2 Yiannis Mavroukakis CLA 2002-11-14 08:30:08 EST
I see, however, since the problem originated from the lack of a semi-colon, 
would it not be easier to the untrained eye, to actually highlight the line 
that is the root of the problem, and report what was expected as normal? :)
Comment 3 Philipe Mulet CLA 2002-11-14 08:46:04 EST
We report an unexpected token at the offending token location.

Closing, we won't change this.
Comment 4 Philipe Mulet CLA 2002-11-14 08:46:44 EST
Closing