diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-02-21 10:23:17 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-02-21 10:26:36 +0400 |
commit | 23a25219854d57d811735745104655b81d102a82 (patch) | |
tree | 50fee6132eac180d3b114f81d021fb6d7c78f6d1 /plugins/sonar-cpd-plugin | |
parent | 22dfc24e49896cfa4c77e11a0e60e67c21f6db33 (diff) | |
download | sonarqube-23a25219854d57d811735745104655b81d102a82.tar.gz sonarqube-23a25219854d57d811735745104655b81d102a82.zip |
Fix some quality flaws
Diffstat (limited to 'plugins/sonar-cpd-plugin')
5 files changed, 11 insertions, 9 deletions
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdAnalyser.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdAnalyser.java index 2b67db65921..25bf47f6247 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdAnalyser.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdAnalyser.java @@ -92,7 +92,7 @@ public class CpdAnalyser { DuplicationsData data = fileContainer.get(file); if (data == null) { String resourceKey = SonarEngine.getFullKey(project, file); - data = new DuplicationsData(resourceKey, context); + data = new DuplicationsData(resourceKey); fileContainer.put(file, data); } return data; diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DuplicationsData.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DuplicationsData.java index 754b9678568..259993eda33 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DuplicationsData.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DuplicationsData.java @@ -39,7 +39,7 @@ public class DuplicationsData { private double duplicatedBlocks; - public DuplicationsData(String resourceKey, SensorContext context) { + public DuplicationsData(String resourceKey) { this.resourceKey = resourceKey; } diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java index cd53e73f14e..afdd56837d0 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java @@ -41,7 +41,8 @@ public class SonarBridgeEngine extends CpdEngine { private final CpdMapping[] mappings; public SonarBridgeEngine(IndexFactory indexFactory) { - this(indexFactory, null); + this.indexFactory = indexFactory; + this.mappings = null; } public SonarBridgeEngine(IndexFactory indexFactory, CpdMapping[] mappings) { diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/IndexFactory.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/IndexFactory.java index ba5ca082512..033e359ec00 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/IndexFactory.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/IndexFactory.java @@ -42,7 +42,9 @@ public class IndexFactory implements BatchExtension { * For dry run, where is no access to database. */ public IndexFactory(Settings settings) { - this(settings, null, null); + this.settings = settings; + this.resourcePersister = null; + this.dao = null; } public IndexFactory(Settings settings, ResourcePersister resourcePersister, DuplicationDao dao) { diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/SonarDuplicationsIndex.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/SonarDuplicationsIndex.java index a35891ef97c..568aeb82dfe 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/SonarDuplicationsIndex.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/SonarDuplicationsIndex.java @@ -19,9 +19,7 @@ */ package org.sonar.plugins.cpd.index; -import java.util.Collection; -import java.util.List; - +import com.google.common.collect.Lists; import org.sonar.api.resources.Resource; import org.sonar.duplications.block.Block; import org.sonar.duplications.block.ByteArray; @@ -29,7 +27,8 @@ import org.sonar.duplications.index.AbstractCloneIndex; import org.sonar.duplications.index.CloneIndex; import org.sonar.duplications.index.PackedMemoryCloneIndex; -import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.List; public class SonarDuplicationsIndex extends AbstractCloneIndex { @@ -37,7 +36,7 @@ public class SonarDuplicationsIndex extends AbstractCloneIndex { private final DbDuplicationsIndex db; public SonarDuplicationsIndex() { - this(null); + this.db = null; } public SonarDuplicationsIndex(DbDuplicationsIndex db) { |