Modify

Opened 3 years ago

Closed 3 years ago

#13209 closed defect (fixed)

photoadjust plugin error: "Attempted to remove listener that was not in list"

Reported by: bartosomail@… Owned by: holgermappt
Priority: normal Milestone:
Component: Plugin photoadjust Version: latest
Keywords: template_report gsoc-core regression Cc: michael2402

Description

What steps will reproduce the problem?

  1. Have photoadjust plugin installed
  2. Create a new data layer
  3. Create a geotagged images layer
  4. Select the "Move and position photos" button
  5. Select the "Draw nodes" button
  6. Reselect the "Move and position photos" button
  7. Select the "Select, move, scale and rotate objects" button

What is the expected result?

no error

What happens instead?

error

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-07-24 00:19:35 +0200 (Sun, 24 Jul 2016)
Build-Date:2016-07-24 01:39:57
Revision:10619
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10619 en) Windows 7 64-Bit
Memory Usage: 178 MB / 989 MB (73 MB allocated, but free)
Java version: 1.8.0_101-b13, Oracle Corporation, Java HotSpot(TM) Client VM
Dataset consistency test: No problems found

Plugins:
- ImportImagePlugin (32584)
- Mapillary (32639)
- OpeningHoursEditor (32583)
- PicLayer (32495)
- SimplifyArea (32517)
- TombPlugin (46)
- apache-commons (32584)
- apache-http (32584)
- buildings_tools (32639)
- download_along (32535)
- editgpx (32485)
- ejml (32639)
- geotools (32584)
- gpxfilter (32546)
- jts (32539)
- log4j (32309)
- measurement (32454)
- merge-overlap (32471)
- photo_geotagging (32392)
- photoadjust (32584)
- public_transport (32639)
- reltoolbox (32639)
- reverter (32584)
- tag2link (32326)
- terracer (32426)
- undelete (32584)
- utilsplugin2 (32584)
- waydownloader (32584)
- wikipedia (32671)

Tagging presets:
- http://osm.sebastian-klemm.eu/josm/josm-preset_parkinglane.xml
- http://somewhere.dk/email/josm/source.xml
- http://somewhere.dk/email/josm/tower/tower.xml
- https://josm.openstreetmap.de/josmfile?page=Presets/BicycleJunction&preset&zip=1
- https://josm.openstreetmap.de/josmfile?page=Presets/Crafts&preset&zip=1
- https://josm.openstreetmap.de/josmfile?page=Presets/Historic_Stone&zip=1
- https://josm.openstreetmap.de/josmfile?page=Presets/Mountains&zip=1
- https://josm.openstreetmap.de/josmfile?page=Presets/NewParkingFeatures&preset&zip=1
- https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1
- https://josm.openstreetmap.de/josmfile?page=Presets/hiking_routes_with_trail_marking&preset&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/AddressValidator&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/DestinationSignRelation&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/MaxspeedIcons&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/NewParkingFeatures&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&style&zip=1

Last errors/warnings:
- E: java.lang.IllegalArgumentException: Attempted to remove listener that was not in list: org.openstreetmap.josm.plugins.photoadjust.PhotoAdjustMapMode@14443b1

java.lang.IllegalArgumentException: Attempted to remove listener that was not in list: org.openstreetmap.josm.plugins.photoadjust.PhotoAdjustMapMode@14443b1
	at org.openstreetmap.josm.gui.layer.MainLayerManager.removeActiveLayerChangeListener(MainLayerManager.java:196)
	at org.openstreetmap.josm.plugins.photoadjust.PhotoAdjustMapMode.exitMode(PhotoAdjustMapMode.java:147)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:434)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:416)
	at org.openstreetmap.josm.actions.mapmode.MapMode.actionPerformed(MapMode.java:99)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

Attachments (0)

Change History (6)

comment:1 Changed 3 years ago by Don-vip

Cc: michael2402 added
Keywords: gsoc-core regression added

comment:2 Changed 3 years ago by michael2402

In PhotoAdjustMapMode, you the listeners are registered in the wrong place. This needs to be moved to enterMode

        Main.getLayerManager().addLayerChangeListener(this);
        Main.getLayerManager().addActiveLayerChangeListener(this);

But by the way the listeners work, I think that they should stay registered for all time to update the button state.

comment:3 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

Fixed in [o32712:32714].

comment:4 Changed 3 years ago by holgermappt

Why were the layer change listeners moved from the constructor to enterMode()? The idea of the layer change listeners is to enable the map mode button if there are images and to disable it if there are no images. That doesn't work if the layer change listeners are active only if the map mode is active. The listeners must be active all the time.

comment:5 Changed 3 years ago by Don-vip

Resolution: fixed
Status: closedreopened

comment:6 Changed 3 years ago by holgermappt

Resolution: fixed
Status: reopenedclosed

I moved the layer change listeners back to the map mode constructor and destroy. Please let me know if there is something wrong with that. [o32863]

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain holgermappt.
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.