From 741384c532587cc786937415ab8fe574ab852b27 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 1 Jul 2014 23:22:14 +0200 Subject: [PATCH] Fix some quality flaws --- .../java/org/sonar/batch/scan/filesystem/LanguageDetection.java | 2 +- .../main/java/org/sonar/core/plugins/PluginClassloaders.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java index fbfedb537b5..1ee5379f579 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java @@ -66,7 +66,7 @@ class LanguageDetection { for (int i = 0; i < patterns.length; i++) { String suffix = patterns[i]; String extension = sanitizeExtension(suffix); - patterns[i] = "**/*." + extension; + patterns[i] = new StringBuilder().append("**/*.").append(extension).toString(); } PathPattern[] defaultLanguagePatterns = PathPattern.create(patterns); patternsByLanguage.put(language.key(), defaultLanguagePatterns); diff --git a/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java b/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java index d00f8242c95..3565ee5639d 100644 --- a/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java +++ b/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java @@ -180,7 +180,7 @@ public class PluginClassloaders { String[] packagesToExport = new String[PREFIXES_TO_EXPORT.length]; for (int i = 0; i < PREFIXES_TO_EXPORT.length; i++) { // important to have dot at the end of package name only for classworlds 1.1 - packagesToExport[i] = PREFIXES_TO_EXPORT[i] + realm.getId() + ".api"; + packagesToExport[i] = String.format("%s%s.api", PREFIXES_TO_EXPORT[i], realm.getId()); } export(realm, packagesToExport); } -- 2.39.5