diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-09-02 17:23:16 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-09-02 17:23:16 +0200 |
commit | abb2e152f99285512a4d5281562c69338cd23efd (patch) | |
tree | dabc9e9040a7279d9096e500d2f3c24ecb11d5f0 /sonar-batch | |
parent | 00e0421d707e63ed043117ee6563a1395d76cdb6 (diff) | |
download | sonarqube-abb2e152f99285512a4d5281562c69338cd23efd.tar.gz sonarqube-abb2e152f99285512a4d5281562c69338cd23efd.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/DefaultDecoratorContext.java | 5 | ||||
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultDecoratorContext.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultDecoratorContext.java index 9613b62d94a..ada9ecacf7f 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/DefaultDecoratorContext.java +++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultDecoratorContext.java @@ -40,6 +40,7 @@ import org.sonar.api.violations.ViolationQuery; public class DefaultDecoratorContext implements DecoratorContext { + private static final String SAVE_MEASURE_METHOD = "saveMeasure"; private SonarIndex index; private Resource resource; private boolean readOnly = false; @@ -107,13 +108,13 @@ public class DefaultDecoratorContext implements DecoratorContext { } public DecoratorContext saveMeasure(Measure measure) { - checkReadOnly("saveMeasure"); + checkReadOnly(SAVE_MEASURE_METHOD); index.addMeasure(resource, measure); return this; } public DecoratorContext saveMeasure(Metric metric, Double value) { - checkReadOnly("saveMeasure"); + checkReadOnly(SAVE_MEASURE_METHOD); index.addMeasure(resource, new Measure(metric, value)); return this; } diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java index 4eca672f807..e8076a73bb9 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java @@ -44,7 +44,7 @@ public class DryRunDatabase implements BatchComponent { private static final String DRIVER = "org.h2.Driver"; private static final String URL = "jdbc:h2:"; private static final String USER = "sonar"; - private static final String PASSWORD = "sonar"; + private static final String PASSWORD = USER; private static final int DEFAULT_DRY_RUN_READ_TIMEOUT_SEC = 60; |