Modify

Opened 15 months ago

Last modified 4 weeks ago

#7465 new defect

[Patch] NullPointerException in WayConnectedToArea due to Way w/ 0 nodes

Reported by: anonymous Owned by: team
Priority: normal Component: Core validator
Version: Keywords:
Cc: scorp1988, neopolis

Description (last modified by simon04)

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-01-30 02:32:23
Last Changed Author: stoecker
Revision: 4878
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-01-30 00:02:54 +0100 (Mon, 30 Jan 2012)
Last Changed Rev: 4878

Identification: JOSM/1.5 (4878 de)
Memory Usage: 137 MB / 494 MB (31 MB allocated, but free)
Java version: 1.7.0, Oracle Corporation, Java HotSpot(TM) Client VM
Operating system: Windows 7

Dataset consistency test:
[WARN - ZERO NODES] Way {Way id=152739257 version=2 MVT nodes=[]} has zero nodes
[WARN - ZERO NODES] Way {Way id=110239757 version=10 MVT nodes=[]} has zero nodes



java.lang.NullPointerException
	at org.openstreetmap.josm.data.validation.tests.WayConnectedToArea.visit(WayConnectedToArea.java:27)
	at org.openstreetmap.josm.data.osm.Way.visit(Way.java:187)
	at org.openstreetmap.josm.data.validation.Test.visit(Test.java:139)
	at org.openstreetmap.josm.actions.upload.ValidateUploadHook.checkUpload(ValidateUploadHook.java:60)
	at org.openstreetmap.josm.actions.UploadAction.checkPreUploadConditions(UploadAction.java:137)
	at org.openstreetmap.josm.actions.UploadAction.checkPreUploadConditions(UploadAction.java:103)
	at org.openstreetmap.josm.gui.io.SaveLayersDialog$SaveAndUploadTask.uploadLayers(SaveLayersDialog.java:417)
	at org.openstreetmap.josm.gui.io.SaveLayersDialog$SaveAndUploadTask.run(SaveLayersDialog.java:521)
	at java.lang.Thread.run(Unknown Source)

Attachments (1)

7465.patch (768 bytes) - added by simon04 15 months ago.

Download all attachments as: .zip

Change History (22)

Changed 15 months ago by simon04

comment:1 Changed 15 months ago by simon04

IMHO it makes sense to skip all validation tests for ways with 0 or 1 nodes as those objects shouldn't be there anyway and presumably also other tests may be broken (cf. #7437). See attached patch.

What do you think?

comment:2 Changed 15 months ago by simon04

  • Component changed from Core to Core validator
  • Description modified (diff)
  • Summary changed from Fehler to [Patch] NullPointerException in WayConnectedToArea due to Way w/ 0 nodes

comment:3 follow-ups: Changed 15 months ago by akks

I tried to make the same for #7437 in [5012], but does not know if it was helpful. But there was no bad consequences :)

Last edited 15 months ago by akks (previous) (diff)

comment:4 in reply to: ↑ 3 Changed 15 months ago by skyper

Replying to akks:

I tried to make the same for #7437 in [5012], but does not know if it was helpful. But there was no bad consequences :)

I think we should rather find the reason for these zero node ways than implementing work arounds for every occasion where these ways cause problems !

  1. We definitly have a problem with objects mentioned twice in the validator list.
  2. As the later problems with these zero node ways seem to have a different source. As I have seen a similar strange exception last week merging layers I think the problem lies somewhere around downloading/merging/conflicts solution.

Sorry, had not time the other day to check and it was not reproducable right away.

comment:5 in reply to: ↑ 3 Changed 15 months ago by simon04

Replying to akks:

I tried to make the same for #7437 in [5012], but does not know if it was helpful. But there was no bad consequences :)

This patch tries to take a more general approach as I assume that many validation tests rely on ways having at least 2 nodes (i.e., getting consistent data). IMO it should not be the task of each individual validation test to check that the data is consistent.

comment:6 Changed 15 months ago by simon04

#5764 is (somehow) related.

comment:7 Changed 12 months ago by skyper

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

comment:8 Changed 12 months ago by simon04

I agree that the source of these inconsistent objects should be spotted eventually. However, for a less buggy JOSM, I suggest to apply the above patch …

comment:9 follow-up: Changed 10 months ago by mrwojo

Re the patch: I suggest moving the getNodesCount() check to a separate method that individual tests can override. UntaggedWay wants these 0-1 node ways.

comment:10 Changed 10 months ago by mrwojo

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

comment:11 in reply to: ↑ 9 Changed 10 months ago by bastiK

Replying to mrwojo:

Re the patch: I suggest moving the getNodesCount() check to a separate method that individual tests can override. UntaggedWay wants these 0-1 node ways.

Sounds reasonable.

comment:12 Changed 8 months ago by stoecker

Status of this?

comment:13 Changed 7 months ago by Don-vip

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

comment:14 Changed 7 months ago by Don-vip

  • Cc scorp1988 added

There's another test file in #8167, if needed.

comment:15 Changed 7 months ago by Don-vip

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

comment:16 Changed 3 months ago by Don-vip

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

comment:17 Changed 7 weeks ago by Don-vip

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

comment:18 Changed 7 weeks ago by Don-vip

  • Cc neopolis added

There's another test file in #8569, if needed.

Last edited 7 weeks ago by Don-vip (previous) (diff)

comment:19 Changed 7 weeks ago by rickmastfan67

Just a thought here, but #7986 and #8137 give a full-proof way to create 0-node ways. Sure, the crashes are in a slightly different place (2 lines off), but it's crashing in the same exact files. If they could be fixed, it might help fix this bug as well.

comment:20 Changed 7 weeks ago by Don-vip

Thanks, I have started to look into undelete plugin code, see [o29474].

comment:21 Changed 4 weeks ago by Don-vip

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team. Next status will be 'new'.
Next status will be 'needinfo'.The owner will change to anonymous
as duplicate The resolution will be set to duplicate. Next status will be 'closed'.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous. Next status will be 'assigned'.
Author


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

 
Note: See TracTickets for help on using tickets.