Bug 174015 - [classpath] NPE when replacing the JRE used by a project
Summary: [classpath] NPE when replacing the JRE used by a project
Status: RESOLVED DUPLICATE of bug 162104
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 RC4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-13 11:13 EST by Olivier Thomann CLA
Modified: 2007-06-20 07:58 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2007-02-13 11:13:18 EST
eclipse.buildId=I20070209-1006
java.version=1.6.0_01-ea
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_CA
Framework arguments:  -launcher D:\eclipse\I0209\eclipse\eclipse.exe -name Eclipse -startup D:\eclipse\I0209\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070208a.jar -showlocation
Command-line arguments:  -os win32 -ws win32 -arch x86 -launcher D:\eclipse\I0209\eclipse\eclipse.exe -name Eclipse -startup D:\eclipse\I0209\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070208a.jar -debug -consolelog -console -showlocation

Steps to reproduce:
1) Start Eclipse
2) JRE 1.4 points to a JRE that is used in one of your project
3) While Eclipse is running, replace the JRE container 1.4 to point to a new location. You update this in the Java>Installed JREs panel.
4) Go to your project and try to open it.
5) The project appears to be empty and the exception below is thrown.

Even if this is not a user case that we might encourage, we should be more resilient to errors.

java.lang.NullPointerException
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.getPackageFragmentRoots(PackageExplorerContentProvider.java:291)
at org.eclipse.jdt.ui.StandardJavaElementContentProvider.getChildren(StandardJavaElementContentProvider.java:178)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.getChildren(PackageExplorerContentProvider.java:270)
at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:1283)
at org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeViewer.java:394)
at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.getFilteredChildren(ProblemTreeViewer.java:205)
at org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildren(AbstractTreeViewer.java:580)
at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:774)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:751)
at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:526)
at org.eclipse.jface.viewers.AbstractTreeViewer.setExpandedState(AbstractTreeViewer.java:2311)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleDoubleClick(PackageExplorerActionGroup.java:301)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.doubleClick(PackageExplorerPart.java:578)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:798)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:850)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:52)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:153)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:796)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1347)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1167)
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3490)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3104)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2264)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2228)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2103)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:457)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:452)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:146)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:476)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416)
at org.eclipse.equinox.launcher.Main.run(Main.java:1124)
at org.eclipse.equinox.launcher.Main.main(Main.java:1099)
Comment 1 Martin Aeschlimann CLA 2007-02-14 09:05:29 EST
The NPE occurs as IPackageFragmentRoot.getRawClasspathEntry() returns null.

It is not spec'ed that this method can return null. Please let us know if this is problem with the spec or with the code in IPackageFragmentRoot.getRawClasspathEntry().  
Comment 2 Jerome Lanneluc CLA 2007-06-20 07:58:07 EDT

*** This bug has been marked as a duplicate of bug 162104 ***