Summary: | [1.5][compiler] NPE when initializing annotations of a binary field | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jesse Eichar <jeichar> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | major | ||||||
Priority: | P3 | CC: | frederic_fusier, philippe_mulet | ||||
Version: | 3.2 | ||||||
Target Milestone: | 3.2.1 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Jesse Eichar
2006-06-20 10:53:59 EDT
Could be a dup of bug 143259. Could you please try with latest integration build? *** Bug 147880 has been marked as a duplicate of this bug. *** Tried integration build I20060620-1010 and bug still exists. I have put a small project that illustrates the bug online at: udig.refractions.net/NullASTBug.zip Both classes demonstrate the bug. In Test.java you can make the AST generate correctly by changing DefaultGeographicCRS.WGS84 to null. (And make it fail by switching it back) Let me know if you still have questions. Reproduced. Thanks for the test case. Philippe, The given test case reproduces the problem. The annotation initialization seems to be responsible of the NPE. Created attachment 45465 [details]
Proposed patch
This is a bug due to reentrance, where an annotation on a binary field is denoting a field of the same binary type, which hasn't yet been constructed.
Fix is to defer the annotation reification after the initial fields construction.
Olivier - could you construct a DOM AST regression test ? Problem is located on binary ref to org.opengis.annotation.Obligation which fields carry some self-referring annotations. Olivier - pls release the changes to both HEAD and 3.2.1, once you have the regression test. Released for 3.3 M1. Regression test added in org.eclipse.jdt.core.tests.dom.ASTConverter15Test.test0221. Released for 3.2.1. Same regression test. Verified for 3.3 M1 using build I20060807-2000. Verified for 3.2.1 using build M20060908-1655 |