﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
22198	Editor crashes after deleting node	jakob11@…	team	"==== What steps will reproduce the problem?
1. A multipoligon (e.g. a meadow) with multiple ""outer"" ways exists. 
2. One of theese ways consists of only two nodes (and one edge).
3. One node of this way is deleted (in my case by using the ""Improve Way Accurency"" -mode).
4. The dialogue ""Deleting 1 object: Please confirm to remove 1 object. 1 relation is affected."" opens and is confirmed by clicking ""Ok"".

==== What is the expected result?

* The node is deleted,
* the way is deleted (because there is no way consisting of a single node),
* the way is taken out of the relation.

==== What happens instead?

It just crashes (I could not use the editor anymore, it crashed over and over).

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-07-05 19:14:22 +0200 (Tue, 05 Jul 2022)
Revision:18511
Build-Date:2022-07-06 01:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18511 en) Linux Ubuntu 22.04 LTS
Memory Usage: 1698 MB / 3468 MB (563 MB allocated, but free)
Java version: 18-ea+36-Ubuntu-1, Private Build, OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Screen: :0.0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: en_US.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: KDE
Java ATK Wrapper package: libatk-wrapper-java:all-0.38.0-5build1
libcommons-compress-java: libcommons-compress-java:all-1.21-1
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:all-20201225-1build1
VM arguments: [--module-path=/usr/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djava.net.useSystemProxies=true, --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]
Dataset consistency test: No problems found

Last errors/warnings:
- 06792.841 W: JCS - Silent failure during download: https://maps4.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/17/45486/71366.jpeg
- 06793.138 W: JCS - Silent failure during download: https://maps3.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/17/45490/71365.jpeg
- 06795.678 W: JCS - Silent failure during download: https://maps4.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/17/45491/71366.jpeg
- 07928.916 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 08161.671 W: javax.net.ssl.SSLHandshakeException: Received fatal alert: unrecognized_name. Cause: javax.net.ssl.SSLHandshakeException: Received fatal alert: unrecognized_name
- 13512.546 W: java.net.UnknownHostException: api.openstreetmap.org
- 13512.550 E: java.net.UnknownHostException: api.openstreetmap.org
- 13512.552 W: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.UnknownHostException: api.openstreetmap.org
- 20374.805 E: Handled by bug report queue: java.lang.IllegalArgumentException: Illegal Capacity: -1
- 20374.892 E: Handled by bug report queue: java.lang.IllegalArgumentException: Illegal Capacity: -1



=== REPORTED CRASH DATA ===
sequence_information:
 - sequence_name: Sequence: Delete
 - sequence_command: Delete way ‎0‎ (0 nodes)‌
 - sequence_index: 1
 - sequence_commands: [org.openstreetmap.josm.command.ChangeMembersCommand;org.openstreetmap.josm.command.DeleteCommand]
 - sequence_commands_descriptions: [Change members of multipolygon (""meadow"", 14 members);Delete way ‎0‎ (0 nodes)‌]

BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (22) of main
java.lang.IllegalArgumentException: Illegal Capacity: -1
	at java.base/java.util.ArrayList.<init>(ArrayList.java:160)
	at org.openstreetmap.josm.data.osm.Way.getNodePairs(Way.java:160)
	at org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyHelper.findCandidateNode(ImproveWayAccuracyHelper.java:74)
	at org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyAction.updateCursorDependentObjectsIfNeeded(ImproveWayAccuracyAction.java:593)
	at org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyAction.primitivesRemoved(ImproveWayAccuracyAction.java:681)
	at org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent.fire(PrimitivesRemovedEvent.java:34)
	at org.openstreetmap.josm.data.osm.event.DatasetEventManager.fireEvents(DatasetEventManager.java:201)
	at org.openstreetmap.josm.data.osm.event.DatasetEventManager.processDatasetEvent(DatasetEventManager.java:217)
	at org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter.primitivesRemoved(DataSetListenerAdapter.java:51)
	at org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent.fire(PrimitivesRemovedEvent.java:34)
	at org.openstreetmap.josm.data.osm.DataSet.fireEventToListeners(DataSet.java:1046)
	at org.openstreetmap.josm.data.osm.DataSet.endUpdate(DataSet.java:977)
	at org.openstreetmap.josm.data.osm.DataSet.update(DataSet.java:1005)
	at org.openstreetmap.josm.command.DeleteCommand.executeCommand(DeleteCommand.java:207)
	at org.openstreetmap.josm.command.SequenceCommand.executeCommand(SequenceCommand.java:112)
	at org.openstreetmap.josm.data.UndoRedoHandler.addNoRedraw(UndoRedoHandler.java:300)
	at org.openstreetmap.josm.data.UndoRedoHandler.add(UndoRedoHandler.java:354)
	at org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyAction.mouseReleased(ImproveWayAccuracyAction.java:491)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6616)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3398)
	at java.desktop/java.awt.Component.processEvent(Component.java:6381)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4991)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4823)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4823)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
}}}
"	defect	closed	normal	22.07	Core		fixed	template_report	
