Community
Participate
Working Groups
Unable to retrieve a reference to an IResource for a Java project library defined via internal (in-workspace) jar archive. The following returns null: IClassFile.getParent().getParent().getUnderlyingResource() This behavior is understood for external (out-of-workspace) libraries, but for internal ones it should be possible to retrieve a reference to undelying resource.
Closing since cannot reproduce it anymore.
The problem is intermittent and "seems" to be related to the order of accesing internal/external libraries.
We think we have isolated the pattern. It can occur when some code previously opened a JAR package fragment root in the wrong context (using a handle containing the wrong project). Even this package fragment root does not exist, its information is cached, and fooling all subsequent queries against elements inside it (they will incorrectly think they are located inside the original wrong project). This defect is being resolved by revisiting the existency/opening condition of a JAR package fragment root (will be released in next integration build). *** This bug has been marked as a duplicate of 6865 ***