Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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 andre68@…, 15 years ago

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.

comment:2 by andre68@…, 15 years ago

Sorry, wrong versions: I meant version r2620 is ok and r2621 is buggy.
Also forgot to say, that JOSM r2620 uses OpenStreetBug version 19050 and JOSM r2621 uses OpenStreetBug version 19285.

comment:3 by anonymous, 15 years ago

yesterday r2784 was still working fine.

in reply to:  3 comment:4 by andre68@…, 15 years ago

Replying to anonymous:

yesterday r2784 was still working fine.

That's what I meant with "strangely".

I've just tried version r2784 and it's also buggy now.

Possibly the correlation of JOSM version and plugin version is faulty.

comment:5 by hampelratte, 15 years ago

Resolution: fixed
Status: newclosed

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 stoecker, 15 years ago

Resolution: fixed
Status: closedreopened

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 hampelratte, 15 years ago

Resolution: fixed
Status: reopenedclosed
  1. I have added the icons
  2. 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 stoecker, 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 hampelratte, 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.