Community
Participate
Working Groups
R3.2 and 3.3 M1 Hovering over a binary method call no longer shows the exception types. Tracked this down to JavaElementLabels line 476 and 477 where a wrong signature seems to be produced (for the test case below the signature is "()!+LTest;". This used to work in 3.1 and should be fixed for 3.2.1 Test Case: hover over "newInstance" in the code below: public class Test { public void x() throws InstantiationException, IllegalAccessException { getClass().newInstance(); } }
>This used to work in 3.1 and should be fixed for 3.2.1 Not true: it stopped working in R3.1 ==> not necessary a 3.2.1 candidate. Reducing severity to major.
Jerome, looking at code, it seems that thrown exceptions are only added in method signature for generic/parameterized types but I cannot see this point specified in Signature.getThrownExceptionTypes(...) javadoc comment methods. Is there any reason why thrown exceptions have not been added for "standard" methods?
I don't see any reasons why they should not be added. I think this is just an oversight.
Created attachment 52751 [details] Proposed patch Include additional tests on SignatureTests (#testGetThrownExceptions_Bug155003()) and ASTConverter15Test (#testBug155003() and #testBug155003_Generic()). All JDT/Core tests pass. Jerome, may you review this patch? Thanks
Created attachment 52906 [details] New proposed patch Previous patch wrongly changed KeyToSignature.toSignature() output although it should not as its behavior is API... Change has been done to store additional thrown exceptions in a specific field and make it accessible to BindingKey through #getThrownExceptions() new method...
Patch looks good. Just need to add '@since 3.3' in BindingKey#getThrownExceptions().
(In reply to comment #6) > Patch looks good. > Just need to add '@since 3.3' in BindingKey#getThrownExceptions(). > Thanks Jerome for the review => tag added... Released for 3.3 M4 in HEAD stream.
Dani, Martin, I forgot to precise that to be _really_ fixed, following change needs to be done in JavaElementLabels line 584 (in method getMethodLabel): types= resolvedKey.getThrownExceptions(); instead of: types= Signature.getThrownExceptionTypes(resolvedSig); May you fix it before today's integration build? Thanks
I updated our code, but I still can't see the exceptions for 'newInstance()' Key is now: Ljunit/awtui/Test;&Ljava/lang/Class<!Ljava/lang/Class;+Ljunit/awtui/Test;141;>;.newInstance()!+Ljunit/awtui/Test;|Ljava/lang/InstantiationException;|Ljava/lang/IllegalAccessException; The code seems to look for a '^'
Indeed, it still does not work for some 1.5 syntaxes. My test cases have some but in fact comment 0 test case works with JRE 1.4 but not using JRE 1.5, that explains why I missed this failure...
Problem only happens with message sends on captures. I'd prefer closing this one and open a new specific bug as it is a more general problem on binding keys: captures are not decoded properly...
I've opened bug 163647 for this specific binding key parser issue
Verified for 3.3M4 with I20061212-0010.