From: Simon Brandhof Date: Tue, 23 Sep 2014 10:13:36 +0000 (+0200) Subject: Fix quality flaw X-Git-Tag: 4.5-RC3~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=88816d6506972e505245763d0494807187e0dcc6;p=sonarqube.git Fix quality flaw --- 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)); } } }