Community
Participate
Working Groups
The parent of a compilation unit declaration should be a package fragment. Right now the java element of such java element has no parent. The CU is built using null as the package fragment.
Created attachment 76926 [details] Proposed fix We use the IJavaElement of the package binding corresponding to the recovered type binding as the package fragment to build the fake compilation unit.
Martin, How does this sound?
Created attachment 76927 [details] Regression test
Released for 3.4M2. Jérôme, Should this be a candidate for 3.3.1?
Regression test added in org.eclipse.jdt.core.tests.dom.ASTConverter15Test#test0283
Sounds good to me! Thanks!
+1 for 3.3.1 since clients never expect null as the parent of an ICompilationUnit. Not fixing this bug could cause NullPointerExceptions in client code.
Created attachment 77026 [details] Proposed fix + regression test Patch updated for 3.3.1.
Reopen for 3.3.1
Released for 3.3.1. Regression test in org.eclipse.jdt.core.tests.dom.ASTConverter15Test#test0283
Verified for 3.3.1 using build M20070831-2000.