Skip to content

Commit 3e8d4e5

Browse files
Copilotslachiewicz
andcommitted
Address code review feedback - avoid redundant toPath() calls
Co-authored-by: slachiewicz <[email protected]>
1 parent f776e71 commit 3e8d4e5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ protected void extractFile(
331331

332332
if (!StringUtils.isEmpty(symlinkDestination)) {
333333
// Delete existing symlink if it exists
334-
if (Files.isSymbolicLink(targetFileName.toPath())) {
335-
Files.delete(targetFileName.toPath());
334+
Path symlinkPath = targetFileName.toPath();
335+
if (Files.isSymbolicLink(symlinkPath)) {
336+
Files.delete(symlinkPath);
336337
}
337338
SymlinkUtils.createSymbolicLink(targetFileName, new File(symlinkDestination));
338339
} else if (isDirectory) {

0 commit comments

Comments
 (0)