- This topic has 5 replies, 2 voices, and was last updated 17 years, 2 months ago by Loyal Water.
-
AuthorPosts
-
parasjain01MemberHi,
I am facing a strange problem with MyEclipse 5.1.0.When I type to consecutive semicolon (;;) in a Java Class it gives me Unnecessary Semicolon error at compile-time. But when I type two consecutive semicolon (;;) in a Java Interface I don’t get any warning/error. Is this a bug? Where are the settings for this. I did not find any such setting in compiler errors/warnings preferences.
My colleague is getting error in both Java Class and Java Interface. He is using MyEclipse6+
Paras
Loyal WaterMemberWhat code are you adding the semicolon after? I did not get any errors when I added a double Semicolon in a java class. I tried this on MyEclipse 6.0.1.
parasjain01MemberAnywhere at the end of line when you tye two semicolons ;; in the end instead of one semicolon ; that validation error appears.
There should be some validation setting somewhere but we are not able to figure out where.
One more example
if one one line we say somethinge likeif(someVariable==nul){ //do something here and return return; }
and in the next line if I check for null
if(someVariable != null){ }
It (rightly) gives me validation error saying that
The variable someVariable cannot be null; it was either set to a non-null value or assumed to be non-null when last usedOur problem is, some validation works in my version and does not work in his version. Where is the settings for that?
Loyal WaterMemberCan you paste the entire file here for me. I want to try this at my end.
parasjain01Memberpublic class TestValidation { public static void main(String args[]){ String myVal = args[0]; if(myVal == null){ return; } if(myVal != null){ } System.out.println("Test");; } }
Interestingly I get only one error at a time. In the above code I am getting error on System.out.println line saying Unnecessary semicolon.
When I comment out or remove System.out.println line it gives me error on
if(myVal != null){
Saying the varialbe myVal cannot be null
Loyal WaterMemberMy colleague is getting error in both Java Class and Java Interface. He is using MyEclipse6+
I tried this out at my en d and I didn’t get any errors. I tried this on MyEclipse 5.5.1 and 6.0.1.
This might have been a bug with the old version of MyEclipse. I suggest you upgrade to MyEclipse 6.0.1 and continue working.
-
AuthorPosts