Modify

Opened 5 years ago

Closed 5 years ago

#12443 closed defect (fixed)

[patch] adding member to a new relation causes NPE

Reported by: kolesar Owned by: Don-vip
Priority: major Milestone: 16.02
Component: Core Version:
Keywords: template_report regression Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Draw something, for example a untagged node. Keep it selected.
  2. Create a new relation.
  3. Add selection to the new relation.

What is the expected result?

Selection is added to the relation.

What happens instead?

NullPointerException (@since r9588)

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

Attached patch that checks if given relation is null.

Build-Date:2016-01-25 13:33:40
Revision:9629
Is-Local-Build:true

Identification: JOSM/1.5 (9629 SVN en) Linux Ubuntu 14.04.3 LTS
Memory Usage: 207 MB / 910 MB (114 MB allocated, but free)
Java version: 1.7.0_85-b01, Oracle Corporation, OpenJDK Server VM
Java package: openjdk-7-jre:i386-7u85-2.6.1-5ubuntu0.14.04.1
Program arguments: [/home/kolesar/személyes/osm/napi/20160115/relation.osm.gz]
Dataset consistency test: No problems found


Last errors/warnings:
- E: java.lang.NullPointerException
- E: java.lang.NullPointerException

java.lang.NullPointerException
	at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetType.forPrimitive(TaggingPresetType.java:52)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getRelationMemberForPrimitive(MemberTableModel.java:445)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.addMembersAtIndex(MemberTableModel.java:435)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.addMembersAtEnd(MemberTableModel.java:473)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.AddSelectedAtEndAction.actionPerformed(AddSelectedAtEndAction.java:42)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6516)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
	at java.awt.Component.processEvent(Component.java:6281)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4872)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
	at java.awt.EventQueue.access$300(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:706)
	at java.awt.EventQueue$3.run(EventQueue.java:704)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.awt.EventQueue$4.run(EventQueue.java:718)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Attachments (1)

MemberTableModelFix.patch (1.6 KB) - added by kolesar 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by kolesar

Attachment: MemberTableModelFix.patch added

comment:1 Changed 5 years ago by anonymous

I can confirm this issue.

comment:2 Changed 5 years ago by Don-vip

Description: modified (diff)
Keywords: regression added
Milestone: 16.02
Owner: changed from team to Don-vip
Status: newassigned

comment:3 Changed 5 years ago by Don-vip

Resolution: fixed
Status: assignedclosed

In 9632/josm:

fix #12443 - NPE (regression from r9588, see #12412)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.