Summary: | [DOM AST] Method defaults not resolved | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Tim Hanson <thanson> | ||||||||
Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | blocker | ||||||||||
Priority: | P3 | CC: | tyeung | ||||||||
Version: | 3.2 | ||||||||||
Target Milestone: | 3.2 M5 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Tim Hanson
2006-01-18 16:11:59 EST
Ideally, a testcase (junit) demonstrating the expected behavior would be very nice. Along the same line as making field constants lazily reachable in DOM AST. Created attachment 33235 [details]
JUnit test that demonstrate the problem
The attached "patch" does not fix the bug but simply add a test to ParticipantBuildTests.java that demonstrate the problem.
The new test fails because of an unexpected IProblem reported from a compilation participant. The IProblem complaints about getDefaultValue() returning null when it should have returned an enum constant.
org.eclipse.jdt.apt.tests.MirrorDeclarationTests.DISABLED_testDefault() needs to be enabled once this bug is fixed. Created attachment 33661 [details]
Proposed patch
We might need to check if something needs to be done in:
resolveTypesFor(MethodBinding method) in SourceTypeBinding.
I am not sure about this part.
Created attachment 33662 [details]
Regression test
New regression test. The default value is not a String. It will be a IVariableBinding in the case of an enum value.
Kent, Could you please double check my changes? Meanwhile I will run all the tests. Fixed and released in HEAD. Philippe, please review the changes. MethodBinding.getDefaultValue() MethodBinding.setDefaultValue(Object) added a new TagBits: DefaultValueResolved. The test case now works once fixed. Wrong type expected for the default value. The fix looks good to me. Verified for 3.2 M5 using build I20060214-0010 |