From 40397727da88d931fcddc6d900b66638c4dc9ea1 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Thu, 8 Nov 2012 05:29:49 +0000 Subject: [PATCH] [MPLUGIN-233] removed InstanciationStrategy enum from annotations git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1406929 13f79535-47bb-0310-9956-ffa450edef68 --- .../annotations/InstanciationStrategy.java | 47 ------------------- .../maven/plugins/annotations/Mojo.java | 8 ---- ...avaAnnotationsMojoDescriptorExtractor.java | 8 +--- .../datamodel/MojoAnnotationContent.java | 19 -------- 4 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java deleted file mode 100644 index 5b1ef4d..0000000 --- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/InstanciationStrategy.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.apache.maven.plugins.annotations; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Component instantiation strategy. - * - * @author Hervé Boutemy - * @since 3.0 - */ -@Deprecated -public enum InstanciationStrategy -{ - PER_LOOKUP( "per-lookup" ), - SINGLETON( "singleton" ), - KEEP_ALIVE( "keep-alive" ), - POOLABLE( "poolable" ); - - private final String id; - - InstanciationStrategy( String id ) - { - this.id = id; - } - - public String id() - { - return this.id; - } -} diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java index e9d7f81..9f667e3 100644 --- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java +++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java @@ -68,14 +68,6 @@ public @interface Mojo */ InstantiationStrategy instantiationStrategy() default InstantiationStrategy.PER_LOOKUP; - /** - * The original spelling of the instantiationStrategy attribute. - * @see #instantiationStrategy() - * @return the instantiation strategy - */ - @Deprecated - InstanciationStrategy instanciationStrategy() default InstanciationStrategy.PER_LOOKUP; - /** * execution strategy: once-per-session or always. * @return once-per-session or always diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java index e92c85a..6cf6689 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java @@ -504,13 +504,7 @@ public class JavaAnnotationsMojoDescriptorExtractor mojoDescriptor.setInheritedByDefault( mojo.inheritByDefault() ); - String instantiationStrategy = mojo.instantiationStrategy().id(); - if ( instantiationStrategy == null ) - { - /* Perhaps the original spelling is there. */ - instantiationStrategy = mojo.instanciationStrategy().id(); - } - mojoDescriptor.setInstantiationStrategy( instantiationStrategy ); + mojoDescriptor.setInstantiationStrategy( mojo.instantiationStrategy().id() ); mojoDescriptor.setAggregator( mojo.aggregator() ); mojoDescriptor.setDependencyResolutionRequired( mojo.requiresDependencyResolution().id() ); diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java index b5b31bf..87018f3 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java @@ -20,7 +20,6 @@ package org.apache.maven.tools.plugin.annotations.datamodel; */ import org.apache.maven.plugins.annotations.InstantiationStrategy; -import org.apache.maven.plugins.annotations.InstanciationStrategy; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.ResolutionScope; @@ -103,24 +102,6 @@ public class MojoAnnotationContent return instantiationStrategy; } - /** - * The original spelling of the instantiationStrategy attribute. - * This returns the value under the correct name, there's no separate - * field. - * - * @return the instantiation strategy - * @see #instantiationStrategy() - */ - @SuppressWarnings( "deprecation" ) - public InstanciationStrategy instanciationStrategy() - { - if ( instantiationStrategy == null ) - { - return null; - } - return InstanciationStrategy.valueOf( instanciationStrategy().name() ); - } - public void instantiationStrategy( String instantiationStrategy ) { this.instantiationStrategy = InstantiationStrategy.valueOf( instantiationStrategy );