| Summary: | NPE in ProgramImageDescriptor.hashCode | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Chris Ditcher <cditcher> | ||||
| Component: | UI | Assignee: | Andrey Loskutov <loskutov> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | daniel_megert, dvdgsng, fbcyborg, ikus060, jreimann, kmbaker, lance, Lars.Vogel, loskutov, matthias.keller, mistria, nicola.spreafico, psuzzi, yltang52, zerodeath | ||||
| Version: | 4.6 | Flags: | Lars.Vogel:
review+
|
||||
| Target Milestone: | 4.6.2 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: |
https://git.eclipse.org/r/82334 https://bugs.eclipse.org/bugs/show_bug.cgi?id=498553 https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=82d9e8c91c6e22d7de8329c00580e5ec94ae385f https://git.eclipse.org/r/82408 https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=a5de7a28e73b045e9dd2255256ee305c96bec0c5 |
||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Chris Ditcher
Ok it's not just saving files. Seems to happen with other events also, such as starting / stopping application containers (Tomcat), etc. Well i don't know what happened, but after two reboots, the problem has gone away and has not come back all day. Maybe chalk it up to a bizarre system anomaly. *** Bug 502541 has been marked as a duplicate of this bug. *** I have the exactly the same issue on the same build on Windows 10 x64: eclipse.buildId=4.6.1.M20160907-1200 java.version=1.8.0_92 Error is raised consistently when e.g. expanding project nodes in the Package Explorer - very annoying. Can this be re-opened please? (In reply to Kevin Baker from comment #4) > Error is raised consistently when e.g. expanding project nodes in the > Package Explorer - very annoying. > > Can this be re-opened please? Sure. Any exact steps to reproduce? Created attachment 264508 [details]
Example screenshot of workspace state
Steps to recreate:
Start eclipse, open workspace (affects all of mine), click on expand node for a project in the package explorer and multiple problems raised. Once a project node is expanded it does not error again. But expanding another project will raise the error and so on.
The number of errors raised is variable, linked to project content (number/type of nodes?).
Log entry (duplicated x2) associated with screenshot action: eclipse.buildId=4.6.1.M20160907-1200 java.version=1.8.0_92 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB Framework arguments: -product org.eclipse.epp.package.java.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product !ENTRY org.eclipse.jface 4 2 2016-09-30 11:32:11.431 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.misc.ProgramImageDescriptor.hashCode(ProgramImageDescriptor.java:74) at org.eclipse.jdt.ui.JavaElementImageDescriptor.hashCode(JavaElementImageDescriptor.java:207) at java.util.HashMap.hash(Unknown Source) at java.util.HashMap.get(Unknown Source) at java.util.Collections$SynchronizedMap.get(Unknown Source) at org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry.get(ImageDescriptorRegistry.java:57) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel(JavaElementImageProvider.java:104) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel(JavaElementImageProvider.java:98) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage(JavaUILabelProvider.java:142) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerLabelProvider.getImage(PackageExplorerLabelProvider.java:137) at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.getImage(DelegatingStyledCellLabelProvider.java:195) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.getImage(DecoratingStyledCellLabelProvider.java:168) at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.update(DelegatingStyledCellLabelProvider.java:121) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.update(DecoratingStyledCellLabelProvider.java:131) at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:141) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:949) at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:118) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1029) at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:474) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173) at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2170) at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:843) at org.eclipse.jface.viewers.AbstractTreeViewer.lambda$0(AbstractTreeViewer.java:820) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:795) at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:596) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:766) at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1493) at org.eclipse.jface.viewers.TreeViewer.handleTreeExpand(TreeViewer.java:882) at org.eclipse.jface.viewers.AbstractTreeViewer$3.treeExpanded(AbstractTreeViewer.java:1505) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:133) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4410) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1088) at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:7705) at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5817) at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:2033) at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5371) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4847) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5102) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2446) at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1552) at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:6559) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4827) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:6074) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5102) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2552) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3814) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519) *** Bug 502579 has been marked as a duplicate of this bug. *** @Lars: please create 4.6.1 version in Bugzilla, this seem to be a regression occured since 4.6.1 is out.
The only possibility for the NPE is that ProgramImageDescriptor was created with "null" fullpath provided by org.eclipse.ui.internal.registry.EditorRegistry.readEditors(Map<String, IEditorDescriptor>). The null there is coming from org.eclipse.ui.internal.registry.EditorDescriptor.getFileName().
public String getFileName() {
if (program == null) {
if (configurationElement == null) {
return fileName;
}
return configurationElement.getAttribute(IWorkbenchRegistryConstants.ATT_COMMAND);
}
return program.getName();
}
The code above can return null if program and configurationElement both were null or when program was null and config element had no attribute ATT_COMMAND (Program.getName() is never null).
So the question is: what changed in 4.6.1 that caused the code above to return null? Unfortunately EditorDescriptor code seem to allow incomplete descriptors to be created.
@All who can reproduce: the problem seem to be related to the editor registry containing inconsistent data. The editor descriptors for some of the user defined editor types seem to be incomplete. The problem will show up if one expands the explorer on the folder containing files registered with those broken descriptors. Additionally, somehow the problem seem to be related to the Eclipse 4.6.1 *update*. To get it nailed down: 1) How did you upgrade your Eclipse to 4.6.1? (which way). 2) Can you please check which file types were in the expanded folder (e.g. the screenshot shows "build.bat" without an icon). Is this same type for others? 3) Please check which editor is configured for that "broken" type(s) in the Preferences->General->Editors->File Associations. 4) Is anyone here observing this problem on a "default", NOT updated Eclipse installation? If yes - which package / version? I'm experiencing this problem today. I'm using Eclipse Neon for a week for Java editing and I didn't encounter this issue. I've just import a problem containing ruby source code "*.rb" and this message appear every time I click a ".rb" file. 1. I've install Eclise Neon 4.6.1 directly. (no upgrade). 2. The folder contains ".rb" file (ruby) 3. Preferences->General->Editors->File Associations for *.rb file is "&System Editor (default)" 4. I don't know how to provide version/package information. I'm using Eclise on Linux. Changing the "*.rb" File association to "Text Editor" solved this issue. (In reply to Patrik Dufresne from comment #11) > I'm experiencing this problem today. I'm using Eclipse Neon for a week for > Java editing and I didn't encounter this issue. I've just import a problem > containing ruby source code "*.rb" and this message appear every time I > click a ".rb" file. Double click or just selecting? > 1. I've install Eclise Neon 4.6.1 directly. (no upgrade). Which package? I mean, is this Eclipse SDK, Eclipse for J2EE, etc? Can you please try to create a new, empty workspace and try to reproduce the issue? > 2. The folder contains ".rb" file (ruby) > 3. Preferences->General->Editors->File Associations for *.rb file is > "&System Editor (default)" So you had the editor entry for *.rb already? Have you added it by yourself before? Or do you have some plugin for ruby development installed? The reason I'm asking is that Eclipse do not ship ruby support by default. > 4. I don't know how to provide version/package information. I'm using Eclise > on Linux. Which distribution/desktop? (In reply to Patrik Dufresne from comment #12) > Changing the "*.rb" File association to "Text Editor" solved this issue. How you did that? Via preferences or by renaming the file to *.txt? (In reply to Andrey Loskutov from comment #13) > (In reply to Patrik Dufresne from comment #11) > > I'm experiencing this problem today. I'm using Eclipse Neon for a week for > > Java editing and I didn't encounter this issue. I've just import a problem > > containing ruby source code "*.rb" and this message appear every time I > > click a ".rb" file. > > Double click or just selecting? Just clicking on the file or expending a folder containing the rb file. BTW, the file doesn't have an icon. > > > 1. I've install Eclise Neon 4.6.1 directly. (no upgrade). > > Which package? I mean, is this Eclipse SDK, Eclipse for J2EE, etc? > Can you please try to create a new, empty workspace and try to reproduce the > issue? I've install: eclipse-jee-neon-1-linux-gtk-x86_64 > > > 2. The folder contains ".rb" file (ruby) > > 3. Preferences->General->Editors->File Associations for *.rb file is > > "&System Editor (default)" > > So you had the editor entry for *.rb already? Have you added it by yourself > before? Or do you have some plugin for ruby development installed? The > reason I'm asking is that Eclipse do not ship ruby support by default. The IDE prompt me to download a plugin for *.rb file. I refused. I select "keep System Editor" or similar option, cause I don't want to install the plugin. I guess at that point, an entry was created in File Association. > > > 4. I don't know how to provide version/package information. I'm using Eclise > > on Linux. > > Which distribution/desktop? > > (In reply to Patrik Dufresne from comment #12) > > Changing the "*.rb" File association to "Text Editor" solved this issue. > > How you did that? Via preferences or by renaming the file to *.txt? I remove the "System Editor" then add "Text Editor" from the preference window. New Gerrit change created: https://git.eclipse.org/r/82334 (In reply to Patrik Dufresne from comment #14) > > > 2. The folder contains ".rb" file (ruby) > > > 3. Preferences->General->Editors->File Associations for *.rb file is > > > "&System Editor (default)" > > > > So you had the editor entry for *.rb already? Have you added it by yourself > > before? Or do you have some plugin for ruby development installed? The > > reason I'm asking is that Eclipse do not ship ruby support by default. > > The IDE prompt me to download a plugin for *.rb file. I refused. I select > "keep System Editor" or similar option, cause I don't want to install the > plugin. I guess at that point, an entry was created in File Association. That is it! This creates wrong entry like: <descriptor id="org.eclipse.ui.systemExternalEditor" internal="false" label="&System Editor" openMode="4" open_in_place="false"/> Here the plugin ID is missing, because it is internal descriptor which should have never been persisted. I can't yet understand how this is related to 4.6.1 (why not in 4.6.0?) but the problem was probably always in EditorRegistry and it was just uncovered by recently added features like missing editors lookup in eclipse marketplace (see AskMarketPlaceForFileSupportStrategy, line 112). If the user denies to use MP plugin for a "system" editor descriptor, the AskMarketPlaceForFileSupportStrategy remembers this descriptor as a user choice, and so "internal" system descriptor is persisted. But system editor descriptors were not designed to be persisted, they do not contain contributed plugin id, neither program name or path, so they cause that NPE after being restored as "usual" "external program" descriptors. The patch https://git.eclipse.org/r/82334 disallows now to store and to load internal editors to/from the memento, and also adds an edditional consistency check to the "external" editors case. How long it take to get this patch from "Check for Updates". (In reply to Patrik Dufresne from comment #17) > How long it take to get this patch from "Check for Updates". Unfortunately long, except we will backport this soon and you will agree to use 4.6.2 nightly build. With your help I was able to reproduce the problem. One has to have one of "not known" to Eclipse files in any explorer, on Windows it is *.bat, on Linux it is *.rb. Aditionally one has to use epp package (*not* SDK), where the Marketplace stuff is added. This will contribute a new "Search Marketplace" default entry to the Editors->File Asociations preference page. This "AskMarketPlaceForFileSupportStrategy" opens a dialog where user is asked to check if htere is a plugin available for the selected file extension. The dialog allows user to skip that and instead use whatever is defined already and remember the "System Editor" choice (so that user is not asked again). Once the user does this, on *next* startup he will sooner or later see a NPE if he uses one of explorers which shows that "unknown" files. @Mickael: when this "Search Marketplace" was added to the Eclipse packages? Was it already in 4.6.0, or 4.6.1? If in 4.6.0, I have no idea why it is shows up since we have 4.6.1. Anyway, it would be great if you could review the patch. Also I would like to backport the patch to t 4.6.2 => @Lars: please check. (In reply to Andrey Loskutov from comment #18) > @Mickael: when this "Search Marketplace" was added to the Eclipse packages? > Was it already in 4.6.0, or 4.6.1? If in 4.6.0, I have no idea why it is > shows up since we have 4.6.1. Anyway, it would be great if you could review > the patch. That was added in 4.6.0, and as far as I know, there weren't related changes between 4.6.0 and 4.6.1. If necessary, the MPC dialog can be tweaked to handle the case of System Editor differently, but... (In reply to Andrey Loskutov from comment #16) > This creates wrong entry like: > <descriptor id="org.eclipse.ui.systemExternalEditor" internal="false" > label="&System Editor" openMode="4" open_in_place="false"/> > Here the plugin ID is missing, because it is internal descriptor which > should have never been persisted. > [...] > But system editor descriptors were not designed to be persisted, they do not contain > contributed plugin id, neither program name or path, so they cause that NPE > after being restored as "usual" "external program" descriptors. Wouldn't it make sense to allow persistence of an association of a given file with the System Editor? That is a way for user to fully delegate to OS. If you also think it makes sense, would it be a difficult thing to change? > The patch https://git.eclipse.org/r/82334 disallows now to store and to load > internal editors to/from the memento, and also adds an edditional > consistency check to the "external" editors case. I'll have a look, however, it would be nice if we can consider the question above before merging that. Many thanks for the quick investigation and issue identification. My setup matches the .bat on Windows scenario. (In reply to Mickael Istria from comment #19) > (In reply to Andrey Loskutov from comment #18) > > @Mickael: when this "Search Marketplace" was added to the Eclipse packages? > > Was it already in 4.6.0, or 4.6.1? If in 4.6.0, I have no idea why it is > > shows up since we have 4.6.1. Anyway, it would be great if you could review > > the patch. > > That was added in 4.6.0, and as far as I know, there weren't related changes > between 4.6.0 and 4.6.1. Strange coincidence. We got 3 bug reports in a short time after 4.6.1 release, and no reports before... > If necessary, the MPC dialog can be tweaked to handle the case of System > Editor differently, but... This was my first idea, but the code looks OK, it simply revealed already existing issues with EditorRegistry code, which would similarly fail if any other client would decide to persist similar file assiciations. > (In reply to Andrey Loskutov from comment #16) > Wouldn't it make sense to allow persistence of an association of a given > file with the System Editor? That is a way for user to fully delegate to OS. It is already/still there. The problem was that if an *association* was added, related *descriptor* was persisted too, which is not needed for system special descriptors. Loading of that persisted descriptor on next startup was the cause for NPE's later. > If you also think it makes sense, would it be a difficult thing to change? It makes sense and therefore it is still there (in the last patch version). At the begining I've removed it, but as you can see in Eclipse, the code (and behavior) is still there. > > The patch https://git.eclipse.org/r/82334 disallows now to store and to load > > internal editors to/from the memento, and also adds an edditional > > consistency check to the "external" editors case. > > I'll have a look, however, it would be nice if we can consider the question > above before merging that. See above. (In reply to Andrey Loskutov from comment #18) > @Mickael: when this "Search Marketplace" was added to the Eclipse packages? > Was it already in 4.6.0, or 4.6.1? If in 4.6.0, I have no idea why it is > shows up since we have 4.6.1. Anyway, it would be great if you could review > the patch. There was actually a change in MPC that can explain why issue pop-up with 4.6.1: http://git.eclipse.org/c/mpc/org.eclipse.epp.mpc.git/commit/?id=310d627cebf98d983503f0d47a1d8dff83f81840 It seems like I cannot easily reproduce the issue on Linux: all files I've found which have a marketplace entry get associated with Gedit and have no problem with icons or whatever. (In reply to Mickael Istria from comment #22) > There was actually a change in MPC that can explain why issue pop-up with > 4.6.1: > http://git.eclipse.org/c/mpc/org.eclipse.epp.mpc.git/commit/ > ?id=310d627cebf98d983503f0d47a1d8dff83f81840 Yep, this is exact the trigger. > It seems like I cannot easily reproduce the issue on Linux: all files I've > found which have a marketplace entry get associated with Gedit and have no > problem with icons or whatever. You can fake the answer from the MPC in debugger (just add any String to the emty list returned) and so use any file type you like. (In reply to Andrey Loskutov from comment #23) > > It seems like I cannot easily reproduce the issue on Linux: all files I've > > found which have a marketplace entry get associated with Gedit and have no > > problem with icons or whatever. > > You can fake the answer from the MPC in debugger (just add any String to the > emty list returned) and so use any file type you like. On breakpoint at AskMarketPlaceForFileSupportStrategy line 81. (In reply to Andrey Loskutov from comment #23) > You can fake the answer from the MPC in debugger (just add any String to the > emty list returned) and so use any file type you like. Fedora/Gnome defaults always associate the Text Editor to an unknown file type, so I can tweak Eclipse as much as I can, the System Editor will always have an icon -the gedit one for unknown types- and won't be able to reproduce the initial issue. I don't want to get deep into tweaking my beloved OS to review this change, so I feel like I'm not able to verify it properly. Sorry. @Andrey: Code looks good enough to be merged IMO. Feel free to proceed with the merge if you're confident about it, or ask some Windows user for a review. Gerrit change https://git.eclipse.org/r/82334 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=82d9e8c91c6e22d7de8329c00580e5ec94ae385f New Gerrit change created: https://git.eclipse.org/r/82408 (In reply to Eclipse Genie from comment #27) > New Gerrit change created: https://git.eclipse.org/r/82408 Patch for backporting to 4.6.2. @Lars: can you +1 for propagating to 4.6.2? @Patrik: can you please review the backport patch for 4.6.2? (In reply to Mickael Istria from comment #25) > (In reply to Andrey Loskutov from comment #23) > > You can fake the answer from the MPC in debugger (just add any String to the > > emty list returned) and so use any file type you like. > > Fedora/Gnome defaults always associate the Text Editor to an unknown file > type, so I can tweak Eclipse as much as I can, the System Editor will always > have an icon -the gedit one for unknown types- and won't be able to > reproduce the initial issue. The problem with icon is not because we don't get it from the system or that system has an editor for this, but because we get a NPE in decorator after loading wrongly persisted system descriptor. (In reply to Andrey Loskutov from comment #28) > The problem with icon is not because we don't get it from the system or that > system has an editor for this, but because we get a NPE in decorator after > loading wrongly persisted system descriptor. Even so, I didn't manage to reproduce this issue. The stacktrace says NPE happens while dereferencing filename (where I imagine filename is the path to the icon for the system editor). On my machine, it seems like this filename is never null, whereas it can be on Windows for example. +1 from project lead for downport *** Bug 503397 has been marked as a duplicate of this bug. *** (In reply to Patrik Dufresne from comment #17) > How long it take to get this patch from "Check for Updates". We are evaluating the possibility to include the hotfix for this bug in the MPC 1.5.1a build, see bug 498553 and bug 501000 comment 43. This one probably will be available very soon. Happened to me as well. I'm running on Eclipse Version: Neon Release (4.6.0), Build id: 20160613-1800 with Windows 10 1607 build 14393.222. I installed Eclipse as fresh new and I created a new workspace, so it cannot be a problem related to an update from previous version. I got this error expanding from the package explorer the "lib" folder of a web application project. I got a NPE error for each existing jar (or anyway it seems to be this way, I did not count each row). The strange thing here is the all the jar files does not have the common icon, the icon is just missing. Here one of the NPE errors -------------------------------------------------- eclipse.buildId=4.6.0.I20160606-1100 java.version=1.8.0_91 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT Framework arguments: -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -data file:/C:/Noovle/workspace_neon/ -product org.eclipse.epp.package.jee.product -------------------------------------------------- and the stacktrace -------------------------------------------------- java.lang.NullPointerException at org.eclipse.ui.internal.misc.ProgramImageDescriptor.hashCode(ProgramImageDescriptor.java:74) at org.eclipse.jdt.ui.JavaElementImageDescriptor.hashCode(JavaElementImageDescriptor.java:207) at java.util.HashMap.hash(HashMap.java:338) at java.util.HashMap.get(HashMap.java:556) at java.util.Collections$SynchronizedMap.get(Collections.java:2584) at org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry.get(ImageDescriptorRegistry.java:57) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel(JavaElementImageProvider.java:104) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel(JavaElementImageProvider.java:98) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage(JavaUILabelProvider.java:142) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerLabelProvider.getImage(PackageExplorerLabelProvider.java:137) at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.getImage(DelegatingStyledCellLabelProvider.java:195) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.getImage(DecoratingStyledCellLabelProvider.java:168) at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.update(DelegatingStyledCellLabelProvider.java:121) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.update(DecoratingStyledCellLabelProvider.java:131) at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:141) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:949) at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:118) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1029) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:71) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:75) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:192) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:99) at org.eclipse.jface.viewers.BaseLabelProvider$1.run(BaseLabelProvider.java:72) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173) at org.eclipse.jface.viewers.BaseLabelProvider.fireLabelProviderChanged(BaseLabelProvider.java:69) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.lambda$0(DecoratingStyledCellLabelProvider.java:75) at org.eclipse.ui.internal.decorators.DecoratorManager$1.run(DecoratorManager.java:374) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.decorators.DecoratorManager.fireListener(DecoratorManager.java:371) at org.eclipse.ui.internal.decorators.DecorationScheduler$3.runInUIThread(DecorationScheduler.java:511) at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:97) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4203) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3819) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519) -------------------------------------------------- (In reply to Nicola Spreafico from comment #33) > I'm running on Eclipse Version: Neon Release (4.6.0), Build id: > 20160613-1800 with Windows 10 1607 build 14393.222. > I installed Eclipse as fresh new and I created a new workspace, so it cannot > be a problem related to an update from previous version. We already sorted this out, it is not an update issue. The bug in EditorRegistry was uncovered via MPC contribution to 4.6.0 in a not severe version, because AskMarketPlaceForFileSupportStrategy changed mappings but forgot to *persist* the broken state in EditorRegistry, so one had to use some other code persisting the state *after that* to get to the corrupted state. So the probability to hit the bug was pretty low with 4.6.0. With 4.6.1, MPC code was fixed (via bug 498553) and now the "bad" state is persisted immediately after change, making this bug much more severe. > The strange thing here is the all the jar files does not have the common > icon, the icon is just missing. This is expected behavior after NPE :-) (In reply to Andrey Loskutov from comment #34) > (In reply to Nicola Spreafico from comment #33) > > I'm running on Eclipse Version: Neon Release (4.6.0), Build id: > > 20160613-1800 with Windows 10 1607 build 14393.222. > > I installed Eclipse as fresh new and I created a new workspace, so it cannot > > be a problem related to an update from previous version. > > We already sorted this out, it is not an update issue. > > The bug in EditorRegistry was uncovered via MPC contribution to 4.6.0 in a > not severe version, because AskMarketPlaceForFileSupportStrategy changed > mappings but forgot to *persist* the broken state in EditorRegistry, so one > had to use some other code persisting the state *after that* to get to the > corrupted state. So the probability to hit the bug was pretty low with 4.6.0. > > With 4.6.1, MPC code was fixed (via bug 498553) and now the "bad" state is > persisted immediately after change, making this bug much more severe. > > > The strange thing here is the all the jar files does not have the common > > icon, the icon is just missing. > > This is expected behavior after NPE :-) Thank you Andrey, (In reply to Andrey Loskutov from comment #34) > (In reply to Nicola Spreafico from comment #33) > > I'm running on Eclipse Version: Neon Release (4.6.0), Build id: > > 20160613-1800 with Windows 10 1607 build 14393.222. > > I installed Eclipse as fresh new and I created a new workspace, so it cannot > > be a problem related to an update from previous version. > > We already sorted this out, it is not an update issue. > > The bug in EditorRegistry was uncovered via MPC contribution to 4.6.0 in a > not severe version, because AskMarketPlaceForFileSupportStrategy changed > mappings but forgot to *persist* the broken state in EditorRegistry, so one > had to use some other code persisting the state *after that* to get to the > corrupted state. So the probability to hit the bug was pretty low with 4.6.0. > > With 4.6.1, MPC code was fixed (via bug 498553) and now the "bad" state is > persisted immediately after change, making this bug much more severe. > > > The strange thing here is the all the jar files does not have the common > > icon, the icon is just missing. > > This is expected behavior after NPE :-) Thank you for the insight. I removed the jar extension from the File Association and now it works Gerrit change https://git.eclipse.org/r/82408 was merged to [R4_6_maintenance]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=a5de7a28e73b045e9dd2255256ee305c96bec0c5 (In reply to Eclipse Genie from comment #36) > Gerrit change https://git.eclipse.org/r/82408 was merged to > [R4_6_maintenance]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=a5de7a28e73b045e9dd2255256ee305c96bec0c5 Thanks Mickael! Fix is now in 4.6.2. *** Bug 505603 has been marked as a duplicate of this bug. *** *** Bug 505605 has been marked as a duplicate of this bug. *** This started happening to me as well. And it is _extremely_ annoying. Is there any chance to get a patch before 4.6.2? I second that. I had to throw in the towel and go back to an older version of eclipse. The popup dialog boxes were happening to me every 30 to 45 seconds. Eclipse was unusable. I maintain 19 services. I had to rebuild them all. I do want to say I am very impressed with Eclipse. I have been using Eclipse from the very first release. This is the only time I encountered an issue where I had to go back a version. I agree. If it hits you, it makes your installation unusable. So downgrading to 4.6.0 seems the only solution otherwise. (In reply to Jens Reimann from comment #40) > Is there any chance to get a patch before 4.6.2? Yes. 1) Remove offending editor associations via Preferences->General->Editors->File Associations for all files which have "&System Editor (default)" entry. 2) and after that update MPC to 1.5.2 from this update site: http://download.eclipse.org/mpc/releases/1.5.2/. 3) or you will wait until we get an official Eclipse 4.6.1a re-spin available on eclipse.org. I have no concrete dates for you, but it should be very soon available (see https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg13725.html, bug 502937 and bug 501000). I've updated to Neon.1a but still get this exception?? (In reply to Missing name from comment #44) > I've updated to Neon.1a but still get this exception?? Please carefully read comment 43. Updating to 4.6.1a alone isn't enough. Today i had the same NullPointerException. It always triggered wehen i pressed F5 on one of my Projects. Some time later i noticed that an icon of one of the files in the root folder was missing. This is a windows *.bat file to update some stub-classes for my project. Now the openwith menu entry is also completely empty for this Filetype. Double clicking the file in Package Explorer still opens the cmd window as expected. I temporary removed this file and then the Exception was gone. I also remembered that eclipse asked me yesterday if i want to go to the Marketplace and install an editor for that Filetype or keep using system editor. I did not install anything. Maybe this information can help someone. (In reply to Christian Meister from comment #46) > Today i had the same NullPointerException. > > It always triggered wehen i pressed F5 on one of my Projects. > Some time later i noticed that an icon of one of the files in the root > folder was missing. This is a windows *.bat file to update some stub-classes > for my project. > > Now the openwith menu entry is also completely empty for this Filetype. > Double clicking the file in Package Explorer still opens the cmd window as > expected. > > I temporary removed this file and then the Exception was gone. > I also remembered that eclipse asked me yesterday if i want to go to the > Marketplace and install an editor for that Filetype or keep using system > editor. I did not install anything. > > Maybe this information can help someone. Thanks for posting this message. My version of Eclipse was working fine until I clicked on a bat file for the first time. Eclipse ran the bat file but also brought up some popup that asked if I wanted to use some kind of program or editor when accessing bat files. I don't remember the exact detail though. It was then that I started getting the ProgramImageDescriptor issue. I forgot about this until I read your post. I also hope this helps to identify where the base root of this issue is coming from. I am wondering if there might be a more fundamental issue here than just the obvious one relating to NullPointerException. (In reply to lance campbell from comment #47) > I also hope this helps to identify where the base root of this issue is > coming from. Guys, thanks for your help, but we already identified AND fixed the problem! The full fix for 4.6 stream will be available with 4.6.2 or with any recent nightly 4.6 maintenance builds from http://download.eclipse.org/eclipse/downloads/ (e.g. http://download.eclipse.org/eclipse/downloads/drops4/M20161013-0730/). (In reply to Andrey Loskutov from comment #48) > (In reply to lance campbell from comment #47) > > I also hope this helps to identify where the base root of this issue is > > coming from. > > Guys, thanks for your help, but we already identified AND fixed the problem! > The full fix for 4.6 stream will be available with 4.6.2 or with any recent > nightly 4.6 maintenance builds from > http://download.eclipse.org/eclipse/downloads/ (e.g. > http://download.eclipse.org/eclipse/downloads/drops4/M20161013-0730/). Sometimes when I am fixing a software issue I can fix a symptom and not fix the underlining problem. That is why I shared this information. I am sure you fixed the null pointer issue. I did not know that you identified why it was happening in the first place. Because the issue did not start the moment I install Eclipse. It happened a week or so later. Just trying to help. This is a marvelous product. All of you do great work. *** Bug 507033 has been marked as a duplicate of this bug. *** |