Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Phantom syntax errors
icon5.gif  Phantom syntax errors [message #892807] Fri, 29 June 2012 19:08 Go to next message
Jordan Munroe is currently offline Jordan MunroeFriend
Messages: 1
Registered: June 2012
Junior Member
Ever since upgrading to Juno, Eclipse is stopping me from building my project saying there are syntax errors(Where there are none)

For example, I just added this new line
System.out.println("Comm Client Created");
and am getting the following error on that line
Syntax error, insert ";" to complete Statement


As you can see, I clearly have a semicolon... I can right click the error in the "Problems" tab and hit delete to make the error go away and I can compile and run without any problems. I'm getting similar errors with closing curly brackets on any block.

I know it's not my code, I've been programming in C# for years and java syntax is almost identical. I can even cut and re-paste the offending line or block in place and the error will be gone.

[Updated on: Fri, 29 June 2012 19:09]

Report message to a moderator

Re: Phantom syntax errors [message #892821 is a reply to message #892807] Fri, 29 June 2012 21:56 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Can you give a few more details? Like:

What package of Juno did you install?
Have you installed any additional plug-ins?

Where exactly is the error marked (red wiggle line)?
If there are several errors, what is the first error in the file?
Does the file contain any non-ascii characters?

Stephan



Re: Phantom syntax errors [message #893850 is a reply to message #892807] Thu, 05 July 2012 17:02 Go to previous messageGo to next message
Francisco Marzoa is currently offline Francisco MarzoaFriend
Messages: 11
Registered: January 2012
Junior Member
I can confirm this problem. It happened today to me also in the following line:

g.drawCenteredText(String.format(context.getString(R.string.about_panel_count), panelCount), 400, 360, versionPaint);

It insists in that I must add a semicolon there, where it is yet.

As you, I could simply remove the errors for the Problems view and it compiled fine.

I am using the latest Android ADT with Eclipse. Anyway it seems not to be related with ADT but with Eclipse itself.

Eclipse Platform:
Version: 3.7.0
Build id: I20110613-1736

Regards,

[Updated on: Thu, 05 July 2012 19:15]

Report message to a moderator

Re: Phantom syntax errors [message #893878 is a reply to message #893850] Thu, 05 July 2012 19:13 Go to previous messageGo to next message
Francisco Marzoa is currently offline Francisco MarzoaFriend
Messages: 11
Registered: January 2012
Junior Member
I am not 100% sure, but it seems like some errors were not clear when they should.

For example, you write an incomplete for loop and save, then you will get an error on for token or so. You continue editing til the for loop is completed, save again, but the error message persists even when it has been solved, and the only way to get rid of it is deleting it from the Problems view.

[Updated on: Thu, 05 July 2012 19:13]

Report message to a moderator

Re: Phantom syntax errors [message #893882 is a reply to message #893878] Thu, 05 July 2012 19:24 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
If you think these errors occur with just JDT and no ADT in the loop, please try to create a reproducable test case.

Note, that even if you "just edit Java code" if you have the ADT installed, their builder will kick in when you save. To ensure that ADT is not involved, please disable that builder (right click the project > Properties > Builders).

If the problem goes away when ADT builder is disabled, please report against the ADT.

best,
Stephan
Re: Phantom syntax errors [message #893960 is a reply to message #893882] Fri, 06 July 2012 08:35 Go to previous message
Francisco Marzoa is currently offline Francisco MarzoaFriend
Messages: 11
Registered: January 2012
Junior Member
Hi,

I do not know how plugins works, may be you are right and it is a problem with ADT. It is not crazy because I updated it yesterday just before the problems started.

I will try what you say later, since I was coming here just to put another case that has happen just a minute ago:


package com.marzoa.ruletafree;

import android.content.Context;

public class PanelUpdater {
private Context context;

public PanelUpdater (Context context) {
this.context = context;
}
}

I have written the line:

private Context context;

First as:

private context;

So I get an error. But I wrote it right as private Context context; and I still get an error shown ("- Syntax error on token "context", VariableDeclarator expected after this token") even when I have saved the file again many times.

As told before, if I remove the error message on "Problems", it is not shown again.

Regards,

Previous Topic:JDT New Maven Project
Next Topic:The Eclipse executable launcher was unable to locate its companion shared library
Goto Forum:
  


Current Time: Thu Apr 25 23:53:42 GMT 2024

Powered by FUDForum. Page generated in 0.03439 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top