Summary: | [model] Missing exception types / wrong signature? | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> | ||||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | major | ||||||||
Priority: | P3 | CC: | jerome_lanneluc, martinae | ||||||
Version: | 3.2 | ||||||||
Target Milestone: | 3.3 M4 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Dani Megert
2006-08-24 04:42:40 EDT
>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. |