Modify

Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#22684 closed defect (fixed)

[patch] java.lang.IllegalArgumentException: Parameter 'en1' must not be null

Reported by: watmildon Owned by: team
Priority: normal Milestone: 23.02
Component: Core validator Version:
Keywords: template_report Cc: GerdP, gaben, taylor.smock, nkamapper

Description (last modified by skyper)

Exception during validation after revert of changeset 99626158 on node 589607453

What steps will reproduce the problem?

  1. Download the relation and elements for the node
  2. User reverter plugin to revert the position change making the lake all funky
  3. hit upload button

What is the expected result?

The upload dialog

What happens instead?

Exception

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

Revision:18622
Build-Date:2023-01-04 12:54:08

Identification: JOSM/1.5 (18622 en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19045)
Memory Usage: 1940 MB / 4088 MB (731 MB allocated, but free)
Java version: 17.0.5+8-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1440×2560 (scaling 1.00×1.00) \Display1 3840×2160 (scaling 1.50×1.50)
Maximum Screen Size: 3840×2560
Best cursor sizes: 16×16→48×48, 32×32→48×48
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.18622, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM.exe]
Dataset consistency test: No problems found

Plugins:
+ FastDraw (35978)
+ FixAddresses (36011)
+ apache-commons (36034)
+ apache-http (35924)
+ buildings_tools (36011)
+ conflation (0.6.9)
+ continuosDownload (105)
+ contourmerge (v0.1.9)
+ ejml (35924)
+ geotools (36028)
+ gridify (1606242219)
+ imagery_offset_db (35978)
+ jackson (36034)
+ jaxb (35952)
+ jna (36005)
+ jts (36004)
+ mapwithai (v1.10.3)
+ opendata (36025)
+ reverter (36043)
+ tageditor (36011)
+ terracer (35978)
+ todo (30306)
+ turnrestrictions (36011)
+ utilsplugin2 (36011)
+ wikipedia (605)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/TigerReviewedNo&zip=1
- %UserProfile%\Address Tags Validator - Highlight unaddressed
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/AddressValidator&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1

Last errors/warnings:
- 00000.449 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.451 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00002.828 E: java.security.KeyStoreException: Windows-ROOT not found. Cause: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
- 00020.440 E: Failed to locate image 'MapWithAI'
- 10693.778 E: Invalid setting (Icon missing): org.openstreetmap.josm.plugins.fixAddresses.FixAddressesPreferences
- 10874.217 E: Handled by bug report queue: java.lang.IllegalArgumentException: Parameter 'en1' must not be null



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (23) of main
java.lang.IllegalArgumentException: Parameter 'en1' must not be null
	at org.openstreetmap.josm.tools.CheckParameterUtil.ensureParameterNotNull(CheckParameterUtil.java:26)
	at org.openstreetmap.josm.data.validation.util.ValUtil.getSegmentCells(ValUtil.java:139)
	at org.openstreetmap.josm.data.validation.util.ValUtil.getSegmentCells(ValUtil.java:123)
	at org.openstreetmap.josm.data.validation.tests.CrossingWays.getSegments(CrossingWays.java:426)
	at org.openstreetmap.josm.data.validation.tests.PowerLines.addWaterWaySegments(PowerLines.java:133)
	at java.base/java.lang.Iterable.forEach(Unknown Source)
	at org.openstreetmap.josm.data.validation.tests.PowerLines.visit(PowerLines.java:142)
	at org.openstreetmap.josm.data.osm.Relation.accept(Relation.java:176)
	at org.openstreetmap.josm.data.validation.Test.visit(Test.java:216)
	at org.openstreetmap.josm.actions.upload.ValidateUploadHook.checkUpload(ValidateUploadHook.java:66)
	at org.openstreetmap.josm.actions.UploadAction.lambda$checkPreUploadConditions$0(UploadAction.java:221)
	at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
	at java.base/java.util.LinkedList$LLSpliterator.tryAdvance(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.allMatch(Unknown Source)
	at org.openstreetmap.josm.actions.UploadAction.checkPreUploadConditions(UploadAction.java:221)
	at org.openstreetmap.josm.actions.UploadAction.uploadData(UploadAction.java:238)
	at org.openstreetmap.josm.actions.UploadAction.actionPerformed(UploadAction.java:303)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Attachments (1)

partialrevertexception.zip (5.1 MB ) - added by watmildon 2 years ago.
OSM file for the layer after the reverter plugin has run.

Change History (11)

by watmildon, 2 years ago

Attachment: partialrevertexception.zip added

OSM file for the layer after the reverter plugin has run.

comment:1 by skyper, 2 years ago

Something is strange with the data. In the file the node (n589607453) is part of several visible ways but only one is rendered. Funny though that the node is rendered bigger like a node with multiple parent ways.

comment:2 by skyper, 2 years ago

Cc: GerdP added

comment:3 by GerdP, 2 years ago

The file contains a lot of incomplete nodes. I think this is quite usual with the reverter plugin. It seems that the code in PowerLines.addWaterWaySegments() cannot handle them. That would be a regression of r18553.
Similar problem: When you search for one of the ways, e.g. id:46384535 (option all objects activated) and press Ctrl+I to show the information:

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-01-03 21:28:24 +0100 (Tue, 03 Jan 2023)
Revision:18622
Build-Date:2023-01-04 02:30:56
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18622 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19045)
Memory Usage: 1612 MB / 1972 MB (253 MB allocated, but free)
Java version: 17.0.4+8-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 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_DE
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.18531, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\HWConsole.exe]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (35924)
+ RoadSigns (36038)
+ apache-commons (36034)
+ buildings_tools (36011)
+ contourmerge (v0.1.9)
+ ejml (35924)
+ geotools (36028)
+ jackson (36034)
+ jaxb (35952)
+ jts (36004)
+ o5m (35893)
+ opendata (36025)
+ pbf (36034)
+ poly (35976)
+ reltoolbox (35976)
+ reverter (36043)
+ undelete (36011)
+ utilsplugin2 (36011)

Validator rules:
+ c:\josm\core\resources\data\validator\combinations.mapcss
+ c:\josm\core\resources\data\validator\geometry.mapcss
+ c:\josm\core\resources\data\validator\unnecessary.mapcss
+ d:\java_tools\JOSM\mygeometry.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1

Last errors/warnings:
- 00085.594 E: Failed to locate image 'Flag, Blue'
- 00085.595 E: Failed to locate image 'Flag, Blue'
- 00085.596 E: Failed to locate image 'Flag, Blue'
- 00085.596 E: Failed to locate image 'Flag, Blue'
- 00085.597 E: Failed to locate image 'Flag, Blue'
- 00085.598 E: Failed to locate image 'Flag, Blue'
- 00085.599 E: Failed to locate image 'Flag, Blue'
- 00223.346 E: Handled by bug report queue: java.lang.IllegalArgumentException: Parameter 'en1' must not be null
- 00291.146 E: Handled by bug report queue: java.lang.NullPointerException: Cannot read field "x" because "en2" is null
- 00530.854 E: Handled by bug report queue: java.lang.NullPointerException: Cannot read field "x" because "en2" is null



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (22) of main
java.lang.NullPointerException: Cannot read field "x" because "en2" is null
	at org.openstreetmap.josm.data.coor.EastNorth.interpolate(EastNorth.java:90)
	at org.openstreetmap.josm.data.coor.EastNorth.getCenter(EastNorth.java:101)
	at org.openstreetmap.josm.tools.Geometry.getCentroidEN(Geometry.java:956)
	at org.openstreetmap.josm.tools.Geometry.getCentroid(Geometry.java:941)
	at org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDataText.addSpecial(InspectPrimitiveDataText.java:176)
	at org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDataText.addPrimitive(InspectPrimitiveDataText.java:90)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.forEachOrdered(Unknown Source)
	at org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDialog.buildDataText(InspectPrimitiveDialog.java:114)
	at org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDialog.<init>(InspectPrimitiveDialog.java:75)
	at org.openstreetmap.josm.actions.InfoAction.actionPerformed(InfoAction.java:38)
	at java.desktop/javax.swing.SwingUtilities.notifyAction(Unknown Source)
	at java.desktop/javax.swing.JComponent.processKeyBinding(Unknown Source)
	at java.desktop/javax.swing.KeyboardManager.fireBinding(Unknown Source)
	at java.desktop/javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
	at java.desktop/javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
	at java.desktop/javax.swing.JComponent.processKeyBindings(Unknown Source)
	at java.desktop/javax.swing.JComponent.processKeyEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

comment:4 by skyper, 2 years ago

Cc: gaben added

comment:5 by gaben, 2 years ago

Cc: taylor.smock added
Summary: Exception during validation after revert of changeset 99626158 on node 589607453[patch] Exception during validation after revert of changeset 99626158 on node 589607453

Thanks for the heads up.

The InspectPrimitiveDialog issue that GerdP found is unrelated to r18553. I checked with r18551, which also reproduces.

A quick fix could be

  • src/org/openstreetmap/josm/data/validation/tests/PowerLines.java

     
    130130    private void addWaterWaySegments(Way w) {
    131131        for (int i = 0; i < w.getNodesCount() - 1; i++) {
    132132            final WaySegment es1 = new WaySegment(w, i);
    133             CrossingWays.getSegments(this.cellSegmentsWater, es1.getFirstNode(), es1.getSecondNode()).forEach(list -> list.add(es1));
     133            final Node first = es1.getFirstNode();
     134            final Node second = es1.getSecondNode();
     135
     136            if (first.isLatLonKnown() && second.isLatLonKnown())
     137                CrossingWays.getSegments(this.cellSegmentsWater, first, second).forEach(list -> list.add(es1));
    134138        }
    135139    }

What do you think?

Also not sure what the .forEach(list -> list.add(es1)) part does in the committed code. It is adding the way segments, sorry, misunderstood the code.

Anyway, running the tests to see if it breaks something, I'll update the comment with the result.

Last edited 2 years ago by gaben (previous) (diff)

comment:6 by taylor.smock, 2 years ago

I probably would have just done

  • src/org/openstreetmap/josm/data/validation/tests/PowerLines.java

    a b  
    139139        if (r.isMultipolygon() && isPowerStation(r)) {
    140140            powerStations.add(r);
    141141        } else if (concernsWaterArea(r)) {
    142             r.getMemberPrimitives(Way.class).forEach(this::addWaterWaySegments);
     142            r.getMemberPrimitives(Way.class).stream().filter(Way::isUsable).forEach(this::addWaterWaySegments);
    143143        }
    144144    }
    145145

instead, but your method allows a way to have some incomplete nodes, so it is probably better.

comment:7 by skyper, 2 years ago

Cc: nkamapper added
Component: CoreCore validator
Description: modified (diff)
Summary: [patch] Exception during validation after revert of changeset 99626158 on node 589607453[patch] java.lang.IllegalArgumentException: Parameter 'en1' must not be null

comment:8 by skyper, 2 years ago

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

comment:9 by taylor.smock, 23 months ago

Resolution: fixed
Status: newclosed

In 18675/josm:

Fix #22684: IAE: Parameter 'en1' must not be null in PowerLines.addWaterWaySegments (patch by gaben, modified)

PowerLines.addWaterWaySegments now only adds segments where all nodes have
position data.

This additionally fixes a similar issue caused by inspecting an incomplete
way in InspectPrimitiveDataText. In this case, the centroid is still
calculated, but does not account for how nodes without positional data
will affect the centroid.

comment:10 by skyper, 23 months ago

Milestone: 23.02

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.