Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13464 closed defect (fixed)

Fast draw plugin does not enter map mode.

Reported by: michael2402 Owned by: akks
Priority: critical Milestone:
Component: Plugin FastDraw Version:
Keywords: template_report regression gsoc-core Cc: mcheck, danielnepomuceno@…, eladner

Description

What steps will reproduce the problem?

  1. Cannot reproduce

Fix

Somehow I triggered this line in enterMapMode

if (!isEnabled()) return;

The whole state is inconsistent afterwards. This line should be removed.

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

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-08-25 23:21:10 +0200 (Thu, 25 Aug 2016)
Build-Date:2016-08-26 01:33:11
Revision:10899
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10899 de) Linux Ubuntu 12.04.5 LTS
Memory Usage: 418 MB / 857 MB (263 MB allocated, but free)
Java version: 1.8.0_25-b17, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Dataset consistency test: No problems found

Plugins:
+ FastDraw (32773)
+ HouseNumberTaggingTool (32699)
+ OpeningHoursEditor (32699)
+ buildings_tools (32796)
+ graphview (32796)
+ josm-plugin-opengl (1440156917)
+ reltoolbox (32796)
+ turnrestrictions (32796)

Map paint styles:
- https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lit&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/AddressValidator&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Landcover&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/TreeCrownDiameter&zip=1

Last errors/warnings:
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet


=== REPORTED CRASH DATA ===
BugReport#intercept:
No data collected.

Warning issued by: ReportedException#warn

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (17) of main
java.lang.IllegalArgumentException: Listener org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode@7406d2c8 (instance of org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode) was not registered before or already removed.
	at org.openstreetmap.josm.tools.ListenerList.failRemove(ListenerList.java:129)
	at org.openstreetmap.josm.tools.ListenerList$TracingListenerList.failRemove(ListenerList.java:206)
	at org.openstreetmap.josm.tools.ListenerList.removeListener(ListenerList.java:123)
	at org.openstreetmap.josm.tools.ListenerList$TracingListenerList.removeListener(ListenerList.java:190)
	at org.openstreetmap.josm.data.Preferences.removePreferenceChangeListener(Preferences.java:240)
	at org.openstreetmap.josm.actions.mapmode.MapMode.exitMode(MapMode.java:78)
	at org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.exitMode(FastDrawingMode.java:119)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:450)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:432)
	at org.openstreetmap.josm.gui.MapFrame.selectSelectTool(MapFrame.java:305)
	at org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.saveAsWay(FastDrawingMode.java:606)
	at org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.doKeyPressed(FastDrawingMode.java:439)
	at org.openstreetmap.josm.gui.util.AdvancedKeyPressDetector.processKeyEvent(AdvancedKeyPressDetector.java:128)
	at org.openstreetmap.josm.gui.util.AdvancedKeyPressDetector.eventDispatched(AdvancedKeyPressDetector.java:168)
	at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2425)
	at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2317)
	at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2316)
	at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2275)
	at java.awt.Component.dispatchEventImpl(Component.java:4777)
	at java.awt.Container.dispatchEventImpl(Container.java:2292)
	at java.awt.Component.dispatchEvent(Component.java:4703)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
	at java.awt.Component.dispatchEventImpl(Component.java:4752)
	at java.awt.Container.dispatchEventImpl(Container.java:2292)
	at java.awt.Window.dispatchEventImpl(Window.java:2739)
	at java.awt.Component.dispatchEvent(Component.java:4703)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
	at java.awt.EventQueue.access$400(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:697)
	at java.awt.EventQueue$3.run(EventQueue.java:691)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:719)
	at java.awt.EventQueue$4.run(EventQueue.java:717)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	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)

Attachments (1)

fix-13464.patch (870 bytes) - added by michael2402 3 years ago.
Fix fast drawing: It should not call exitMode().

Download all attachments as: .zip

Change History (36)

comment:1 Changed 3 years ago by michael2402

Component: CorePlugin FastDraw
Owner: changed from team to akks
Summary: Fehler inFast draw plugin does not enter map mode.

comment:2 Changed 3 years ago by Klumbumbus

similar reports: #13532, #13539

comment:3 Changed 3 years ago by naoliv

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

comment:4 Changed 3 years ago by naoliv

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

comment:5 Changed 3 years ago by naoliv

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

comment:6 Changed 3 years ago by Don-vip

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

comment:7 Changed 3 years ago by Don-vip

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

comment:8 Changed 3 years ago by Don-vip

Priority: normalcritical

comment:9 Changed 3 years ago by Don-vip

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

comment:10 Changed 3 years ago by Don-vip

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

comment:11 Changed 3 years ago by Don-vip

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

comment:12 Changed 3 years ago by Don-vip

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

comment:13 Changed 3 years ago by Don-vip

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

comment:14 Changed 3 years ago by Don-vip

Keywords: regression gsoc-core added

comment:15 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

Fixed in [o32929:32931].

comment:16 Changed 3 years ago by Klumbumbus

Cc: mcheck danielnepomuceno@… eladner added

comment:17 Changed 3 years ago by eladner

Tested after fix. Still fails in the same way.

comment:18 Changed 3 years ago by Don-vip

Resolution: fixed
Status: closedreopened

Right:

Build-Date:2016-09-07 00:39:11
Revision:10971
Is-Local-Build:true

Identification: JOSM/1.5 (10971 SVN fr) Windows 10 64-Bit
Memory Usage: 556 MB / 3634 MB (262 MB allocated, but free)
Java version: 1.8.0_102-b14, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080, \Display1 1920x1080, \Display2 1280x1024
Maximum Screen Size: 1920x1080
VM arguments: [-Dfile.encoding=UTF-8]
Program arguments: [--debug]
Dataset consistency test: No problems found

Plugins:
+ FastDraw (32930)


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (19) of main
java.lang.IllegalArgumentException: Listener org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode@5c0d5558 (instance of org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode) was not registered before or already removed.
	at org.openstreetmap.josm.tools.ListenerList.failRemove(ListenerList.java:128)
	at org.openstreetmap.josm.tools.ListenerList$TracingListenerList.failRemove(ListenerList.java:206)
	at org.openstreetmap.josm.tools.ListenerList.removeListener(ListenerList.java:123)
	at org.openstreetmap.josm.tools.ListenerList$TracingListenerList.removeListener(ListenerList.java:190)
	at org.openstreetmap.josm.data.Preferences.removePreferenceChangeListener(Preferences.java:238)
	at org.openstreetmap.josm.actions.mapmode.MapMode.exitMode(MapMode.java:78)
	at org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.exitMode(FastDrawingMode.java:118)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:450)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:432)
	at org.openstreetmap.josm.gui.MapFrame.selectSelectTool(MapFrame.java:305)
	at org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.doKeyPressed(FastDrawingMode.java:470)
	at org.openstreetmap.josm.gui.util.AdvancedKeyPressDetector.processKeyEvent(AdvancedKeyPressDetector.java:128)
	at org.openstreetmap.josm.gui.util.AdvancedKeyPressDetector.eventDispatched(AdvancedKeyPressDetector.java:168)
	at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2425)
	at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2317)
	at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2316)
	at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2275)
	at java.awt.Component.dispatchEventImpl(Component.java:4785)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
	at java.awt.Component.dispatchEventImpl(Component.java:4760)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	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:76)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	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)

Michael, can you please help me to fix this one?

comment:19 Changed 3 years ago by michael2402

Seems I never used it far enough to hit RETURN twice ;-) (and I stopped searching after the first possible error I found).

This is where the listener is removed first (Use --trace to enable this tracing):

AM FEINSTEN: org.openstreetmap.josm.tools.ListenerList$TracingListenerList.removeListener line 192
AM FEINSTEN: org.openstreetmap.josm.data.Preferences.removePreferenceChangeListener line 238
AM FEINSTEN: org.openstreetmap.josm.actions.mapmode.MapMode.exitMode line 78
AM FEINSTEN: org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.exitMode line 119
AM FEINSTEN: org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.saveAsWay line 604
AM FEINSTEN: org.openstreetmap.josm.plugins.fastdraw.FastDrawingMode.doKeyPressed line 439
AM FEINSTEN: org.openstreetmap.josm.gui.util.AdvancedKeyPressDetector.processKeyEvent line 128
AM FEINSTEN: org.openstreetmap.josm.gui.util.AdvancedKeyPressDetector.eventDispatched line 168
AM FEINSTEN: java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched line 2425
AM FEINSTEN: java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched line 2317

The problem seems that saveAsWay calls exitMode. This is then called in Main.map.selectSelectTool once again. The first exitMode should be removed (I'll have to check for side effects...)

I can try testing a fix and creating a patch tomorrow.

One note: You can add a .cached() to the ColorPropertys. It won't change much in this situation, but it makes drawing much faster when you do a get() in a loop.

Changed 3 years ago by michael2402

Attachment: fix-13464.patch added

Fix fast drawing: It should not call exitMode().

comment:20 Changed 3 years ago by michael2402

I found two places where exitMode was called. The plugin works fine without them.

comment:21 Changed 3 years ago by eladner

I don't think the exitMode call is the problem -- it needs to unregister its own listeners that were registered in enterMode, right? It's complaining that it's trying to remove a PreferenceChangeListener that doesn't exist (even though the super.enterMode() to the MapMode class should have registered it).

If I recall, this error has been occurring for maybe a week. I haven't been able to trace back changes to all the related files (my Trac foo isn't that strong).

Possibly expand the search to related classes like Preferences and ListenerList?

comment:22 Changed 3 years ago by michael2402

The problem is the exitMode call (at least that one problem - there may be more). You should never call it yourself, this method is called by the mode change logic of MapFrame.

The checks to enforce this have been added with the preference updates. See #13309, [10824]

Last edited 3 years ago by michael2402 (previous) (diff)

comment:23 Changed 3 years ago by eladner

Understand, but the FastDraw code's previous change was 5 months ago and I know it's worked since then.

Other possibilities in related recent changes, if that doesn't pan out:

Preference.java

ListenerList.java

comment:24 Changed 3 years ago by eladner

Ah, ok. I just caught the note about enforcement in [10824]. Ignore the extra info...

comment:25 Changed 3 years ago by skyper

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

comment:26 Changed 3 years ago by Klumbumbus

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

comment:27 Changed 3 years ago by Klumbumbus

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

comment:28 Changed 3 years ago by Klumbumbus

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

comment:29 Changed 3 years ago by Klumbumbus

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

comment:30 Changed 3 years ago by Klumbumbus

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

comment:31 Changed 3 years ago by Don-vip

Resolution: fixed
Status: reopenedclosed

Fixed in [o32938:32939].

Last edited 3 years ago by Don-vip (previous) (diff)

comment:32 Changed 3 years ago by Klumbumbus

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

comment:33 Changed 3 years ago by Don-vip

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

comment:34 Changed 3 years ago by Don-vip

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

comment:35 Changed 3 years ago by skyper

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain akks.
as The resolution will be set.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.