Community
Participate
Working Groups
Created attachment 242932 [details] Example project with comment on line with incorrect warning My apologies for being unable to isolate this behavior, but the problem doesn't seem to exist for Java's built-in libraries... Essentially, I'm parsing some tokens, whose type is represented by an enum. I'm switching on the token's type, using a static import of the desired enum types so the switch would work (TokenType.____ is illegal, so static import fixes that). Eclipse claims that the static import is unused, which means that when I organize imports the enum imports are removed, after which the compiler promptly complains about being unable to resolve the enum types. Using javac with -Xlint:all gives no warnings, and in fact, javac doesn't require the static import at all, only that the other classes that I use are imported. The fact that TokenType is in the same package as my Token and Tokenizer class may have something to do with the reason that javac doesn't need the static import. Attached is a short project which should demonstrate what I'm talking about. I'm on java 1.8_05, using Eclipse Luna M6.
Turns out the problem was fixed in the newest build of Eclipse (20140508-1440)
Reopened until the commit that fixed the issue is found (if necessary)
Jay, please document the change that fixed this issue and resolve. TIA.
(In reply to Alex W from comment #1) > Turns out the problem was fixed in the newest build of Eclipse > (20140508-1440) Alex, can you tell me what you see fixed with this build? Between, 4.2, 4.3 and 4.4, I see no difference in behavior - i.e. warning issued on the static import, but removing the import doesn't cause any additional errors.
Unlikely to include this in M1. Moving out.
(In reply to Jayaprakash Arthanareeswaran from comment #5) > Unlikely to include this in M1. Moving out. Hmmm, seems I can't reproduce this after all. I don't know what happened... My apologies for wasting your time.
Verified for 4.5 M3.