﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10584	NPE and strange behavior on fast mouse actions	mdk	team	"What steps will reproduce the problem?
There are two (I think related) problems. Both start with the same actions. I will describe it in a very special case, but the positions and directions are not relevant. The wrong behaviour is just better visible.
 1. Ensure current mode is ""select"" (press s)
 2. Grab the drawing canvas (press and hold right mouse button) near the lower right corner. (The mouse icon changes to a closed hand) 
 3. Now the complicated part: You have to do three things nearly at the same time:
 4. move FAST to the upper left corner
 5. while moving the mouse, zoom in with the mouse wheel (the middle mouse button)
 6. while you are zooming in AND moving the mouse FAST, release the right mouse button.

What is the expected result?
Canvas move and is zoomed in.

What happens instead?
Some times (I can reproduce the problem about one time in 10 tries) I got an NPE (see below).

There is a slightly modified variant:

 5. while moving the mouse, '''press the right mouse button, to select an area'''.
 6. while you are '''selecting an area''' AND moving the mouse FAST, release the right mouse button.
 7. stop moving the mouse and release right mouse button

What is the expected result?
Canvas move and afterwards an area is selected. When the right mouse button is released, the ""rubber band rectangle for selection disappears and the nodes inside the rectangle are selected.

What happens instead?
If you do it not fast enough, you will see only one white pixel which is the rubber band rectangle with width=0 and height=0 (I think). This pixel stay as long as you are not start a new selection (press the left mouse button) and is no longer related to the actual mouse position (normally the mouse pointer is one of the corners of the rectangle). If you are fast enough you see a real rectangle, which stays there independent from your mouse moves.

To reproduce the NPE is very hard, and I was not able to do this on a second machine. But I hope that fixing the similar problem with the selection, which is easily to reproduce, will also fix that problem or at least will help to understand the cause of the exception, which looks like a concurrency problem.



{{{
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-09-29 22:12:08
Last Changed Author: Don-vip
Revision: 7588
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-09-29 23:52:43 +0200 (Mon, 29 Sep 2014)
Last Changed Rev: 7588

Identification: JOSM/1.5 (7588 en) Linux Ubuntu 14.04.1 LTS
Memory Usage: 392 MB / 876 MB (251 MB allocated, but free)
Java version: 1.7.0_65, Oracle Corporation, OpenJDK Server VM
Java package: openjdk-7-jre:i386-7u65-2.5.2-3~14.04
VM arguments: [-Djosm.restart=true, -Djosm.home=/home/michael/.josm-latest, -Djava.net.useSystemProxies=true]
Dataset consistency test: No problems found

Plugins:
- ColumbusCSV (30416)
- FastDraw (30416)
- HouseNumberTaggingTool (30416)
- OpeningHoursEditor (30609)
- RoadSigns (30495)
- SimplifyArea (30624)
- buildings_tools (30485)
- contourmerge (1010)
- imagery_offset_db (30534)
- poly (30495)
- public_transport (30664)
- reltoolbox (30587)
- reverter (30521)
- terracer (30643)
- turnrestrictions (30651)
- utilsplugin2 (30460)

Last errors/warnings:
- W: java.lang.reflect.InvocationTargetException. Cause: java.lang.NullPointerException
- E: java.lang.NullPointerException

java.lang.NullPointerException
	at org.openstreetmap.josm.gui.MapMover.mouseDragged(MapMover.java:139)
	at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:320)
	at java.awt.Component.processMouseMotionEvent(Component.java:6564)
	at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3329)
	at java.awt.Component.processEvent(Component.java:6285)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4872)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4509)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:708)
	at java.awt.EventQueue$4.run(EventQueue.java:706)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

}}}
"	defect	closed	normal	14.10	Core	latest	fixed	template_report	
