Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#23116 closed defect (fixed)

Can't add members to created relations

Reported by: josm@… Owned by: team
Priority: major Milestone: 23.08
Component: Core Version: latest
Keywords: template_report Cc: taylor.smock


What steps will reproduce the problem?

  1. Open an existing file.
  2. Create a new relation, or duplicate an existing relation. Don't save it.
  3. Attempt to add any members to this relation.

What is the expected result?

Members are added to the relation.

What happens instead?

A bug report dialog appears, and nothing is added to the relation.

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

This bug occurs only for relations that don't already exist in the file (the relation editor dialog is titled "Create new relation", not "Edit new relation" or "Edit relation #x xxx xxx"). Such relations can be saved to the file and then the error will not occur, but only non-empty relations can be saved as such (duplicated relations or relations made from templates); those created by the "New" button in the relation list are permanently stuck because the only confirmation button is "Delete".

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-08-09 22:24:34 +0200 (Wed, 09 Aug 2023)
Build-Date:2023-08-10 01:30:57

Identification: JOSM/1.5 (18803 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19045)
Memory Usage: 570 MB / 4068 MB (288 MB allocated, but free)
Java version: 17.0.4+8, Eclipse Adoptium, OpenJDK 64-Bit Server VM
Look and Feel:
Screen: \Display0 1920×1080 (scaling 1.00×1.00) \Display1 1920×1080 (scaling 1.00×1.00) \Display2 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
Dataset consistency test: No problems found

+ apache-commons (36034)
+ continuosDownload (1.3.4)
+ ejml (35924)
+ geotools (36068)
+ imagery_offset_db (36079)
+ jackson (36034)
+ jaxb (35952)
+ jts (36004)
+ opendata (36097)
+ turnrestrictions (36097)
+ utilsplugin2 (36097)

Map paint styles:

Last errors/warnings:
- 00000.226 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.228 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00003.031 W: Unable to request certificate of
- 00003.666 W: Unable to request certificate of
- 00149.689 E: Handled by bug report queue: java.lang.NullPointerException: Cannot invoke "" because the return value of "" is null

No data collected.

Warning issued by: BugReportExceptionHandler#handleException

Thread: AWT-EventQueue-0 (23) of main
java.lang.NullPointerException: Cannot invoke "" because the return value of "" is null
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getRelationMemberForPrimitive(
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.addMembersAtIndex(
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.addMembersAtEnd(
	at org.openstreetmap.josm.gui.dialogs.relation.actions.AddSelectedAtEndAction.actionPerformed(
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(
	at java.desktop/java.awt.Component.processMouseEvent(
	at java.desktop/javax.swing.JComponent.processMouseEvent(
	at java.desktop/java.awt.Component.processEvent(
	at java.desktop/java.awt.Container.processEvent(
	at java.desktop/java.awt.Component.dispatchEventImpl(
	at java.desktop/java.awt.Container.dispatchEventImpl(
	at java.desktop/java.awt.Component.dispatchEvent(
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(
	at java.desktop/java.awt.Container.dispatchEventImpl(
	at java.desktop/java.awt.Window.dispatchEventImpl(
	at java.desktop/java.awt.Component.dispatchEvent(
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(
	at java.desktop/java.awt.EventQueue$
	at java.desktop/java.awt.EventQueue$
	at java.base/
	at java.base/$JavaSecurityAccessImpl.doIntersectionPrivilege(
	at java.base/$JavaSecurityAccessImpl.doIntersectionPrivilege(
	at java.desktop/java.awt.EventQueue$
	at java.desktop/java.awt.EventQueue$
	at java.base/
	at java.base/$JavaSecurityAccessImpl.doIntersectionPrivilege(
	at java.desktop/java.awt.EventQueue.dispatchEvent(
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(
	at java.desktop/

Attachments (0)

Change History (6)

comment:1 by gaben, 9 months ago

Thank you, reproduced.

comment:3 by taylor.smock, 9 months ago

The last release is r18789. Thank you for running the current latest (r18803).

@gaben: Are you working on this, or should I? Either way, I think I'll want to add a non-regression test for this.

comment:4 by gaben, 9 months ago

Please go ahead, I can do further JOSM related activities only sometime next week.

comment:5 by taylor.smock, 9 months ago

Resolution: fixed
Status: newclosed

In 18804/josm:

Fix #23116: Adding a member to a newly created relation will cause an NPE

This was caused by returning a null relation for a new relation.

comment:6 by taylor.smock, 9 months ago

Milestone: 23.08

Modify Ticket

Change Properties
Set your email in Preferences
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.