Bug 32531 NPE importing preferences
Build id: 200302211557 Got error messages when importing preferences. I couldn't reproduce the problem anymore. Will attach stack traces (two generated in a row). Top entries are: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.rootsAndC ontainers(PackageExplorerContentProvider.java:153) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.getChildr en(PackageExplorerContentProvider.java:131) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.getFilteredChildre n(PackageExplorerPart.java:352) at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren (StructuredViewer.java:555) at org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren (AbstractTreeViewer.java:1282) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh (AbstractTreeViewer.java:925) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh (AbstractTreeViewer.java:934) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh (AbstractTreeViewer.java:895) at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh (AbstractTreeViewer.java:881) at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:858) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection (StructuredViewer.java:798) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:856) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:818) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.propertyChange (PackageExplorerPart.java:1062)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java
Set containers= new HashSet(roots.length);
		for (int i= 0; i < roots.length; i++) {
			if (roots[i] instanceof IPackageFragmentRoot) {
				IPackageFragmentRoot root= (IPackageFragmentRoot)roots[i];
				IClasspathEntry entry= null;
				try {
					entry= root.getRawClasspathEntry();
				} catch (JavaModelException e) {
					continue;
				}
				if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) 
					containers.add(entry);
				else
					result.add(root);
			} else {
				result.add(roots[i]);
			}
		}
		for (Iterator each= containers.iterator(); each.hasNext();) {
			IClasspathEntry element= (IClasspathEntry) each.next();
			result.add(new ClassPathContainer(project, element));
		}		
		return result.toArray();
	}
	private Object[] getContainerPackageFragmentRoots(ClassPathContainer container) throws JavaModelException {
		return container.getPackageFragmentRoots();
	}
	private Object[] getNonJavaProjects(IJavaModel model) throws JavaModelException {
		return model.getNonJavaResources();
	}