Bug 15311

Summary: Importing external plug-ins from file system fails
Product: [Eclipse Project] JDT Reporter: Scott Fairbrother <scottf>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0 F2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
PDE Project exports used to produce the NPE on M5 none

Description Scott Fairbrother CLA 2002-05-06 08:46:33 EDT
Import external plug-ins from file system will fail in one form or other 
(depending on the build)until the user opens a PDE perspective.  In M5 it fails 
with an NPE. 

Installed an M5 driver, while in the resource perspective, my very first action 
was to imort external plug-ins from file system.  This produced an NPE 

<?xml version="1.0" encoding="UTF-8"?>
<log>
<log-entry date="Mon May 06 07:58:18 EDT 2002">
  <status
     plugin-id="org.eclipse.pde.ui"
     severity="ERROR"
     message="java.lang.NullPointerException"
     code="0">
    <exception
       message="null"
       trace="
java.lang.NullPointerException
	at org.eclipse.jdt.internal.core.JavaModelManager.runOperation
(JavaModelManager.java:1150)
	at org.eclipse.jdt.internal.core.JavaElement.runOperation
(JavaElement.java:550)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath
(JavaProject.java:1911)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath
(JavaProject.java:1882)
	at 
org.eclipse.pde.internal.ui.wizards.imports.UpdateClasspathOperation.run
(UpdateClasspathOperation.java:97)
	at 
org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.createProject
(PluginImportOperation.java:216)
	at org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.run
(PluginImportOperation.java:101)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1343)
	at org.eclipse.pde.internal.ui.wizards.imports.PluginImportWizard$2.run
(PluginImportWizard.java:122)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)
">
    </exception>
  </status>
</log-entry>
</log>
Comment 1 Scott Fairbrother CLA 2002-05-06 08:48:37 EDT
Created attachment 758 [details]
PDE Project exports used to produce the NPE on M5
Comment 2 Dejan Glozic CLA 2002-05-06 09:40:20 EDT
If you carefully check the exception stack, you will see that the exception is 
in JavaModelManager, not in PDE. Moving to JDT Core.
Comment 3 Scott Fairbrother CLA 2002-05-06 10:12:20 EDT
It is clear that the exception is coming from the JDT,  however it is not clear 
whether the PDE import puts the project in a valid state before turning the 
JavaModelManger loose.  Our observation is that once the user has opened a PDE 
perspective then JDT seems to handel the pde projects on import without 
exception.   
Comment 4 Philipe Mulet CLA 2002-05-28 08:54:28 EDT
This issue got fixed along when addressing bug 17562 (build 20020527).
The JavaModel unique handle is created eagerly and cache onto the 
JavaModelManager.

These symptoms could have occurred if the JavaModelManager offending code was 
running before the JavaModel had been opened elsewhere.

Closing
Comment 5 Philipe Mulet CLA 2002-06-03 08:55:17 EDT
Verified