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);
}
*/
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;
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);
lock.unlock();
}
-
public Measure getMeasure(Resource resource, Metric metric) {
Bucket bucket = buckets.get(resource);
if (bucket != null) {
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);
}
}
-
/**
* Does nothing if the resource is already registered.
*/
return getChildren(resource, false);
}
-
public List<Resource> getChildren(Resource resource, boolean acceptExcluded) {
List<Resource> children = Lists.newLinkedList();
Bucket bucket = getBucket(resource, acceptExcluded);
return bucket;
}
-
public boolean isExcluded(Resource reference) {
Bucket bucket = getBucket(reference, true);
return bucket != null && bucket.isExcluded();