Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#21550 closed defect (fixed)

[PATCH] NPE in org.openstreetmap.josm.gui.tagging.presets.items.PresetListEntry.getCount

Reported by: S-ThndR Owned by: team
Priority: normal Milestone: 21.12
Component: Core Version: tested
Keywords: template_report, regression Cc: hauke-stieler

Description

What steps will reproduce the problem?

  1. Add tagging preset "Parking lanes".
  2. In presets drop down menu, click any of the presets that comes with Parking lanes. Type of the selected object seems not matter.

What is the expected result?

"Change object" window pop-up.

What happens instead?

A exception.

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: 2021-11-01 23:05:46 +0100 (Mon, 01 Nov 2021)
Build-Date:2021-11-01 22:25:18
Revision:18303
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18303 zh_CN) Windows 7 64-Bit
OS Build number: Windows 7 Ultimate (7601)
Memory Usage: 951 MB / 1820 MB (548 MB allocated, but free)
Java version: 1.8.0_301-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 2560×1440 (scaling 1.00×1.00)
Maximum Screen Size: 2560×1440
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: GBK
System property sun.jnu.encoding: GBK
Locale info: zh_CN
Numbers with default locale: 1234567890 -> 1234567890
Dataset consistency test: No problems found

Plugins:
+ ImproveWay (32)
+ alignways (35753)
+ buildings_tools (35823)
+ editgpx (35562)
+ gpsblam (35458)
+ gridify (1606242219)
+ imagery_offset_db (35640)
+ jaxb (35543)
+ reverter (35846)
+ terracer (35827)
+ utilsplugin2 (35856)

Tagging presets:
+ https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-josm-presets.min.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/ParkingLanes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/TurnLanes&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&zip=1

Last errors/warnings:
- 00001.625 W: java.util.zip.ZipException: error in opening zip file
- 00001.626 W: PluginException: : org.openstreetmap.josm.plugins.PluginException: 无效的 jar 文件“<josm.pref>\plugins\wikipedia.jar.new”
- 00001.626 W: 文件"wikipedia.jar.new"扫描插件信息失败,正在跳过。
- 00001.998 W: java.util.zip.ZipException: error in opening zip file
- 00001.998 W: PluginException: : org.openstreetmap.josm.plugins.PluginException: 无效的 jar 文件“<josm.pref>\plugins\wikipedia.jar.new”
- 00001.998 W: 文件"wikipedia.jar.new"扫描插件信息失败,正在跳过。
- 00002.144 W: 无法从临时下载文件“<josm.pref>\plugins\wikipedia.jar.new”中安装插件“<josm.pref>\plugins\wikipedia.jar”。error in opening zip file: java.util.zip.ZipException: error in opening zip file
- 00018.187 E: Handled by bug report queue: java.lang.NullPointerException
- 01597.488 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 (19) of main
java.lang.NullPointerException
	at org.openstreetmap.josm.gui.tagging.presets.items.PresetListEntry.getCount(PresetListEntry.java:191)
	at org.openstreetmap.josm.gui.tagging.presets.items.PresetListEntry.getListDisplay(PresetListEntry.java:85)
	at org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect$ComboMultiSelectListCellRenderer.getListCellRendererComponent(ComboMultiSelect.java:139)
	at org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect$ComboMultiSelectListCellRenderer.getListCellRendererComponent(ComboMultiSelect.java:104)
	at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
	at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
	at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(Unknown Source)
	at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
	at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
	at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
	at javax.swing.DefaultListSelectionModel.changeSelection(Unknown Source)
	at javax.swing.DefaultListSelectionModel.changeSelection(Unknown Source)
	at javax.swing.DefaultListSelectionModel.setSelectionInterval(Unknown Source)
	at javax.swing.JList.setSelectedIndex(Unknown Source)
	at javax.swing.plaf.basic.BasicComboPopup.setListSelection(Unknown Source)
	at javax.swing.plaf.basic.BasicComboPopup.access$300(Unknown Source)
	at javax.swing.plaf.basic.BasicComboPopup$Handler.itemStateChanged(Unknown Source)
	at javax.swing.JComboBox.fireItemStateChanged(Unknown Source)
	at javax.swing.JComboBox.selectedItemChanged(Unknown Source)
	at javax.swing.JComboBox.contentsChanged(Unknown Source)
	at javax.swing.AbstractListModel.fireContentsChanged(Unknown Source)
	at org.openstreetmap.josm.gui.widgets.JosmComboBoxModel.setSelectedItem(JosmComboBoxModel.java:149)
	at javax.swing.JComboBox.setSelectedItem(Unknown Source)
	at org.openstreetmap.josm.gui.tagging.presets.items.Combo.addToPanel(Combo.java:159)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.createPanel(TaggingPreset.java:435)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.showDialog(TaggingPreset.java:596)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.showAndApply(TaggingPreset.java:508)
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPreset.actionPerformed(TaggingPreset.java:498)
	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)

Attachments (2)

21550.patch (1.8 KB ) - added by taylor.smock 2 years ago.
Fix NPE, add non-regression test
josm-custom.jar (15.9 MB ) - added by taylor.smock 2 years ago.
JOSM r18326 with fix for #21550 with an additional change to the revision.xml file (Is-Local-Build: true (taylor.smock, fix for #21550) from Is-Local-Build: true)

Change History (18)

comment:1 by taylor.smock, 2 years ago

Ticket #21552 has been marked as a duplicate of this ticket.

comment:2 by taylor.smock, 2 years ago

Keywords: regression added

This is probably a regression from #21408 (r18257).

by taylor.smock, 2 years ago

Attachment: 21550.patch added

Fix NPE, add non-regression test

comment:3 by taylor.smock, 2 years ago

Summary: parking lanes tagging preset not working[PATCH] NPE in org.openstreetmap.josm.gui.tagging.presets.items.PresetListEntry.getCount

comment:4 by taylor.smock, 2 years ago

Ticket #21573 has been marked as a duplicate of this ticket.

comment:5 by skyper, 2 years ago

Cc: hauke-stieler added

comment:6 by skyper, 2 years ago

Ticket #21586 has been marked as a duplicate of this ticket.

comment:7 by taylor.smock, 2 years ago

Ticket #21614 has been marked as a duplicate of this ticket.

comment:8 by skyper, 2 years ago

Milestone: 21.11

Regression should be fixed with next release.

comment:9 by taylor.smock, 2 years ago

Ticket #21618 has been marked as a duplicate of this ticket.

in reply to:  8 comment:10 by taylor.smock, 2 years ago

Replying to skyper:

Regression should be fixed with next release.

I know no one with core svn commit rights has been particularly active over the past 3 weeks. Which is about when I posted the patch for this. I'll upload a .jar file for people affected, just as a temporary measure (I don't know if we will have a 21.11 release).

by taylor.smock, 2 years ago

Attachment: josm-custom.jar added

JOSM r18326 with fix for #21550 with an additional change to the revision.xml file (Is-Local-Build: true (taylor.smock, fix for #21550) from Is-Local-Build: true)

comment:11 by GerdP, 2 years ago

Resolution: fixed
Status: newclosed

In 18327/josm:

fix #21550: NPE in org.openstreetmap.josm.gui.tagging.presets.items.PresetListEntry.getCount

  • add null check (patch by taylor.smock)

comment:12 by skyper, 2 years ago

Ticket #21664 has been marked as a duplicate of this ticket.

comment:13 by taylor.smock, 2 years ago

Ticket #21658 has been marked as a duplicate of this ticket.

comment:14 by GerdP, 2 years ago

Ticket #21672 has been marked as a duplicate of this ticket.

comment:15 by skyper, 2 years ago

Version: latesttested

comment:16 by Don-vip, 2 years ago

Milestone: 21.1121.12

Milestone renamed

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.