diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-23 12:13:36 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-23 12:13:36 +0200 |
commit | 88816d6506972e505245763d0494807187e0dcc6 (patch) | |
tree | 3699e41bdfddb2b33f83eeef161025b9d6452fc8 /server | |
parent | 54ba59001aee817ee4420d137ae5ae2beba13bc4 (diff) | |
download | sonarqube-88816d6506972e505245763d0494807187e0dcc6.tar.gz sonarqube-88816d6506972e505245763d0494807187e0dcc6.zip |
Fix quality flaw
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java index 417d62cb5bf..d79f0f92899 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java @@ -107,11 +107,9 @@ public class ProcessCommands { } private void deleteFile(File file) { - if (file.exists()) { - if (!file.delete()) { - throw new MessageException(String.format( - "Fail to delete file %s. Please check that no SonarQube process is alive", file)); - } + if (file.exists() && !file.delete()) { + throw new MessageException(String.format( + "Fail to delete file %s. Please check that no SonarQube process is alive", file)); } } } |