Bug 126800 Java Team Content provider sometimes returns null element
The JavaSynchronizationContentProvider sometimes returns a null element. As a result of this, I sometimes get NPEs from StructuredViewer wheb expanding Java packages. I believe the problem is that JavaCore.create(members[index]) is used in a few places to get members but that can return null. The returned value should be checked for null before it is added to the result.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/model/JavaSynchronizationContentProvider.java
*/
	private boolean hasChildrenInScope(final IResourceMappingScope scope, final Object element, final IResource resource) {
		final IResource[] roots= scope.getRoots();
		final IPath path= resource.getFullPath();
		if (element instanceof IPackageFragment) {
			for (int index= 0; index < roots.length; index++)
				if (path.equals(roots[index].getFullPath().removeLastSegments(1)))
					return true;
			return false;
		}
		for (int index= 0; index < roots.length; index++) {
			if (path.isPrefixOf(roots[index].getFullPath()))
				return true;
		}
		return false;
	}
	/**
	 * {@inheritDoc}
	 */
	protected boolean isInScope(final IResourceMappingScope scope, final Object parent, final Object element) {
		final IResource resource= JavaModelProvider.getResource(element);
		if (resource == null)
			return false;
		if (scope.contains(resource))
			return true;
		if (hasChildrenInScope(scope, element, resource))
			return true;
		return false;
	}
}