Project: JDT
Bug 248954 NPE synchronizing an existing workspace
Reported: 2008-09-29 11:22:35 | Status: verified fixed

Using M20080827-2000, I got: Caused by: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.model.JavaSynchronizationContentProvider.asJavaProject(JavaSynchronizationContentProvider.java:149) at org.eclipse.jdt.internal.ui.model.JavaSynchronizationContentProvider.convertToJavaElements(JavaSynchronizationContentProvider.java:168) at org.eclipse.jdt.internal.ui.model.JavaSynchronizationContentProvider.interceptAdd(JavaSynchronizationContentProvider.java:763) at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.interceptAdd(SafeDelegateTreeContentProvider.java:224) at org.eclipse.ui.internal.navigator.NavigatorPipelineService.pipelineInterceptAdd(NavigatorPipelineService.java:124) at org.eclipse.ui.internal.navigator.NavigatorPipelineService.interceptAdd(NavigatorPipelineService.java:81) at org.eclipse.ui.navigator.CommonViewer.add(CommonViewer.java:242) at org.eclipse.ui.model.WorkbenchContentProvider$2.run(WorkbenchContentProvider.java:265) at org.eclipse.ui.model.WorkbenchContentProvider.runUpdates(WorkbenchContentProvider.java:129) at org.eclipse.ui.model.WorkbenchContentProvider.access$1(WorkbenchContentProvider.java:126) at org.eclipse.ui.model.WorkbenchContentProvider$1.run(WorkbenchContentProvider.java:115) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133) ... 43 more while I tried to synchronize an existing workspace. No steps to reproduce, but looking at the code, asJavaProject(..) can be called with null and null is not handled.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/model/JavaSynchronizationContentProvider.java