Community
Participate
Working Groups
Eclipse 3.0 The current implementation of ImportContainer.hasChildren() is: /** * Import containers only exist if they have children. * @see IParent */ public boolean hasChildren() { return true; } So the implementation should be: /** * Import containers only exist if they have children. * @see IParent */ public boolean hasChildren() { return exists(); } It took me sometime to figure out why getChildren() was throwing an exception and hasChildren() was returning true. That is why I'm suggesting the change.
Removed implementation of ImportContainer#hasChildren() so that the super implementation is used. This now follows the spec that says that a JavaModelException must ne thrown if the element does not exist. An import container exists only if it has at least one children. Added regression test CompilationUnitTests#testImportContainerHasChildren()
Verified in I20050214-0927