Change directory in GUI - corrupt path "cached"?

0 votes
asked May 8, 2025 in Question / help by anonymous

Hi,

Looks like I somewhen passed a wrong path the the gui - apparantely with a trailing space (?). Now.. I can pass a new folder per CLI argument, this works fine, loads the files and all, but each time I try to "Change Directory" from the UI I am getting:

Opening Directory Window 

Exception in thread "AWT-EventQueue-0" java.nio.file.InvalidPathException: Trailing char < > at index 56: e:\Projects\....<old corrupted path I want removed> at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191) ... at java.desktop/sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:262) ... at java.desktop/javax.swing.JFileChooser.setCurrentDirectory(JFileChooser.java:610) at net.sourceforge.plantuml.swing.MainWindow.displayDialogChangeDir(MainWindow.java:296)

So obviously the file extensions and the folder are cached / persisted somewhere... but WHERE? :)

This is on windows, java 18, plantuml-1.2025.2, staring with 

java  -DPLANTUML_LIMIT_SIZE=8192 -jar plantuml.jar -gui <folder

Thanks in advance and cheers,

L.

commented May 8, 2025 by anonymous

Update: maybe it would be better in MainWindow.displayDialogChangeDir not to fallback to prefs.get(KEY_DIR, ".") IF this has been already changed by arg? e.g. in getDirectory instead of

        if (arg != null && arg.exists() && arg.isDirectory()) {
            return arg;
        }
        return new File(prefs.get(KEY_DIR, "."));

do smth like:

        if (arg != null && arg.exists() && arg.isDirectory()) {
            prefs.put(KEY_DIR, arg.getAbsolutePath());
        }
        return new File(prefs.get(KEY_DIR, "."));

L.

commented May 8, 2025 by anonymous

Update 2: and of course the searched storage is

Computer\HKEY_CURRENT_USER\SOFTWARE\JavaSoft\Prefs\net\sourceforge\plantuml\swing\cur

Delete it and problem is gone.

:)

L.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...