aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-05-28 11:02:50 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-05-28 11:02:58 +0200
commit1b771f631c4a73458583718d1fd8b3fcc61d5009 (patch)
treeae18ccd32a8ade5b0f38bc9f1338e4a4ba7fa398 /sonar-core
parenta28cb7974df365940292c7cf7a3e7e9171059508 (diff)
downloadsonarqube-1b771f631c4a73458583718d1fd8b3fcc61d5009.tar.gz
sonarqube-1b771f631c4a73458583718d1fd8b3fcc61d5009.zip
Fix definition of core component qualifiers
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/resource/DefaultResourceTypes.java11
-rw-r--r--sonar-core/src/test/java/org/sonar/core/resource/DefaultResourceTypesTest.java4
2 files changed, 7 insertions, 8 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/resource/DefaultResourceTypes.java b/sonar-core/src/main/java/org/sonar/core/resource/DefaultResourceTypes.java
index 76e88053609..fcd6ffdab73 100644
--- a/sonar-core/src/main/java/org/sonar/core/resource/DefaultResourceTypes.java
+++ b/sonar-core/src/main/java/org/sonar/core/resource/DefaultResourceTypes.java
@@ -19,9 +19,7 @@
*/
package org.sonar.core.resource;
-import org.sonar.api.ExtensionProvider;
import org.sonar.api.batch.BatchSide;
-import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.ResourceType;
import org.sonar.api.resources.ResourceTypeTree;
@@ -29,16 +27,17 @@ import org.sonar.api.server.ServerSide;
@BatchSide
@ServerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
-public final class DefaultResourceTypes extends ExtensionProvider {
+public final class DefaultResourceTypes {
private static final String SUPPORTS_MEASURE_FILTERS = "supportsMeasureFilters";
private static final String CONFIGURABLE = "configurable";
private static final String UPDATABLE_KEY = "updatable_key";
- @Override
- public ResourceTypeTree provide() {
+ private DefaultResourceTypes() {
+ // only static methods
+ }
+ public static ResourceTypeTree get() {
return ResourceTypeTree.builder()
.addType(ResourceType.builder(Qualifiers.PROJECT)
.setProperty("deletable", true)
diff --git a/sonar-core/src/test/java/org/sonar/core/resource/DefaultResourceTypesTest.java b/sonar-core/src/test/java/org/sonar/core/resource/DefaultResourceTypesTest.java
index ed418b96709..a09303ff2b9 100644
--- a/sonar-core/src/test/java/org/sonar/core/resource/DefaultResourceTypesTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/resource/DefaultResourceTypesTest.java
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DefaultResourceTypesTest {
@Test
public void provide_types() {
- ResourceTypeTree tree = new DefaultResourceTypes().provide();
+ ResourceTypeTree tree = DefaultResourceTypes.get();
assertThat(tree.getTypes()).hasSize(7);
assertThat(tree.getChildren(Qualifiers.PROJECT)).containsExactly(Qualifiers.MODULE);
@@ -37,7 +37,7 @@ public class DefaultResourceTypesTest {
@Test
public void projects_should_be_available_for_global_widgets() {
- ResourceTypeTree tree = new DefaultResourceTypes().provide();
+ ResourceTypeTree tree = DefaultResourceTypes.get();
ResourceType projectResourceType = tree.getTypes().get(0);