diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2013-10-21 15:23:54 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2013-10-21 15:23:54 +0200 |
commit | 6079ef842ee0ac3d9f86f2dad3784dc9cb92ac5e (patch) | |
tree | fc337d05b26afd32e38b2edfa7e307b0fd7ec81d /sonar-plugin-api | |
parent | 0d8f6d214dbada7cb8f8be037c26d6a411a11572 (diff) | |
download | sonarqube-6079ef842ee0ac3d9f86f2dad3784dc9cb92ac5e.tar.gz sonarqube-6079ef842ee0ac3d9f86f2dad3784dc9cb92ac5e.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java index 80665d76374..8fc9dd52f7b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/DefaultTempFolder.java @@ -27,6 +27,7 @@ import javax.annotation.Nullable; import java.io.File; import java.io.IOException; +import java.text.MessageFormat; public class DefaultTempFolder implements TempFolder { @@ -56,9 +57,8 @@ public class DefaultTempFolder implements TempFolder { return tempDir; } } - throw new IllegalStateException("Failed to create directory within " - + TEMP_DIR_ATTEMPTS + " attempts (tried " - + baseName + "0 to " + baseName + (TEMP_DIR_ATTEMPTS - 1) + ')'); + throw new IllegalStateException(MessageFormat.format("Failed to create directory within {0} attempts (tried {1} to {2})", TEMP_DIR_ATTEMPTS, baseName + 0, baseName + + (TEMP_DIR_ATTEMPTS - 1))); } @Override @@ -98,9 +98,8 @@ public class DefaultTempFolder implements TempFolder { } catch (IOException e) { throw new IllegalStateException("Failed to create temp file", e); } - throw new IllegalStateException("Failed to create temp file within " - + TEMP_DIR_ATTEMPTS + " attempts (tried " - + baseName + "0" + suffix + " to " + baseName + (TEMP_DIR_ATTEMPTS - 1) + suffix + ")"); + throw new IllegalStateException(MessageFormat.format("Failed to create temp file within {0} attempts (tried {1} to {2})", TEMP_DIR_ATTEMPTS, baseName + 0 + suffix, baseName + + (TEMP_DIR_ATTEMPTS - 1) + suffix)); } public void clean() { |