mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
suppress sonarqube nio performance warning
This commit is contained in:
@@ -21,6 +21,7 @@ public final class CopyOnWrite {
|
|||||||
replaceOriginalFile(targetFile, temporaryFile);
|
replaceOriginalFile(targetFile, temporaryFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("squid:S3725") // performance of Files#isDirectory
|
||||||
private static void validateInput(Path targetFile) {
|
private static void validateInput(Path targetFile) {
|
||||||
if (Files.isDirectory(targetFile)) {
|
if (Files.isDirectory(targetFile)) {
|
||||||
throw new IllegalArgumentException("target file has to be a regular file, not a directory");
|
throw new IllegalArgumentException("target file has to be a regular file, not a directory");
|
||||||
@@ -36,7 +37,7 @@ public final class CopyOnWrite {
|
|||||||
Files.createFile(temporaryFile);
|
Files.createFile(temporaryFile);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LOG.error("Error creating temporary file {} to replace file {}", temporaryFile, targetFile);
|
LOG.error("Error creating temporary file {} to replace file {}", temporaryFile, targetFile);
|
||||||
throw new StoreException("could create temporary file", ex);
|
throw new StoreException("could not create temporary file", ex);
|
||||||
}
|
}
|
||||||
return temporaryFile;
|
return temporaryFile;
|
||||||
}
|
}
|
||||||
@@ -64,6 +65,7 @@ public final class CopyOnWrite {
|
|||||||
deleteBackupFile(backupFile);
|
deleteBackupFile(backupFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("squid:S3725") // performance of Files#exists
|
||||||
private static Path backupOriginalFile(Path targetFile) {
|
private static Path backupOriginalFile(Path targetFile) {
|
||||||
Path directory = targetFile.getParent();
|
Path directory = targetFile.getParent();
|
||||||
if (Files.exists(targetFile)) {
|
if (Files.exists(targetFile)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user