Bug 31377

Summary: NullPointerException on binary import
Product: [Eclipse Project] JDT Reporter: Ed Burnette <ed.burnette>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ed Burnette CLA 2003-02-07 16:57:27 EST
I installed M5 SDK, and the M5 examples ok. Imported all binary plugins. Then 
I installed the CDT binaries and source (cdt-200301270556). Tried to import 
the CDT binary plugins and got a null pointer exception. Although there are 
two NPEs in this log I only recall being notified about the last one.

!SESSION Feb 07, 2003 16:34:39.98 ---------------------------------------------
-
java.version=1.4.1-rc
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:C:/Program 
Files/eclipse/
!ENTRY org.eclipse.core.resources 4 2 Feb 07, 2003 16:34:39.98
!MESSAGE Problems occurred when invoking code from plug-
in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.internal.core.DeltaProcessor.updateRoots
(DeltaProcessor.java:2194)
	at 
org.eclipse.jdt.internal.core.DeltaProcessor.updateCurrentDeltaAndIndex
(DeltaProcessor.java:1941)
	at org.eclipse.jdt.internal.core.DeltaProcessor.traverseDelta
(DeltaProcessor.java:1745)
	at org.eclipse.jdt.internal.core.DeltaProcessor.processResourceDelta
(DeltaProcessor.java:1404)
	at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged
(DeltaProcessor.java:1670)
	at org.eclipse.core.internal.events.NotificationManager$1.run
(NotificationManager.java:137)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:867)
	at org.eclipse.core.runtime.Platform.run(Platform.java:413)
	at org.eclipse.core.internal.events.NotificationManager.notify
(NotificationManager.java:152)
	at 
org.eclipse.core.internal.events.NotificationManager.broadcastChanges
(NotificationManager.java:67)
	at org.eclipse.core.internal.resources.Workspace.broadcastChanges
(Workspace.java:161)
	at org.eclipse.core.internal.resources.Workspace.endOperation
(Workspace.java:892)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1593)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:79)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:95)
!SESSION Feb 07, 2003 16:42:30.934 --------------------------------------------
-
java.version=1.4.1-rc
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:C:/Program 
Files/eclipse/
!ENTRY org.eclipse.pde.ui 4 0 Feb 07, 2003 16:42:30.934
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
	at 
org.eclipse.pde.internal.ui.wizards.imports.UpdateClasspathOperation.getSourceP
ath(UpdateClasspathOperation.java:64)
	at 
org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.importSource
(PluginImportOperation.java:287)
	at 
org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.createProject
(PluginImportOperation.java:179)
	at 
org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.run
(PluginImportOperation.java:119)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1588)
	at org.eclipse.pde.internal.ui.wizards.imports.PluginImportWizard$2.run
(PluginImportWizard.java:150)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:95)
Comment 1 Wassim Melhem CLA 2003-02-08 13:25:07 EST
Fixed the PDE NPE.
There also seems to be a JDT core NPE.  Moving to JDT Core...
Comment 2 Jerome Lanneluc CLA 2003-02-10 12:24:16 EST
To reproduce the first NPE:
1. Create simple project P1
2. Create folder lib in P1
3. Create Java project P2 with rt.jar as external library (not as a JRE System 
library)
4. Add P1/lib in the classpath of P2
5. Exit/restart workbench
6. Delete P1
Observe: You get the first NPE.
Comment 3 Jerome Lanneluc CLA 2003-02-10 13:10:51 EST
Fixed DeltaProcessor.initializeRoots() to initialize oldRoots with a new 
HashMap if the previous roots were not set. 

Added regression test 
JavaElementDeltaTests.testRemoveNonJavaProjectUpdateDependent3()
Comment 4 David Audel CLA 2003-02-24 12:27:32 EST
Verified.