diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-12-08 11:50:52 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-12-08 11:50:52 +0100 |
commit | c9863df6828342adab79de3b26553a932c308518 (patch) | |
tree | 20088546089a7d525d473f32303e5624f39d4233 | |
parent | 28b853b9fe5c87ebd5ca3abc59ce8c4ebec28044 (diff) | |
download | sonarqube-c9863df6828342adab79de3b26553a932c308518.tar.gz sonarqube-c9863df6828342adab79de3b26553a932c308518.zip |
Fix some quality flaws
4 files changed, 9 insertions, 8 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java index 884e298bd68..da4059eeb0d 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java @@ -82,8 +82,11 @@ public class IssueTracking implements BatchExtension { // If each new issue matches an old one we can stop the matching mechanism if (result.matched().size() != newIssues.size()) { - if (sourceHashHolder != null && sourceHashHolder.getHashedReference() != null && hasLastScan) { - mapNewissues(sourceHashHolder.getHashedReference(), sourceHashHolder.getHashedSource(), newIssues, result); + if (sourceHashHolder != null && hasLastScan) { + FileHashes hashedReference = sourceHashHolder.getHashedReference(); + if (hashedReference != null) { + mapNewissues(hashedReference, sourceHashHolder.getHashedSource(), newIssues, result); + } } mapIssuesOnSameRule(newIssues, result); } diff --git a/sonar-batch/src/main/java/org/sonar/batch/maven/MavenProjectConverter.java b/sonar-batch/src/main/java/org/sonar/batch/maven/MavenProjectConverter.java index 2ef3fe6fa54..6109b645421 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/maven/MavenProjectConverter.java +++ b/sonar-batch/src/main/java/org/sonar/batch/maven/MavenProjectConverter.java @@ -40,6 +40,7 @@ import org.sonar.batch.scan.filesystem.DefaultModuleFileSystem; import org.sonar.java.api.JavaUtils; import javax.annotation.Nullable; + import java.io.File; import java.io.IOException; import java.util.Arrays; @@ -190,7 +191,7 @@ public class MavenProjectConverter implements TaskExtension { } private static void setPropertyIfNotAlreadyExists(ProjectDefinition definition, String propertyKey, String propertyValue) { - if (StringUtils.isBlank(definition.getProperties().getProperty(propertyKey))) { + if (StringUtils.isBlank(definition.properties().get(propertyKey))) { definition.setProperty(propertyKey, StringUtils.defaultString(propertyValue)); } } diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java index c2749ba0099..72218e95ce3 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java @@ -55,7 +55,7 @@ public class ProjectSettings extends Settings { addProperties(projectReferentials.settings(reactor.getRoot().getKeyWithBranch())); - addProperties(reactor.getRoot().getProperties()); + addProperties(reactor.getRoot().properties()); } @Override diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java index e527f649b7b..4822a4a89aa 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java @@ -86,10 +86,6 @@ public class ProjectDefinition { private List<ProjectDefinition> subProjects = Lists.newArrayList(); private List<Object> containerExtensions = Lists.newArrayList(); - private ProjectDefinition(Map<String, String> p) { - this.properties = p; - } - private ProjectDefinition(Properties p) { for (Entry<Object, Object> entry : p.entrySet()) { this.properties.put(entry.getKey().toString(), entry.getValue().toString()); @@ -162,6 +158,7 @@ public class ProjectDefinition { * @since 2.12 * @deprecated since 5.0 use {@link #setProperties(Map)} */ + @Deprecated public ProjectDefinition setProperties(Properties properties) { for (Entry<Object, Object> entry : properties.entrySet()) { this.properties.put(entry.getKey().toString(), entry.getValue().toString()); |