Community
Participate
Working Groups
I20070918-0010. 1. set compiler setting to report unused param to WARNING 2. set compiler setting to eport unnecessary thrown checked exception to ERROR 3. paste this into Package Explorer: import java.io.IOException; public class Foo { void foo(int unused) throws IOException {} } ==> only error is reported. warning for unused parameter is missing. If I set both to warning it works.
Reproduced, will investigate.
The reason is that, in the current state of the code, the error/warning for the exception is detected at code analysis time, whereas the warning for the parameter is detected at code generation time. When the former is an error, the code generation is different and does not check the use of parameters. I'll investigate if we can fix this easily or not. Released test cases ProgrammingProblemTest#14 (inactive) and 15 in HEAD.
Eclipse 3.3 behaves like I20070918-0010 (hence this is not a regression).
Created attachment 78640 [details] Tentative fix + test cases Seems ez enough. Tests are running.
JDT Core tests pass. The fix consists into moving the check into the analysis phase. Kent, would you please tell me what you think?
Released for 3.4 M3.
Verified for 3.4M3 using I20071029-0010 build.