aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-23 12:13:36 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-23 12:13:36 +0200
commit88816d6506972e505245763d0494807187e0dcc6 (patch)
tree3699e41bdfddb2b33f83eeef161025b9d6452fc8
parent54ba59001aee817ee4420d137ae5ae2beba13bc4 (diff)
downloadsonarqube-88816d6506972e505245763d0494807187e0dcc6.tar.gz
sonarqube-88816d6506972e505245763d0494807187e0dcc6.zip
Fix quality flaw
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java8
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));
}
}
}