Community
Participate
Working Groups
Method defaults for annotation members are not resolved when navigating the dom ast bindings to an annotation type that is in a different file. They are resolved lazily. Let me know if you need more info.
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