diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-12-09 15:22:08 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-12-09 15:22:08 +0100 |
commit | 7bb6fe7a2ec9451f2507464a830066ef1870e1a5 (patch) | |
tree | fc45556768497989a0a4ddc5753010ea8d705956 | |
parent | 1a48cf905ef021016f5df4d70a2838348911e6ee (diff) | |
download | sonarqube-7bb6fe7a2ec9451f2507464a830066ef1870e1a5.tar.gz sonarqube-7bb6fe7a2ec9451f2507464a830066ef1870e1a5.zip |
Fix some quality flaws
4 files changed, 6 insertions, 10 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultPersistenceManager.java b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultPersistenceManager.java index 79a09a7d6f4..8e36e703b28 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultPersistenceManager.java +++ b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultPersistenceManager.java @@ -34,15 +34,13 @@ import java.util.List; public final class DefaultPersistenceManager implements PersistenceManager { private ResourcePersister resourcePersister; - private SourcePersister sourcePersister; private DependencyPersister dependencyPersister; private LinkPersister linkPersister; private EventPersister eventPersister; - public DefaultPersistenceManager(ResourcePersister resourcePersister, SourcePersister sourcePersister, + public DefaultPersistenceManager(ResourcePersister resourcePersister, DependencyPersister dependencyPersister, LinkPersister linkPersister, EventPersister eventPersister) { this.resourcePersister = resourcePersister; - this.sourcePersister = sourcePersister; this.dependencyPersister = dependencyPersister; this.linkPersister = linkPersister; this.eventPersister = eventPersister; diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java index 4e424011f28..e78ae260ca3 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileIndexer.java @@ -59,22 +59,20 @@ public class FileIndexer implements BatchComponent { private static final IOFileFilter FILE_FILTER = HiddenFileFilter.VISIBLE; private final List<InputFileFilter> filters; - private final InputPathCache fileCache; private final boolean isAggregator; private final ExclusionFilters exclusionFilters; private final InputFileBuilderFactory inputFileBuilderFactory; public FileIndexer(List<InputFileFilter> filters, ExclusionFilters exclusionFilters, InputFileBuilderFactory inputFileBuilderFactory, - InputPathCache cache, ProjectDefinition def) { - this(filters, exclusionFilters, inputFileBuilderFactory, cache, !def.getSubProjects().isEmpty()); + ProjectDefinition def) { + this(filters, exclusionFilters, inputFileBuilderFactory, !def.getSubProjects().isEmpty()); } private FileIndexer(List<InputFileFilter> filters, ExclusionFilters exclusionFilters, InputFileBuilderFactory inputFileBuilderFactory, - InputPathCache cache, boolean isAggregator) { + boolean isAggregator) { this.filters = filters; this.exclusionFilters = exclusionFilters; this.inputFileBuilderFactory = inputFileBuilderFactory; - this.fileCache = cache; this.isAggregator = isAggregator; } diff --git a/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java b/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java index 555057d4d14..8aafb847386 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java +++ b/sonar-batch/src/main/java/org/sonar/batch/source/DefaultSymbolTable.java @@ -77,7 +77,7 @@ public class DefaultSymbolTable implements Symbolizable.SymbolTable { throw new UnsupportedOperationException("Cannot add reference to a symbol in another file"); } if (fromOffset >= symbol.getDeclarationStartOffset() && fromOffset < symbol.getDeclarationEndOffset()) { - throw new UnsupportedOperationException("Cannot add reference (" + fromOffset + ") overlapping " + symbol); + throw new UnsupportedOperationException("Cannot add reference (" + fromOffset + ") overlapping " + symbol + " in " + componentKey); } referencesBySymbol.get(symbol).add(fromOffset); } diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java index 9c2c9aaca43..23ad3689cf6 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java @@ -230,7 +230,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { when(projectTree.getProjectDefinition(moduleB)).thenReturn(ProjectDefinition.create().setBaseDir(new java.io.File(baseDir, "moduleB"))); when(projectTree.getProjectDefinition(moduleB1)).thenReturn(ProjectDefinition.create().setBaseDir(new java.io.File(baseDir, "moduleB/moduleB1"))); - PersistenceManager persistenceManager = new DefaultPersistenceManager(persister, null, null, null, null); + PersistenceManager persistenceManager = new DefaultPersistenceManager(persister, null, null, null); DefaultIndex index = new DefaultIndex(persistenceManager, projectTree, mock(MetricFinder.class), mock(ScanGraph.class), mock(DeprecatedViolations.class), mock(ResourceKeyMigration.class), mock(MeasureCache.class)); |