Modify

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#18495 closed defect (fixed)

NPE at JoinAreasAction.joinOrientedWays

Reported by: anonymous Owned by: team
Priority: normal Milestone: 19.12
Component: Core Version: latest
Keywords: template_report regression Cc: GerdP

Description

What steps will reproduce the problem?

  1. Try to merge an relation object with an non relation object

What is the expected result?

What happens instead?

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: 2019-12-31 14:25:24 +0100 (Tue, 31 Dec 2019)
Build-Date:2019-12-31 13:27:22
Revision:15625
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15625 de) Windows 10 64-Bit
OS Build number: Windows 10 Home 1909 (18363)
Memory Usage: 360 MB / 989 MB (60 MB allocated, but free)
Java version: 1.8.0_231-b11, Oracle Corporation, Java HotSpot(TM) Client VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
Dataset consistency test: No problems found

Plugins:
+ Mapillary (1.5.20)
+ apache-commons (35092)
+ apache-http (35092)
+ buildings_tools (35248)
+ jna (35092)
+ log4j (35092)
+ print (35248)
+ routing (35248)
+ terracer (35248)
+ utilsplugin2 (35248)
+ wikipedia (1.1.3)

Last errors/warnings:
- W: Cannot lock cache directory. Will not use disk cache
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: Cannot start IPv4 remotecontrol server on port 8111: Address already in use: JVM_Bind
- W: Cannot start IPv6 remotecontrol server on port 8111: Address already in use: JVM_Bind
- 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 (15) of main
java.lang.NullPointerException
	at org.openstreetmap.josm.actions.JoinAreasAction.joinOrientedWays(JoinAreasAction.java:1349)
	at org.openstreetmap.josm.actions.JoinAreasAction.joinWays(JoinAreasAction.java:1312)
	at org.openstreetmap.josm.actions.JoinAreasAction.joinPolygon(JoinAreasAction.java:1283)
	at org.openstreetmap.josm.actions.JoinAreasAction.joinAreas(JoinAreasAction.java:676)
	at org.openstreetmap.josm.actions.JoinAreasAction.join(JoinAreasAction.java:540)
	at org.openstreetmap.josm.actions.JoinAreasAction.actionPerformed(JoinAreasAction.java:475)
	at javax.swing.SwingUtilities.notifyAction(Unknown Source)
	at javax.swing.JComponent.processKeyBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
	at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
	at javax.swing.JComponent.processKeyBindings(Unknown Source)
	at javax.swing.JComponent.processKeyEvent(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.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(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)

sample-18495.osm (119.0 KB) - added by GerdP 3 months ago.
18495.patch (3.6 KB) - added by GerdP 3 months ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 3 months ago by Don-vip

Summary: Try to merge an relation with an non relation objectNPE at JoinAreasAction.joinOrientedWays

comment:2 Changed 3 months ago by Don-vip

Cc: GerdP added
Milestone: 20.01

regression of #18385 + #18367 + #18083 ?

comment:3 Changed 3 months ago by GerdP

Yes, the code in JoinAreasAction.joinOrientedWays()doesn't handle the case that CombineWayAction.combineWaysWorker() can return null. No idea why this did not show up before.
Anyway, the change in #18083 is probably too agressive. I see no problem when a way is combined to another way if only some nodes are outside the download area. I'll open a new ticket for that.

Last edited 3 months ago by GerdP (previous) (diff)

comment:4 Changed 3 months ago by GerdP

In 15627/josm:

see #18495: Handle the case that CombineWayAction.combineWaysWorker() returns null

comment:5 Changed 3 months ago by GerdP

@anonymous: If you can reproduce the problem please save the data to a file and attach it to this ticket.

Changed 3 months ago by GerdP

Attachment: sample-18495.osm added

comment:6 Changed 3 months ago by GerdP

OK, found an example. Load attached file and try to join the two buildings (way 110514326 and way 82770881)
A popup asks for confirmation because nodes are outside of the download area. When you click the Yes button the error occurs.

comment:7 Changed 3 months ago by stoecker

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

Changed 3 months ago by GerdP

Attachment: 18495.patch added

comment:8 Changed 3 months ago by GerdP

The attached patch reverts the changes made in r15617. I've implemented a new parameter for
CombineWayAction.combineWaysWorker() which is set to false by default. If set to true, a check is performed to find old nodes outside the download area which were used for combining.
For JoinAreas the test is not performed and thus it is less likely to get a null from this method.
This is more or less a dirty hack, but it should fix this ticket and also work good enough for #18501.
Got a flu since Christmas and cannot concentrate well, so please review.
Another option would be to just revert r15617 or to invest more time into null handling in JoinAreasAction.

comment:9 Changed 3 months ago by skyper

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

comment:10 in reply to:  8 Changed 3 months ago by skyper

Replying to GerdP:

Got a flu since Christmas

Oh dear, what a pity. All the best!

comment:11 Changed 3 months ago by Klumbumbus

Will we need a stable release hotfix for the NPE or is it rather seldom? (Just asking because if we make a hotfix then I wait with my next commits.)

comment:12 Changed 3 months ago by Don-vip

Yes I will release an hotfix asap. Hold your fire!

comment:13 Changed 3 months ago by GerdP

Resolution: fixed
Status: newclosed

In 15628/josm:

fix #18501 and #18495 : revert changes from r15617

comment:14 Changed 3 months ago by skyper

Keywords: regression added

comment:15 Changed 3 months ago by Klumbumbus

Milestone: 20.0119.12

comment:16 in reply to:  5 Changed 3 months ago by anonymous

Replying to GerdP:

@anonymous: If you can reproduce the problem please save the data to a file and attach it to this ticket.

I saw the message too late, but the new release is working fine

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.