aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-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));
}
}
}