On Thu, 25 Jul 2024 14:43:27 GMT, Alexey Ushakov <[email protected]> wrote:
>> Trivial fix to move the screencast token storage file from
>> `~/.awt/robot/screencast-tokens.properties` to
>> `~/.java/robot/screencast-tokens.properties`, where it should be.
>> Old location is still valid and will only be used if there is a file in the
>> old location and the new location does not have it.
>>
>> Along with the fix `@SuppressWarnings("removal")` is moved to individual
>> items as it was done in [JFX](https://github.com/openjdk/jfx/pull/1490).
>
> src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java line 113:
>
>> 111: Path secondaryPath = Path.of(userHome, REL_NAME_SECONDARY);
>> 112:
>> 113: Path path = Files.isWritable(secondaryPath) &&
>> !Files.isWritable(primaryPath)
>
> isWritable() returns false for both paths if it's the very first run with a
> particular home directory.
Sure, then it chooses the primary path and creates the missing directories as
expected.
The idea is to use the secondary path for compatibility reasons only if it
exists and the primary path doesn't.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20234#discussion_r1691686470