Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: UnsupportedOperationException #4585

Closed
Azhrei opened this issue Dec 27, 2023 · 1 comment · Fixed by #4589
Closed

[Bug]: UnsupportedOperationException #4585

Azhrei opened this issue Dec 27, 2023 · 1 comment · Fixed by #4589
Assignees
Labels

Comments

@Azhrei
Copy link
Member

Azhrei commented Dec 27, 2023

Describe the Bug

Tried to clear all drawings via the Edit > Clear Drawings... menu option and received the exception. None of the drawings were cleared (that I could tell — there were a lot of them).

To Reproduce

  1. Create a new campaign
  2. Create some drawings on the default Grasslands map
  3. Use Edit > Clear Drawings... and watch the fireworks
  4. ???
  5. Profit!

Expected Behaviour

Drawings are cleared without an exception.

Screenshots

java.lang.UnsupportedOperationException
	at java.base/java.util.Collections$UnmodifiableCollection.clear(Collections.java:1110)
	at net.rptools.maptool.model.Zone.clearDrawables(Zone.java:1499)
	at net.rptools.maptool.client.ClientMessageHandler.lambda$handle$54(ClientMessageHandler.java:971)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	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:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:54)
	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.pumpEventsForFilter(EventDispatchThread.java:117)
	at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
	at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
	at java.desktop/java.awt.Dialog.show(Dialog.java:1079)
	at java.desktop/java.awt.Component.show(Component.java:1728)
	at java.desktop/java.awt.Component.setVisible(Component.java:1675)
	at java.desktop/java.awt.Window.setVisible(Window.java:1036)
	at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1015)
	at net.rptools.maptool.client.swing.MapToolEventQueue.displayPopup(MapToolEventQueue.java:111)
	at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:73)
	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)

MapTool Info

nightly-20231227, built from source on Apple Silicon (M3 Max)

Desktop

macOS Sonoma 14.2.1 (fully updated as of now)

Additional Context

Executed using ./gradlew run. Based on the log.txt, it appears that the server thread displayed the same message with a slightly different code path. The relevant pieces are included below.

(Building the jpackage worked, but I decided I didn't want the package installed as it would've been v0.0.1.)

java.lang.UnsupportedOperationException: null
        at java.base/java.util.Collections$UnmodifiableCollection.clear(Collections.java:1110) ~[?:?]
        at net.rptools.maptool.model.Zone.clearDrawables(Zone.java:1499) ~[main/:?]
        at net.rptools.maptool.server.ServerMessageHandler.lambda$handle$33(ServerMessageHandler.java:654) ~[main/:?]
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) ~[?:?]
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) ~[?:?]
        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:400) ~[?:?]
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?]
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) ~[?:?]
        at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:54) [main/:?]
@Azhrei Azhrei added the bug label Dec 27, 2023
@kwvanderlinde
Copy link
Collaborator

I think this is my fault. Will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants