Community
Participate
Working Groups
RC3a whenever I exit Eclipse with some small test workspace, I get the following NPE: !SESSION Mar 21, 2003 16:04:43.492 --------------------------------------------- java.version=1.4.1-beta 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:D:/eclipse/rt/eclipse/ !ENTRY org.eclipse.core.runtime 4 2 Mar 21, 2003 16:04:43.492 !MESSAGE Problems occurred when invoking code from plug- in: "org.eclipse.core.runtime". !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.indexing.IndexManager.shutdown (IndexManager.java:511) at org.eclipse.jdt.internal.core.JavaModelManager.shutdown (JavaModelManager.java:1550) at org.eclipse.jdt.core.JavaCore.shutdown(JavaCore.java:3004) at org.eclipse.core.internal.plugins.PluginRegistry$2.run (PluginRegistry.java:283) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:937) at org.eclipse.core.internal.plugins.PluginRegistry$1.visit (PluginRegistry.java:296) at org.eclipse.core.internal.plugins.PluginRegistry.accept (PluginRegistry.java:55) at org.eclipse.core.internal.plugins.PluginRegistry.shutdownPlugins (PluginRegistry.java:299) at org.eclipse.core.internal.plugins.PluginRegistry.shutdown (PluginRegistry.java:265) at org.eclipse.core.internal.runtime.InternalPlatform.loaderShutdown (InternalPlatform.java:518) 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:324) at org.eclipse.core.internal.boot.InternalBootLoader.shutdown (InternalBootLoader.java:979) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:850) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583) To reproduce - download the workspace from http://www.weinand.org/eclipse/workspace.zip (its being uploaded so wait for another 30 minutes). - Unzip and copy the workspace into the same directory where Eclipse lives. - Start Eclipse and quit immediately. - open the .log file. There should be a new entry at the end.
In this code, IIndex[] selectedIndexes = indexSelector.getIndexes(); SimpleLookupTable knownPaths = new SimpleLookupTable(); for (int i = 0, max = selectedIndexes.length; i < max; i++) { String path = selectedIndexes[i].getIndexFile().getAbsolutePath(); knownPaths.put(path, path); } getIndexes() can return a collection which contains null entries, if some index needs to be created. So a fix would be to add a null check in the for loop. IIndex[] selectedIndexes = indexSelector.getIndexes(); SimpleLookupTable knownPaths = new SimpleLookupTable(); for (int i = 0, max = selectedIndexes.length; i < max; i++) { IIndex selectedIndex = selectedIndexes[i]; if (selectedIndex != null) { String path = selectedIndex.getIndexFile().getAbsolutePath(); knownPaths.put(path, path); } }
Created attachment 4289 [details] Patch for this NPE Applying this patch fixed the problem on my machine.
Null indexes could be computed incorrectly as a consequence of fix for bug 35306. This is a regression. Need to be fixed for RC4 (null indexes are simply to be ignored).
Created attachment 4290 [details] Better fix for this issue #getIndexes() must not answer null indexes, since clients do not expect this. Also the problem may occur elsewhere than during shutdown (whenever a search job is running without waiting for indexing to have finished).
Patch verified.
+1
Is this a regression of Bug 33462? I am seeing it in RC3b.
No, this is a different problem. In fact, this is a consequence of fixing bug 35306. Fix is not yet released (that's why you're seeing it in RC3b)
*** Bug 35608 has been marked as a duplicate of this bug. ***
*** Bug 35642 has been marked as a duplicate of this bug. ***
Fix released for integration
Verified.