On Wed, 14 Sep 2022 09:42:37 GMT, Jie Fu <ji...@openjdk.org> wrote: > Hi all, > > runtime/Dictionary/ProtectionDomainCacheTest.java fails on Linux if `/tmp` is > a symbolic link directory. > The root cause is that `JarUtils.createJarFile` [1] will throw > `FileAlreadyExistsException` if `parent` is a symbolic directory. > So it seems better to test the existance of `parent` before creation. > > Testing: > - tier1~3 on Linux/x64 in progress, seems fine until now > > Thanks. > Best regards, > Jie > > > [1] > https://github.com/openjdk/jdk/blob/master/test/lib/jdk/test/lib/util/JarUtils.java#L72
Hello Jie, > The root cause is that `JarUtils.createJarFile` [1] will throw > `FileAlreadyExistsException` if `parent` is a symbolic directory. The JarUtils.createJarFile on that line uses: // create the target directory Path parent = jarfile.getParent(); if (parent != null) { Files.createDirectories(parent); } >From what I can see in the javadoc of `java.nio.file.Files.createDirectories`, >it doesn't state that it will throw this exception in case of symbolic links >(it actually doesn't talk about symbolic links). As per the API: * @throws FileAlreadyExistsException * if {@code dir} exists but is not a directory <i>(optional specific * exception)</i> So if it indeed is throwing a `FileAlreadyExistsException` then perhaps this API implementation needs a look at? I am not on a Linux system right now to test this, but would you be able to get the exact OS version and other details including the output of "ls -lh /tmp" to see what it is linked to? ------------- PR: https://git.openjdk.org/jdk/pull/10266