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

FileUtils#find:103 - java.lang.IllegalArgumentException #12373

Closed
tripleabuilderbot opened this issue Feb 27, 2024 · 8 comments · Fixed by #12375
Closed

FileUtils#find:103 - java.lang.IllegalArgumentException #12373

tripleabuilderbot opened this issue Feb 27, 2024 · 8 comments · Fixed by #12375
Assignees
Labels
2.6 Error Report Issue reported via the in-game error reporter

Comments

@tripleabuilderbot
Copy link
Contributor

Log Message

/Users/johnkokinis/triplea/downloadedMaps/1941_global_command_decision

TripleA Version

2.6.14653

Java Version

11.0.19

Operating System

Mac OS X

Stack Trace

Exception: java.lang.IllegalArgumentException /Users/johnkokinis/triplea/downloadedMaps/1941_global_command_decision
java.lang.Exception
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:143)
	at org.triplea.io.FileUtils.find(FileUtils.java:103)
	at org.triplea.io.FileUtils.findClosestToRoot(FileUtils.java:89)
	at games.strategy.engine.framework.map.file.system.loader.InstalledMap.findContentRoot(InstalledMap.java:48)
	at java.base/java.util.Optional.flatMap(Optional.java:294)
	at games.strategy.engine.framework.map.file.system.loader.InstalledMapsListing.findContentRootForMapName(InstalledMapsListing.java:114)
	at games.strategy.engine.framework.map.file.system.loader.InstalledMapsListing.findMapFolderByName(InstalledMapsListing.java:126)
	at games.strategy.engine.framework.map.download.DownloadMapsWindowModel.getInstallLocation(DownloadMapsWindowModel.java:28)
	at games.strategy.engine.framework.map.download.DownloadMapsWindowModel.delete(DownloadMapsWindowModel.java:32)
	at games.strategy.engine.framework.map.download.FileSystemAccessStrategy.lambda$newRemoveMapAction$0(FileSystemAccessStrategy.java:37)
	at org.triplea.swing.SwingComponents.promptUser(SwingComponents.java:149)
	at games.strategy.engine.framework.map.download.FileSystemAccessStrategy.remove(FileSystemAccessStrategy.java:18)
	at games.strategy.engine.framework.map.download.DownloadMapsWindow.lambda$removeAction$13(DownloadMapsWindow.java:495)
	at org.triplea.swing.JButtonBuilder.lambda$actionListener$3(JButtonBuilder.java:131)
	at org.triplea.swing.JButtonBuilder.lambda$build$0(JButtonBuilder.java:54)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6400)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	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)


@tripleabuilderbot tripleabuilderbot added 2.6 Error Report Issue reported via the in-game error reporter labels Feb 27, 2024
@GunsGamesMonsters
Copy link

One of my friends posted this via his game - but he does not have an account and has no idea how to remove it.

@beelee1
Copy link
Contributor

beelee1 commented Feb 28, 2024

@beelee1 beelee1 closed this as completed Feb 28, 2024
@asvitkine
Copy link
Contributor

I'm actually not sure why we think this should be closed.
Seems like a legit issue?

This precondition is failing:

    Preconditions.checkArgument(Files.isDirectory(searchRoot), searchRoot.toAbsolutePath());

@asvitkine asvitkine reopened this Feb 29, 2024
@asvitkine asvitkine self-assigned this Feb 29, 2024
@asvitkine
Copy link
Contributor

I can reproduce this when removing maps from the download manager. I think it can happen if you hit the remove button twice in a row.

@asvitkine
Copy link
Contributor

Actually, I think somehow you can get it to remove all your maps (due to a bug of some sort) and after this happens, the list of maps still shows the maps, but they've been removed. Will investigate more...

@asvitkine
Copy link
Contributor

Looks like removing a map called "2020" actually results in the whole downloadedMaps directory being deleted! Eek.

@asvitkine
Copy link
Contributor

Seems like it will happen with any map where polygons.txt is at the root, instead of nested inside an inner 'map' folder.

asvitkine added a commit to asvitkine/triplea-1 that referenced this issue Feb 29, 2024
This would happen when removing a map where the content root isn't nested in a sub-dir, example "2020".
Fixes: triplea-game#12373
asvitkine added a commit that referenced this issue Feb 29, 2024
* Fix bug that could delete downloadedMaps folder.

This would happen when removing a map where the content root isn't nested in a sub-dir, example "2020".
Fixes: #12373

* Formatting.
@beelee1
Copy link
Contributor

beelee1 commented Mar 1, 2024

@asvitkine Oh my bad I thought he had it fixed. I'll refrain from closing anytihng in the future. On a side note, i had all of my maps delete but didn't know how to repro it so didn't say anything. glad you got it fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.6 Error Report Issue reported via the in-game error reporter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants