summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-07-02 15:15:53 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-07-02 16:14:34 +0200
commit2e2c1fbdc5f17b9d8577c7582139d7427c398589 (patch)
tree2607a48e326e295b90e84e8411d206d48820f090
parent2f948758eebec934beb54701792cf2d558319251 (diff)
downloadsonarqube-2e2c1fbdc5f17b9d8577c7582139d7427c398589.tar.gz
sonarqube-2e2c1fbdc5f17b9d8577c7582139d7427c398589.zip
SONAR-6628 fix warning log displaying value, security hole
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/DroppedPropertyChecker.java5
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/DroppedPropertyCheckerTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java6
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java2
4 files changed, 6 insertions, 9 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DroppedPropertyChecker.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DroppedPropertyChecker.java
index 7b34ddcc935..b12903f670e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DroppedPropertyChecker.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DroppedPropertyChecker.java
@@ -40,10 +40,7 @@ public class DroppedPropertyChecker {
public void checkDroppedProperties() {
for (Map.Entry<String, String> entry : properties.entrySet()) {
if (settings.hasKey(entry.getKey())) {
- logger.warn(
- "Property '{}' (which value is '{}') is not supported any more. {}",
- entry.getKey(), settings.getString(entry.getKey()), entry.getValue()
- );
+ logger.warn("Property '{}' is not supported any more. {}", entry.getKey(), entry.getValue());
}
}
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/DroppedPropertyCheckerTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/DroppedPropertyCheckerTest.java
index 258bfe4939a..6b83260d5c9 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/DroppedPropertyCheckerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/DroppedPropertyCheckerTest.java
@@ -61,7 +61,7 @@ public class DroppedPropertyCheckerTest {
new DroppedPropertyChecker(settings, ImmutableMap.of(DROPPED_PROPERTY_1, DROPPED_PROPERTY_MSG_1)).checkDroppedProperties();
assertThat(logTester.logs(LoggerLevel.ERROR)).isEmpty();
- assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly("Property '" + DROPPED_PROPERTY_1 + "' (which value is '" + SOME_VALUE +"') is not supported any more. " + DROPPED_PROPERTY_MSG_1);
+ assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly("Property '" + DROPPED_PROPERTY_1 + "' is not supported any more. " + DROPPED_PROPERTY_MSG_1);
assertThat(logTester.logs(LoggerLevel.INFO)).isEmpty();
assertThat(logTester.logs(LoggerLevel.DEBUG)).isEmpty();
assertThat(logTester.logs(LoggerLevel.TRACE)).isEmpty();
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java
index cdbbe32401b..18f205ad772 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java
@@ -70,9 +70,9 @@ public class GlobalSettingsTest {
new GlobalSettings(bootstrapProps, new PropertyDefinitions(), globalRef, mode);
assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly(
- "Property 'sonar.jdbc.url' (which value is '" + SOME_VALUE + "') is not supported any more. There is no more DB connection to the SQ database. It will be ignored.",
- "Property 'sonar.jdbc.username' (which value is '" + SOME_VALUE + "') is not supported any more. There is no more DB connection to the SQ database. It will be ignored.",
- "Property 'sonar.jdbc.password' (which value is '" + SOME_VALUE + "') is not supported any more. There is no more DB connection to the SQ database. It will be ignored."
+ "Property 'sonar.jdbc.url' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.",
+ "Property 'sonar.jdbc.username' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.",
+ "Property 'sonar.jdbc.password' is not supported any more. There is no more DB connection to the SQ database. It will be ignored."
);
}
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java
index efadbc6a803..0970ede0908 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java
@@ -121,7 +121,7 @@ public class ProjectSettingsTest {
GlobalSettings settings = new GlobalSettings(new BootstrapProperties(ImmutableMap.of("sonar.qualitygate", "somevalue")), new PropertyDefinitions(), new GlobalRepositories(), mode);
new ProjectSettings(new ProjectReactor(project), settings, new PropertyDefinitions(), projectRef, mode);
- assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly("Property 'sonar.qualitygate' (which value is 'somevalue') is not supported any more. It will be ignored.");
+ assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly("Property 'sonar.qualitygate' is not supported any more. It will be ignored.");
}
}