Spurious "unused import" warnings in Eclipse

Doug Simon doug.simon at oracle.com
Sun Oct 4 17:32:19 UTC 2015


A recent change to mx[1], graal-jvmci-8[2] and graal-compiler[3] that force use of explicit imports has exposed an Eclipse bug that causes it to show spurious warnings about unused imports[4]. Most of these warnings are related to static imports of static fields from Option inner classes. The warnings can usually be removed by causing the problematic file to be recompiled (e.g., add a space at the end of a line and save). Unfortunately, this seems to only remove the warnings from the Problems view but leaves them behind in the source pane - go figure!

Workarounds include making the relevant classes top level (e.g., [5]) or removing the use of the static imports (e.g., [6]). Please apply one of these as you encounter these spurious warnings as it could be a while before the bug is fixed in Eclipse.

-Doug

[1] https://bitbucket.org/allr/mx/commits/cf9105fe3b45
[2] http://hg.openjdk.java.net/graal/graal-jvmci-8/rev/ec96f33a101d
[3] http://hg.openjdk.java.net/graal/graal-compiler/rev/05183a084a08
[4] https://bugs.eclipse.org/bugs/show_bug.cgi?id=477597
[5] http://hg.openjdk.java.net/graal/graal-compiler/rev/c839b1d02d89
[6] http://hg.openjdk.java.net/graal/graal-compiler/rev/0052aa6ed733


More information about the graal-dev mailing list