Community
Participate
Working Groups
HEAD ILocalVariable#isParameter() returns true for exception of catch clause: void m() { try { } catch (Exception e) { } }
This is true only when the ILocalVariable is created from the selection node. Catch clause locals are created as arguments, but right now there is no way to know that this local is part of a catch clause and not a method parameter.
Created attachment 192678 [details] Preo
Created attachment 192679 [details] Proposed fix + regression tests
Released for 3.7M7. Only the selection node was broken.
Parser resources need to be generated to apply the source patch on head.
Olivier, I was wondering if this should really need a grammar change. Can't this be done by just clearing the IsArgument flag in consumeCatchHeader()? I haven't tried this out and may be missing something.
(In reply to comment #6) > Olivier, I was wondering if this should really need a grammar change. Can't > this be done by just clearing the IsArgument flag in consumeCatchHeader()? I > haven't tried this out and may be missing something. Unfortunately this rule is only used in the recovery. Since in Java 7 branch we also have a consumeCatchFormalParameter() method, this was the easiest way to fix it.
(In reply to comment #7) > Unfortunately this rule is only used in the recovery. Since in Java 7 branch we > also have a consumeCatchFormalParameter() method, this was the easiest way to > fix it. Thanks for the explanation.
Verified for 3.7M7 using build I20110421-1800