Community
Participate
Working Groups
Created attachment 137754 [details] Screenshot Build ID: Build id: M20090211-1700 Steps To Reproduce: In the attached code, the error message that warns about unused imports is not displayed within ResourceTest.java. Earlier on I reported this issue, but marked it as invalid, because I thought it was a temporary issue. This is because sometimes Eclipse displays/hides errors after a while, which is slightly confusing until the user gets used to it. More information: NOTE 1: Microsoft Windows [Version 6.0.6001] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Users\Administrator>java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
Created attachment 137755 [details] Source code
I'm pretty sure Eclipse's Java compiler is set to tell the user about errors before it tells the user about warnings. Warnings could potentially be invalid (because of syntax errors in the code). Personally, I'd be more interested in errors than warnings if I have erroneous code. Moving to JDT/Core to comment. Jonathan, as Paul mentioned in bug 278379 comment 4, please file perceived problems with the Java editor/compiler against JDT instead of Platform/IDE.
(In reply to comment #2) > I'm pretty sure Eclipse's Java compiler is set to tell the user about errors > before it tells the user about warnings. Warnings could potentially be invalid > (because of syntax errors in the code). Personally, I'd be more interested in > errors than warnings if I have erroneous code. Of course, but you never know :) > > Moving to JDT/Core to comment. > > Jonathan, as Paul mentioned in bug 278379 comment 4, please file perceived > problems with the Java editor/compiler against JDT instead of Platform/IDE. > Excuse the inconvenience.
This behavior can be traced back to bug 95909. In that bug you'll find a discussion showing that checking for unused imports in the presence of compile errors would lead to bogus warnings. Therefore, the implementation in class CompilationUnitDeclaration says: if (!this.compilationResult.hasErrors()) checkUnusedImports(); It _might_ be possible to use more sophisticated analysis whether existing compile errors could affect "unused" warnings, but assumable such analysis would cost more than it's worth here. So, following Remy's advice start by removing severe errors, and then the compiler will tell you about the fine points ;-)
This behaves as expected as far as I can tell. Serious errors in the code can potentially cause missing diagnosis. This works as designed as it prevents lots of secondary false positives errors or warnings. Closing as INVALID.
Verified for 3.6M1