﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17569	building_tools crashes when drawing circular building near 180 longitude	GerdP	GerdP	"==== What steps will reproduce the problem?
1. Create new data layer
2. Press Alt+Z to ""set building shape to circle""
3. Move cursor somewere close to the 179.999 longitude and click left mouse button
4. Move cursor down so that the expected circle would cross the 180 longitude and click again

==== What is the expected result?
Warning message like ""Cannot add a node outside of the world.""
==== What happens instead?
Crash
==== Please provide any additional information below. Attach a screenshot if possible.
The crash happens only when the layer has no ways. If the layer has ways the above steps might change the address data of an existing building.
Reason is that the plugin uses the CreateCircleAction but doesn't verify if that action really added a new way.
{{{
Build-Date:2019-04-07 08:45:09
Revision:14965
Is-Local-Build:true

Identification: JOSM/1.5 (14965 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1803 (17134)
Memory Usage: 540 MB / 1753 MB (193 MB allocated, but free)
Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:53613, -Dfile.encoding=UTF-8]
Program arguments: [--debug]
Dataset consistency test: No problems found

Plugins:
+ FastDraw (34949)
+ OpeningHoursEditor (34867)
+ apache-commons (34506)
+ buildings_tools (34904)
+ continuosDownload (82)
+ ejml (34389)
+ geotools (34513)
+ jaxb (34678)
+ jts (34524)
+ o5m (34867)
+ opendata (34911)
+ pbf (34867)
+ poly (34867)
+ reltoolbox (34867)
+ reverter (34961)
+ undelete (34919)
+ utilsplugin2 (34932)

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: Region [TMS_BLOCK_v2] Resetting cache
- E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
- E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (20) of main
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at org.openstreetmap.josm.plugins.buildings_tools.Building.createCircle(Building.java:339)
	at org.openstreetmap.josm.plugins.buildings_tools.DrawBuildingAction.drawingFinish(DrawBuildingAction.java:323)
	at org.openstreetmap.josm.plugins.buildings_tools.DrawBuildingAction.drawingAdvance(DrawBuildingAction.java:312)
	at org.openstreetmap.josm.plugins.buildings_tools.DrawBuildingAction.mouseReleased(DrawBuildingAction.java:380)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
	at java.awt.Component.processMouseEvent(Component.java:6539)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
}}}
"	defect	closed	normal		Plugin buildings_tools		fixed	template_report	
