From 88816d6506972e505245763d0494807187e0dcc6 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 23 Sep 2014 12:13:36 +0200 Subject: [PATCH] Fix quality flaw --- .../src/main/java/org/sonar/process/ProcessCommands.java | 8 +++----- 1 file 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)); } } } -- 2.39.5