#4335 closed defect (fixed)
Plugin Openstreetbugs causes NPE at startup
Reported by: | Cobra | Owned by: | team |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Plugin | Version: | latest |
Keywords: | Cc: |
Description
Openstreetbugs crashes immediately when loading at josm startup:
... loading openstreetbugs org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin openstreetbugs at org.openstreetmap.josm.plugins.PluginInformation.load(PluginInformation.java:186) at org.openstreetmap.josm.plugins.PluginHandler.loadPlugins(PluginHandler.java:208) at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:169) Caused by: java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:167) at org.openstreetmap.josm.plugins.osb.OsbPlugin.loadIcon(OsbPlugin.java:213) at org.openstreetmap.josm.plugins.osb.gui.OsbDialog.<init>(OsbDialog.java:146) at org.openstreetmap.josm.plugins.osb.OsbPlugin.<init>(OsbPlugin.java:73) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.openstreetmap.josm.plugins.PluginInformation.load(PluginInformation.java:184) ... 2 more ...
Version information:
josm Revision: 2801
openstreetbugs: Version 19285
Attachments (0)
Change History (9)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
comment:4 by , 15 years ago
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
There were two icons missing in that version. I have just uploaded a new version, which should work. The new version should be available over the plugin dialog within the next hour.
comment:6 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Your fix hides the bug. Please revert or fix it correctly. Either the two icons should be added or loading them should not be started at all.
When you prevent errors in icon loading, then nobody will nortce when icons aren't loaded at all.
comment:7 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
- I have added the icons
- To have no icon is better than having a crashing plugin and the empty icon is only the last resort.
P.S. The version, which didn't include the icons, was checked in by you. Did you use the ant build script or how was it built? Because the jar built by ant includes the icons. Or was your checkout not ok? I'm trying to find the reason why they were missing.
comment:8 by , 15 years ago
ant can only include icons when they are in SVN. I now added the icons from the .jar which you again did not add properly even if you claimed so. Also I changed Image loader to use josm's standard mechanism now.
"To have no icon is better than having a crashing plugin": This is not true. When it is an such obvious programming error it is better the plugins crashs than the error is hidden. JOSM has two different image loaders. ImageProver.get() for required icons and ImageProvider.getIfAvailable() for these, where images may be missing.
comment:9 by , 15 years ago
Whoopsy. Seems to be a problem with my svn client, because it shows the icons as checked in. I will delete my working copy and do a complete checkout, so that the svn information should be in sync with the repo again. Sorry for that.
I was just preparing the same bug report.
Strangely it seems that the bug was introduced with version r1621 which is quite some time ago (2009-12-12) and I'm sure I've used latest JOSM afterwards without this bug.
Anyway, by downgrading to r1620 the bug is gone and upgrading to r1621 afterwards produces the bug again.