From 235d3e745d68bf549ce0c5353d76f936572f7c93 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Thu, 26 May 2011 08:33:18 +0200 Subject: SONAR-2469 fix typo in name of InstantiationStrategy class --- .../batch/bootstrap/BatchExtensionInstaller.java | 6 ++--- .../org/sonar/batch/bootstrap/ExtensionUtils.java | 6 ++--- .../batch/bootstrap/ProjectExtensionInstaller.java | 4 +-- .../bootstrap/BatchExtensionInstallerTest.java | 8 +++--- .../sonar/batch/bootstrap/ExtensionUtilsTest.java | 30 +++++++++++----------- 5 files changed, 27 insertions(+), 27 deletions(-) (limited to 'sonar-batch') diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchExtensionInstaller.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchExtensionInstaller.java index d111f444ec4..f176e1a81fc 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchExtensionInstaller.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchExtensionInstaller.java @@ -23,7 +23,7 @@ import org.sonar.api.BatchComponent; import org.sonar.api.ExtensionProvider; import org.sonar.api.Plugin; import org.sonar.api.batch.CoverageExtension; -import org.sonar.api.batch.InstanciationStrategy; +import org.sonar.api.batch.InstantiationStrategy; import org.sonar.batch.bootstrapper.EnvironmentInformation; import java.util.List; @@ -64,9 +64,9 @@ public final class BatchExtensionInstaller implements BatchComponent { void installExtension(Module module, Object extension) { if (ExtensionUtils.isBatchExtension(extension) && ExtensionUtils.isSupportedEnvironment(extension, environment) && - ExtensionUtils.isInstantiationStrategy(extension, InstanciationStrategy.PER_BATCH)) { + ExtensionUtils.isInstantiationStrategy(extension, InstantiationStrategy.PER_BATCH)) { if (ExtensionUtils.isType(extension, CoverageExtension.class)) { - throw new IllegalArgumentException("Instantiation strategy " + InstanciationStrategy.PER_BATCH + " is not supported on CoverageExtension components: " + extension); + throw new IllegalArgumentException("Instantiation strategy " + InstantiationStrategy.PER_BATCH + " is not supported on CoverageExtension components: " + extension); } module.addComponent(extension); } diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionUtils.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionUtils.java index 01a7c809eca..a7907b6b08e 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionUtils.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ExtensionUtils.java @@ -22,7 +22,7 @@ package org.sonar.batch.bootstrap; import org.apache.commons.lang.StringUtils; import org.sonar.api.BatchExtension; import org.sonar.api.Extension; -import org.sonar.api.batch.InstanciationStrategy; +import org.sonar.api.batch.InstantiationStrategy; import org.sonar.api.batch.SupportedEnvironment; import org.sonar.api.utils.AnnotationUtils; import org.sonar.batch.bootstrapper.EnvironmentInformation; @@ -35,11 +35,11 @@ public final class ExtensionUtils { static boolean isInstantiationStrategy(Object extension, String strategy) { Class clazz = (extension instanceof Class ? (Class) extension : extension.getClass()); - InstanciationStrategy extStrategy = AnnotationUtils.getClassAnnotation(clazz, InstanciationStrategy.class); + InstantiationStrategy extStrategy = AnnotationUtils.getClassAnnotation(clazz, InstantiationStrategy.class); if (extStrategy != null) { return strategy.equals(extStrategy.value()); } - return InstanciationStrategy.PER_PROJECT.equals(strategy); + return InstantiationStrategy.PER_PROJECT.equals(strategy); } static boolean isBatchExtension(Object extension) { diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectExtensionInstaller.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectExtensionInstaller.java index 4d3faea35c0..bfb924cf7b4 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectExtensionInstaller.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectExtensionInstaller.java @@ -26,7 +26,7 @@ import org.sonar.api.ExtensionProvider; import org.sonar.api.Plugin; import org.sonar.api.batch.AbstractCoverageExtension; import org.sonar.api.batch.CoverageExtension; -import org.sonar.api.batch.InstanciationStrategy; +import org.sonar.api.batch.InstantiationStrategy; import org.sonar.api.resources.Java; import org.sonar.api.resources.Project; import org.sonar.batch.bootstrapper.EnvironmentInformation; @@ -71,7 +71,7 @@ public final class ProjectExtensionInstaller implements BatchComponent { private Object installExtension(Module module, Object extension, Project project, String pluginKey) { if (ExtensionUtils.isBatchExtension(extension) && ExtensionUtils.isSupportedEnvironment(extension, environment) && - ExtensionUtils.isInstantiationStrategy(extension, InstanciationStrategy.PER_PROJECT) && + ExtensionUtils.isInstantiationStrategy(extension, InstantiationStrategy.PER_PROJECT) && !isDeactivatedCoverageExtension(extension, project, pluginKey)) { module.addComponent(extension); diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchExtensionInstallerTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchExtensionInstallerTest.java index fbd29a90545..4f81bd34294 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchExtensionInstallerTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchExtensionInstallerTest.java @@ -22,7 +22,7 @@ package org.sonar.batch.bootstrap; import org.junit.Test; import org.sonar.api.*; import org.sonar.api.batch.CoverageExtension; -import org.sonar.api.batch.InstanciationStrategy; +import org.sonar.api.batch.InstantiationStrategy; import org.sonar.batch.bootstrapper.EnvironmentInformation; import java.util.Arrays; @@ -93,7 +93,7 @@ public class BatchExtensionInstallerTest { } } - @InstanciationStrategy(InstanciationStrategy.PER_BATCH) + @InstantiationStrategy(InstantiationStrategy.PER_BATCH) public static class BatchService implements BatchExtension { } @@ -106,7 +106,7 @@ public class BatchExtensionInstallerTest { } - @InstanciationStrategy(InstanciationStrategy.PER_BATCH) + @InstantiationStrategy(InstantiationStrategy.PER_BATCH) public static class BatchServiceProvider extends ExtensionProvider implements BatchExtension { @Override @@ -122,7 +122,7 @@ public class BatchExtensionInstallerTest { } } - @InstanciationStrategy(InstanciationStrategy.PER_BATCH) + @InstantiationStrategy(InstantiationStrategy.PER_BATCH) public static class InvalidCoverageExtension implements CoverageExtension { // strategy PER_BATCH is not allowed } diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionUtilsTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionUtilsTest.java index b29fd6831f3..40d3e8c9225 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionUtilsTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionUtilsTest.java @@ -22,7 +22,7 @@ package org.sonar.batch.bootstrap; import org.junit.Test; import org.sonar.api.BatchExtension; import org.sonar.api.ServerExtension; -import org.sonar.api.batch.InstanciationStrategy; +import org.sonar.api.batch.InstantiationStrategy; import org.sonar.api.batch.SupportedEnvironment; import org.sonar.batch.bootstrapper.EnvironmentInformation; @@ -33,22 +33,22 @@ public class ExtensionUtilsTest { @Test public void shouldBeBatchInstantiationStrategy() { - assertThat(ExtensionUtils.isInstantiationStrategy(BatchService.class, InstanciationStrategy.PER_BATCH), is(true)); - assertThat(ExtensionUtils.isInstantiationStrategy(new BatchService(), InstanciationStrategy.PER_BATCH), is(true)); - assertThat(ExtensionUtils.isInstantiationStrategy(ProjectService.class, InstanciationStrategy.PER_BATCH), is(false)); - assertThat(ExtensionUtils.isInstantiationStrategy(new ProjectService(), InstanciationStrategy.PER_BATCH), is(false)); - assertThat(ExtensionUtils.isInstantiationStrategy(DefaultService.class, InstanciationStrategy.PER_BATCH), is(false)); - assertThat(ExtensionUtils.isInstantiationStrategy(new DefaultService(), InstanciationStrategy.PER_BATCH), is(false)); + assertThat(ExtensionUtils.isInstantiationStrategy(BatchService.class, InstantiationStrategy.PER_BATCH), is(true)); + assertThat(ExtensionUtils.isInstantiationStrategy(new BatchService(), InstantiationStrategy.PER_BATCH), is(true)); + assertThat(ExtensionUtils.isInstantiationStrategy(ProjectService.class, InstantiationStrategy.PER_BATCH), is(false)); + assertThat(ExtensionUtils.isInstantiationStrategy(new ProjectService(), InstantiationStrategy.PER_BATCH), is(false)); + assertThat(ExtensionUtils.isInstantiationStrategy(DefaultService.class, InstantiationStrategy.PER_BATCH), is(false)); + assertThat(ExtensionUtils.isInstantiationStrategy(new DefaultService(), InstantiationStrategy.PER_BATCH), is(false)); } @Test public void shouldBeProjectInstantiationStrategy() { - assertThat(ExtensionUtils.isInstantiationStrategy(BatchService.class, InstanciationStrategy.PER_PROJECT), is(false)); - assertThat(ExtensionUtils.isInstantiationStrategy(new BatchService(), InstanciationStrategy.PER_PROJECT), is(false)); - assertThat(ExtensionUtils.isInstantiationStrategy(ProjectService.class, InstanciationStrategy.PER_PROJECT), is(true)); - assertThat(ExtensionUtils.isInstantiationStrategy(new ProjectService(), InstanciationStrategy.PER_PROJECT), is(true)); - assertThat(ExtensionUtils.isInstantiationStrategy(DefaultService.class, InstanciationStrategy.PER_PROJECT), is(true)); - assertThat(ExtensionUtils.isInstantiationStrategy(new DefaultService(), InstanciationStrategy.PER_PROJECT), is(true)); + assertThat(ExtensionUtils.isInstantiationStrategy(BatchService.class, InstantiationStrategy.PER_PROJECT), is(false)); + assertThat(ExtensionUtils.isInstantiationStrategy(new BatchService(), InstantiationStrategy.PER_PROJECT), is(false)); + assertThat(ExtensionUtils.isInstantiationStrategy(ProjectService.class, InstantiationStrategy.PER_PROJECT), is(true)); + assertThat(ExtensionUtils.isInstantiationStrategy(new ProjectService(), InstantiationStrategy.PER_PROJECT), is(true)); + assertThat(ExtensionUtils.isInstantiationStrategy(DefaultService.class, InstantiationStrategy.PER_PROJECT), is(true)); + assertThat(ExtensionUtils.isInstantiationStrategy(new DefaultService(), InstantiationStrategy.PER_PROJECT), is(true)); } @Test @@ -69,12 +69,12 @@ public class ExtensionUtilsTest { assertThat(ExtensionUtils.isSupportedEnvironment(new BuildToolService(), new EnvironmentInformation("eclipse", "0.1")), is(false)); } - @InstanciationStrategy(InstanciationStrategy.PER_BATCH) + @InstantiationStrategy(InstantiationStrategy.PER_BATCH) public static class BatchService implements BatchExtension { } - @InstanciationStrategy(InstanciationStrategy.PER_PROJECT) + @InstantiationStrategy(InstantiationStrategy.PER_PROJECT) public static class ProjectService implements BatchExtension { } -- cgit v1.2.3