aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-02-22 21:29:33 +0300
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-02-22 21:29:33 +0300
commite0439d50c62daa7920839a8f8655c748fb664d6c (patch)
treefbc2df9761f9ed80fd7f60c982976c81510c7e7f /sonar-batch
parente84541a448f3ccda50078ec437ca693bdeb956c1 (diff)
downloadsonarqube-e0439d50c62daa7920839a8f8655c748fb664d6c.tar.gz
sonarqube-e0439d50c62daa7920839a8f8655c748fb664d6c.zip
Make DefaultIndex non-final and Module.getComponent public
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/Module.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java14
2 files changed, 7 insertions, 11 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/Module.java b/sonar-batch/src/main/java/org/sonar/batch/Module.java
index 73f4b2b0ed9..f4ee3279c2d 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/Module.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/Module.java
@@ -115,11 +115,11 @@ public abstract class Module {
container.addAdapter(componentAdapter);
}
- protected final <T> T getComponent(Class<T> componentType) {
+ public final <T> T getComponent(Class<T> componentType) {
return container.getComponent(componentType);
}
- protected final <T> List<T> getComponents(Class<T> componentType) {
+ public final <T> List<T> getComponents(Class<T> componentType) {
return container.getComponents(componentType);
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
index 09529e5c1b3..abafcdb150e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.index;
+import java.util.*;
+
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -41,9 +43,7 @@ import org.sonar.batch.ProjectTree;
import org.sonar.batch.ResourceFilters;
import org.sonar.batch.ViolationFilters;
-import java.util.*;
-
-public final class DefaultIndex extends SonarIndex {
+public class DefaultIndex extends SonarIndex {
private static final Logger LOG = LoggerFactory.getLogger(DefaultIndex.class);
@@ -133,7 +133,6 @@ public final class DefaultIndex extends SonarIndex {
lock.unlock();
}
-
public Measure getMeasure(Resource resource, Metric metric) {
Bucket bucket = buckets.get(resource);
if (bucket != null) {
@@ -294,10 +293,10 @@ public final class DefaultIndex extends SonarIndex {
Resource resource = violation.getResource();
if (resource == null) {
violation.setResource(currentProject);
- } else if (!Scopes.isHigherThanOrEquals(resource, Scopes.FILE)){
+ } else if (!Scopes.isHigherThanOrEquals(resource, Scopes.FILE)) {
throw new IllegalArgumentException("Violations are only supported on files, directories and project");
}
-
+
Bucket bucket = checkIndexed(resource);
if (bucket != null && !bucket.isExcluded()) {
boolean isIgnored = !force && violationFilters != null && violationFilters.isIgnored(violation);
@@ -371,7 +370,6 @@ public final class DefaultIndex extends SonarIndex {
}
}
-
/**
* Does nothing if the resource is already registered.
*/
@@ -411,7 +409,6 @@ public final class DefaultIndex extends SonarIndex {
return getChildren(resource, false);
}
-
public List<Resource> getChildren(Resource resource, boolean acceptExcluded) {
List<Resource> children = Lists.newLinkedList();
Bucket bucket = getBucket(resource, acceptExcluded);
@@ -507,7 +504,6 @@ public final class DefaultIndex extends SonarIndex {
return bucket;
}
-
public boolean isExcluded(Resource reference) {
Bucket bucket = getBucket(reference, true);
return bucket != null && bucket.isExcluded();