Community
Participate
Working Groups
build 2002-03-12 on Win98. I have this option turned on in the preferences to display a warning but no tasks are created in the task list and there is no icon in the Java file. I switched this option to be an Error and I get the same results. I can provide the method if required, although its pretty simple.
Reproduced. The problem is located inside BlockScope.computeLocalVariablePositions(int,CodeStream). if (!local.used && (local.declaration != null) // unused (and non secret) local && ((local.declaration.bits & AstNode.IsLocalDeclarationReachableMASK) != 0)) { // declaration is reachable if (local.isArgument) // method argument this.problemReporter().unusedArgument(local.declaration); With the following example, the test (local.declaration.bits & AstNode.IsLocalDeclarationReachableMASK) != 0 is false. [public class Test { public static void main(String[] args) { int i = 0; } }] I suggest the following fix: public Argument(char[] name, long posNom, TypeReference tr, int modifiers) { super(null, name, (int) (posNom >>> 32), (int) posNom); this.modifiers = modifiers; type = tr; } remplaced by: public Argument(char[] name, long posNom, TypeReference tr, int modifiers) { super(null, name, (int) (posNom >>> 32), (int) posNom); this.modifiers = modifiers; type = tr; bits |= IsLocalDeclarationReachableMASK; } because an argument of a method declaration is always reachable or move the test ((local.declaration.bits & AstNode.IsLocalDeclarationReachableMASK) != 0) into the second test if (!(local.declaration instanceof Argument)). Would be something like: if (((local.declaration.bits & AstNode.IsLocalDeclarationReachableMASK) != 0) && !(local.declaration instanceof Argument)) ....
Good guess Olivier, the proper fix is to set the bits inside the Argument constructor.
Fixed and released in HEAD.