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

Jdk7Symlink does not delete the test symlink #8119

Closed
arsi-apli opened this issue Dec 26, 2018 · 4 comments
Closed

Jdk7Symlink does not delete the test symlink #8119

arsi-apli opened this issue Dec 26, 2018 · 4 comments
Labels

Comments

@arsi-apli
Copy link

In org.gradle.internal.nativeintegration.filesystem.jdk7.Jdk7Symlink.doesSystemSupportSymlinks() is an bug. The created test symbollink is not deleted.

} finally {
            try {
                if (sourceFile != null && sourceFile.toFile().exists()) {
                    Files.delete(sourceFile);
                }
                if (linkFile != null && linkFile.toFile().exists()) {
                    Files.delete(linkFile);
                }
            } catch (IOException e) {
                // We don't really need to handle this.
}

The expression linkFile.toFile().exists() is always false.
Please change that to:

if (linkFile != null ) {
      Files.deleteIfExists(linkFile);
 }
@marcphilipp
Copy link
Contributor

@arsi-apli Would you be interested in submitting a PR?

DreierF added a commit to DreierF/gradle that referenced this issue Jan 2, 2019
Signed-off-by: Florian Dreier <dreier.florian@gmail.com>
@marcphilipp
Copy link
Contributor

Hmm, looks like @DreierF is already working on it. 😉

@DreierF
Copy link
Contributor

DreierF commented Jan 2, 2019

Seemed related and small enough to fix it in the context of PR #8138 😉

@lacasseio
Copy link
Contributor

Fixing this issue in a separate PR: #8519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants