From b2f15b50c6cf123765ca6c56c9bf5bffc451b771 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 9 Jan 2018 11:11:50 +0100 Subject: Clean-up unused code of ResourceTypes This class should be dropped as no plugins provide new types anymore. That was used only by the developer cockpit plugin, which is end of life. --- .../org/sonar/db/component/ResourceTypesRule.java | 49 ++-------------------- 1 file changed, 4 insertions(+), 45 deletions(-) (limited to 'server/sonar-db-dao/src') diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ResourceTypesRule.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ResourceTypesRule.java index 3d97f07dc0d..0e90f242421 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ResourceTypesRule.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ResourceTypesRule.java @@ -36,16 +36,15 @@ import static java.util.Collections.emptySet; public class ResourceTypesRule extends ResourceTypes { private Set allResourceTypes = emptySet(); private Set rootResourceTypes = emptySet(); - private List childrenQualifiers = emptyList(); private List leavesQualifiers = emptyList(); - @Override - public Collection getAll() { - return allResourceTypes; + public ResourceTypesRule() { + super(new ResourceTypeTree[0]); } + @Override - public Collection getAllOrdered() { + public Collection getAll() { return allResourceTypes; } @@ -69,11 +68,6 @@ public class ResourceTypesRule extends ResourceTypes { return this; } - public ResourceTypesRule setChildrenQualifiers(String... qualifiers) { - childrenQualifiers = ImmutableList.copyOf(qualifiers); - return this; - } - public ResourceTypesRule setAllQualifiers(String... qualifiers) { Set resourceTypes = new HashSet<>(); for (String qualifier : qualifiers) { @@ -91,43 +85,8 @@ public class ResourceTypesRule extends ResourceTypes { .findAny().orElse(null); } - @Override - public Collection getAllWithPropertyKey(String propertyKey) { - throw new UnsupportedOperationException(); - } - - @Override - public Collection getAllWithPropertyValue(String propertyKey, String propertyValue) { - throw new UnsupportedOperationException(); - } - - @Override - public Collection getAllWithPropertyValue(String propertyKey, boolean propertyValue) { - throw new UnsupportedOperationException(); - } - - @Override - public List getChildrenQualifiers(String qualifier) { - return this.childrenQualifiers; - } - - @Override - public List getChildren(String qualifier) { - throw new UnsupportedOperationException(); - } - @Override public List getLeavesQualifiers(String qualifier) { return this.leavesQualifiers; } - - @Override - public ResourceTypeTree getTree(String qualifier) { - throw new UnsupportedOperationException(); - } - - @Override - public ResourceType getRoot(String qualifier) { - throw new UnsupportedOperationException(); - } } -- cgit v1.2.3