maripo / JOSM_easypresets

22 stars 7 forks source link

NullPointerException when edited preset is applied to an object #29

Closed maripo closed 6 years ago

maripo commented 6 years ago

{{{ Build-Date:2017-12-13 09:30:44 Revision:13200 Is-Local-Build:true

Identification: JOSM/1.5 (13200 SVN ja) Mac OS X 10.13 OS Build number: Mac OS X 10.13 (17A405) Memory Usage: 953 MB / 3641 MB (671 MB allocated, but free) Java version: 1.8.0_144-b01, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: Display 69732800 1280x800 Maximum Screen Size: 1280x800 Dataset consistency test: No problems found

Plugins:

Tagging presets:

Map paint styles:

Last errors/warnings:

=== REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE === Thread: AWT-EventQueue-0 (18) of main java.lang.NullPointerException at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem.matches(TaggingPresetItem.java:148) at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.matches(TaggingPreset.java:605) at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.test(TaggingPreset.java:590) at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.test(TaggingPreset.java:80) at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) at java.util.LinkedList$LLSpliterator.tryAdvance(LinkedList.java:1249) at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.allMatch(ReferencePipeline.java:454) at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.createPanel(TaggingPreset.java:316) at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.showDialog(TaggingPreset.java:468) at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.actionPerformed(TaggingPreset.java:393) at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSearchDialog.buttonAction(TaggingPresetSearchDialog.java:55) at org.openstreetmap.josm.gui.ExtendedDialog$1.actionPerformed(ExtendedDialog.java:377) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(BasicRootPaneUI.java:208) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663) at javax.swing.JComponent.processKeyBinding(JComponent.java:2882) at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:307) at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:250) at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2974) at javax.swing.JComponent.processKeyBindings(JComponent.java:2966) at javax.swing.JComponent.processKeyEvent(JComponent.java:2845) at java.awt.Component.processEvent(Component.java:6310) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771) at java.awt.Component.dispatchEventImpl(Component.java:4760) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) 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:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109) at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227) at java.security.AccessController.doPrivileged(Native Method) at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227) at java.awt.Dialog.show(Dialog.java:1084) at java.awt.Component.show(Component.java:1671) at java.awt.Component.setVisible(Component.java:1623) at java.awt.Window.setVisible(Window.java:1014) at java.awt.Dialog.setVisible(Dialog.java:1005) at org.openstreetmap.josm.gui.ExtendedDialog.setVisible(ExtendedDialog.java:458) at org.openstreetmap.josm.gui.ExtendedDialog.showDialog(ExtendedDialog.java:254) at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSearchDialog.showDialog(TaggingPresetSearchDialog.java:44) at org.openstreetmap.josm.actions.TaggingPresetSearchAction.actionPerformed(TaggingPresetSearchAction.java:36) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663) at javax.swing.JComponent.processKeyBinding(JComponent.java:2882) at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:307) at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:263) at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2974) at javax.swing.JComponent.processKeyBindings(JComponent.java:2966) at javax.swing.JComponent.processKeyEvent(JComponent.java:2845) at java.awt.Component.processEvent(Component.java:6310) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771) at java.awt.Component.dispatchEventImpl(Component.java:4760) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) 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:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) 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) }}}

maripo commented 6 years ago

How to reproduce:

  1. Apply a custom preset to an object
  2. Edit the custom preset and remove a tag
  3. Save it
  4. Select the object
  5. Exception occurs!
maripo commented 6 years ago

TaggingPresetItem.data contains null.

maripo commented 6 years ago

Fixed.