RFR: 8307536: FileAlreadyExistsException from NativeLibLoader when running concurrent applications with empty cache

Jose Pereda jpereda at openjdk.org
Tue Aug 1 11:28:49 UTC 2023


On Tue, 1 Aug 2023 09:31:15 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java line 312:
>> 
>>> 310:                 try {
>>> 311:                     if (!Files.exists(path)) {
>>> 312:                         Files.copy(is, path);
>> 
>> I noticed `is` is not closed (also in the original code).
>> Would that be a problem?
>
> Probably something to evaluate, but in a separate ticket

I agree, this should probably be considered as well, as part of a separate ticket. 

Note that, when the file already exists in the cache, the initial InputStream object is used by the DigestInputStream, and it is manually closed and reread again, so special care should be taken here.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1188#discussion_r1280488134


More information about the openjfx-dev mailing list