Opened 6 years ago

Last modified 6 years ago

#19489 closed defect

NPE at ComboMultiSelect.getItemToSelect with default="" in multiselect — at Version 1

Reported by: AlaskaDave Owned by: team
Priority: normal Milestone: 20.07
Component: Core Version:
Keywords: template_report regression Cc: simon04

Description (last modified by Klumbumbus)

I clicked on a custom preset that I've used many times before and an error dialog popped up. I uploaded my edits, and clicked on it again.Same thing.

What steps will reproduce the problem?

  1. Click on a preset in my custom tagging presets collection: Waters.xml

What is the expected result? The preset will open and I'll add information and save it

What happens instead? Error dialog results

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-06-30 19:13:42 +0200 (Tue, 30 Jun 2020)
Build-Date:2020-07-01 01:30:51
Revision:16731
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16731 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1909 (18363)
Memory Usage: 692 MB / 1820 MB (218 MB allocated, but free)
Java version: 1.8.0_221-b11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1200 (scaling 1.0x1.0)
Maximum Screen Size: 1920x1200
Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32
Dataset consistency test: No problems found

Plugins:
+ ColorPlugin (1537115529)
+ DirectDownload (35248)
+ DirectUpload (35499)
+ FastDraw (35499)
+ ImproveWay (29)
+ OpeningHoursEditor (35414)
+ SimplifyArea (35405)
+ apache-commons (35362)
+ apache-http (35092)
+ buildings_tools (35500)
+ changeset-viewer (22)
+ editgpx (35248)
+ ejml (35313)
+ geotools (35169)
+ imagery_offset_db (35405)
+ jaxb (35092)
+ jna (35092)
+ jts (35122)
+ measurement (35405)
+ opendata (35405)
+ photo_geotagging (35499)
+ rasterfilters (35405)
+ reltoolbox (35405)
+ tageditor (35258)
+ todo (30306)
+ turnlanes (35405)
+ turnlanes-tagging (283)
+ turnrestrictions (35405)
+ utilsplugin2 (35487)
+ waydownloader (35405)
+ wikipedia (1.1.4)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/Towers&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/BuildingPreset&zip=1
+ %UserProfile%\Dropbox\GPS Files\address.xml
+ %UserProfile%\Dropbox\GPS Files\Bbl_Fuel.xml
+ %UserProfile%\Dropbox\GPS Files\Benchmark.xml
+ %UserProfile%\Dropbox\GPS Files\BorC.xml
+ %UserProfile%\Dropbox\GPS Files\CoinOp_Fuel.xml
+ %UserProfile%\Dropbox\GPS Files\Daves-Misc.xml
+ %UserProfile%\Dropbox\GPS Files\Hamlet.xml
+ %UserProfile%\Dropbox\GPS Files\hydrant.xml
+ %UserProfile%\Dropbox\GPS Files\Land-Natural.xml
+ %UserProfile%\Dropbox\GPS Files\Milemarker.xml
+ %UserProfile%\Dropbox\GPS Files\NWR.xml
+ %UserProfile%\Dropbox\GPS Files\Ponds.xml
+ %UserProfile%\Dropbox\GPS Files\ResArea.xml
+ %UserProfile%\Dropbox\GPS Files\ResHwy.xml
+ %UserProfile%\Dropbox\GPS Files\Service.xml
+ %UserProfile%\Dropbox\GPS Files\TAP Service.xml
+ %UserProfile%\Dropbox\GPS Files\tennis.xml
+ %UserProfile%\Dropbox\GPS Files\UnclassHwy.xml
+ %UserProfile%\Dropbox\GPS Files\US_Fuel.xml
+ %UserProfile%\Dropbox\GPS Files\Wat.xml
+ %UserProfile%\Dropbox\GPS Files\Waters.xml
+ %UserProfile%\Dropbox\GPS Files\Ways.xml
+ %UserProfile%\Dropbox\GPS Files\wlan.xml
+ %UserProfile%\Dropbox\GPS Files\Stream.xml
+ %UserProfile%\Dropbox\GPS Files\Thai_Fuel.xml

Map paint styles:
- https://downloads.osm-tools.org/FB_edits.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Whitewater&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1

Last errors/warnings:
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- W: Unable to convert property casing-color to type class java.awt.Color: found #66066 of type class java.lang.String!
- E: Handled by bug report queue: java.lang.NullPointerException


=== 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.items.ComboMultiSelect.getItemToSelect(ComboMultiSelect.java:354)
	at org.openstreetmap.josm.gui.tagging.presets.items.MultiSelect.addToPanelAnchor(MultiSelect.java:37)
	at org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect.addToPanel(ComboMultiSelect.java:221)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.createPanel(TaggingPreset.java:340)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.showDialog(TaggingPreset.java:487)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.showAndApply(TaggingPreset.java:400)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.actionPerformed(TaggingPreset.java:390)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

Change History (2)

by AlaskaDave, 6 years ago

Attachment: Waters.xml added

The preset "River source" caused the error but the preset for "Dam" and others work fine. The preset "River section" will also cause an error. (I have disabled error reporting for this bug during this session so I get no response for either of the two presets now.)

comment:1 by Klumbumbus, 6 years ago

Cc: simon04 added
Description: modified (diff)
Keywords: regression added
Milestone: 20.07
Summary: I clicked on a custom preset that I've used many times before and an error dialog popped up. I uploaded my edits, and clicked on it again.Same thing.NPE at ComboMultiSelect.getItemToSelect with default="" in multiselect

Your presets has some errors. Remove all default="". Also label and link work only within a item. Remove line 88 and 89.

Throwing a NPE is not optimal though.

Note: See TracTickets for help on using tickets.