Modify ↓
Opened 6 years ago
Closed 6 years ago
#17577 closed defect (duplicate)
utilsplugin2 sometimes causes a crash when trying to save a preference
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin | Version: | |
Keywords: | Cc: |
Description
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2019-04-09 01:32:56 +0200 (Tue, 09 Apr 2019) Build-Date:2019-04-09 01:35:39 Revision:14977 Relative:URL: ^/trunk Identification: JOSM/1.5 (14977 en) Mac OS X 10.14.1 OS Build number: Mac OS X 10.14.1 (18B75) Memory Usage: 1059 MB / 1820 MB (392 MB allocated, but free) Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: Display 188947522 1920x1080, Display 69981408 2048x1152 Maximum Screen Size: 2048x1152 VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/31/583aa85f-7f8234e1, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Dmacosx.jnlpx.dock.name=JOSM (development version), -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/25/4c122699-477b07e1.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm-latest.jnlp , -Djnlpx.jvm="<java.home>/bin/java"] Dataset consistency test: No problems found Plugins: + Mapillary (1.5.18) + apache-commons (34506) + apache-http (34632) + auto_tools (67) + buildings_tools (34968) + ejml (34389) + geotools (34513) + jaxb (34678) + jna (34867) + jts (34524) + markseen (13) + opendata (34911) + utilsplugin2 (34932) Map paint styles: + https://raw.githubusercontent.com/KaartGroup/Kaart-Styles/master/Kaart-Styles.mapcss + https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1 + https://raw.githubusercontent.com/KaartGroup/Kaart-Styles/master/Overlapping%20Ways.mapcss - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1 Validator rules: + https://raw.githubusercontent.com/KaartGroup/KaartValidator/master/kaart.validator.mapcss Last errors/warnings: - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - E: java.lang.ClassNotFoundException: org.openstreetmap.josm.plugins.utilsplugin2.actions.TagSourceAction - E: Handled by bug report queue: java.lang.IllegalArgumentException: null source - W: Warning - <html>JOSM could not find information about the following plugins:<ul><li>auto_tools</li><li>apache-commons</li><li>geotools</li><li>opendata</li><li>jts</li><li>Mapillary</li><li>ejml</li><li>jaxb</li><li>utilsplugin2</li><li>markseen</li><li>buildings_tools</li><li>jna</li><li>apache-http</li></ul>The plugins are not going to be loaded.</html> - E: java.lang.ClassNotFoundException: org.openstreetmap.josm.plugins.utilsplugin2.actions.TagSourceAction - E: Handled by bug report queue: java.lang.IllegalArgumentException: null source === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: AWT-EventQueue-2 (44) of javawsApplicationThreadGroup java.lang.IllegalArgumentException: null source at java.util.EventObject.<init>(EventObject.java:56) at org.openstreetmap.josm.spi.preferences.DefaultPreferenceChangeEvent.<init>(DefaultPreferenceChangeEvent.java:25) at org.openstreetmap.josm.data.Preferences.firePreferenceChanged(Preferences.java:231) at org.openstreetmap.josm.data.Preferences.putSetting(Preferences.java:623) at org.openstreetmap.josm.spi.preferences.AbstractPreferences.put(AbstractPreferences.java:25) at org.openstreetmap.josm.plugins.utilsplugin2.actions.TagSourceAction.updateEnabledState(TagSourceAction.java:75) at org.openstreetmap.josm.actions.JosmAction$SelectionChangeAdapter.selectionChanged(JosmAction.java:450) at org.openstreetmap.josm.data.osm.event.SelectionEventManager$DataListenerInfo.fire(SelectionEventManager.java:57) at org.openstreetmap.josm.data.osm.event.SelectionEventManager.fireEvent(SelectionEventManager.java:159) at org.openstreetmap.josm.data.osm.event.SelectionEventManager.lambda$selectionChanged$0(SelectionEventManager.java:150) at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:238) at org.openstreetmap.josm.data.osm.event.SelectionEventManager.selectionChanged(SelectionEventManager.java:150) at org.openstreetmap.josm.data.osm.DataSet.lambda$doSelectionChange$5(DataSet.java:684) at org.openstreetmap.josm.tools.ListenerList.fireEvent(ListenerList.java:150) at org.openstreetmap.josm.data.osm.DataSet.doSelectionChange(DataSet.java:684) at org.openstreetmap.josm.data.osm.DataSet.setSelected(DataSet.java:615) at org.openstreetmap.josm.data.osm.DataSet.setSelected(DataSet.java:606) at org.openstreetmap.josm.actions.mapmode.SelectAction.selectPrims(SelectAction.java:988) at org.openstreetmap.josm.actions.mapmode.SelectAction.selectionEnded(SelectAction.java:635) at org.openstreetmap.josm.gui.SelectionManager.selectingDone(SelectionManager.java:343) at org.openstreetmap.josm.gui.SelectionManager.endSelecting(SelectionManager.java:257) at org.openstreetmap.josm.actions.mapmode.SelectAction.mouseReleased(SelectAction.java:583) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.Component.processMouseEvent(Component.java:6539) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
It looks like ReflectionUtils.findCallerClass(preferencesClasses)
is returning null
in src/org/openstreetmap/josm/data/Preferences.java#L232.
I don't know what the proper way to resolve this is -- I would be inclined to do something like this:
protected void firePreferenceChanged(String key, Setting<?> oldValue, Setting<?> newValue) { Class<?> caller = ReflectionUtils.findCallerClass(preferencesClasses); /* If we can't find the caller, don't set the preference key * {@code caller} should never be null except in very strange circumstances */ if (caller == null) return; final PreferenceChangeEvent evt = new DefaultPreferenceChangeEvent(caller, key, oldValue, newValue); listeners.fireEvent(listener -> listener.preferenceChanged(evt)); ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener> forKey = keyListeners.get(key); if (forKey != null) { forKey.fireEvent(listener -> listener.preferenceChanged(evt)); }
Attachments (0)
Note:
See TracTickets
for help on using tickets.
Closed as duplicate of #17574.