From 1ef583d3e64c0f77a8b2cf05666007ee476ace17 Mon Sep 17 00:00:00 2001 From: Andrey Bruykhov Date: Mon, 6 Feb 2023 19:58:10 +0300 Subject: [PATCH] Added missing @Deprecated/@deprecated annotations @Deprecated annotatio is helpful to prevent usage of deprecated API. For example: developer can see crossed out method/field name if this item is deprecated. --- .../java/org/apache/maven/profiles/DefaultProfileManager.java | 1 + .../org/apache/maven/project/InvalidProjectModelException.java | 2 ++ .../maven/project/inheritance/ModelInheritanceAssembler.java | 1 - .../interpolation/AbstractStringBasedModelInterpolator.java | 1 + .../apache/maven/project/interpolation/ModelInterpolator.java | 2 ++ .../apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java | 1 + .../org/apache/maven/project/DuplicateProjectException.java | 2 ++ .../java/org/apache/maven/project/ProjectBuildingException.java | 1 + .../org/apache/maven/toolchain/java/DefaultJavaToolChain.java | 1 + 9 files changed, 11 insertions(+), 1 deletion(-) diff --git a/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java b/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java index 8554e768c2..bc15776530 100644 --- a/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java +++ b/maven-compat/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java @@ -64,6 +64,7 @@ public class DefaultProfileManager implements ProfileManager { * @deprecated without passing in the system properties, the SystemPropertiesProfileActivator will not work * correctly in embedded environments. */ + @Deprecated public DefaultProfileManager(PlexusContainer container) { this(container, null); } diff --git a/maven-compat/src/main/java/org/apache/maven/project/InvalidProjectModelException.java b/maven-compat/src/main/java/org/apache/maven/project/InvalidProjectModelException.java index b3c86d3995..1b9e98fb3a 100644 --- a/maven-compat/src/main/java/org/apache/maven/project/InvalidProjectModelException.java +++ b/maven-compat/src/main/java/org/apache/maven/project/InvalidProjectModelException.java @@ -40,6 +40,7 @@ public class InvalidProjectModelException extends ProjectBuildingException { * @param validationResult * @deprecated use {@link File} constructor for pomLocation */ + @Deprecated public InvalidProjectModelException( String projectId, String pomLocation, String message, ModelValidationResult validationResult) { this(projectId, message, new File(pomLocation), validationResult); @@ -58,6 +59,7 @@ public class InvalidProjectModelException extends ProjectBuildingException { * @param message * @deprecated use {@link File} constructor for pomLocation */ + @Deprecated public InvalidProjectModelException(String projectId, String pomLocation, String message) { this(projectId, message, new File(pomLocation)); } diff --git a/maven-compat/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java b/maven-compat/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java index fc6d3bcde4..a4b2ee5127 100644 --- a/maven-compat/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java +++ b/maven-compat/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java @@ -23,7 +23,6 @@ import org.apache.maven.model.Model; /** * @author Jason van Zyl - * @deprecated */ @Deprecated public interface ModelInheritanceAssembler { diff --git a/maven-compat/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java b/maven-compat/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java index 7479f76c74..87e46e85c5 100644 --- a/maven-compat/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java +++ b/maven-compat/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java @@ -117,6 +117,7 @@ public abstract class AbstractStringBasedModelInterpolator extends AbstractLogEn * * @deprecated Use {@link ModelInterpolator#interpolate(Model, File, ProjectBuilderConfiguration, boolean)} instead. */ + @Deprecated public Model interpolate(Model model, Map context, boolean strict) throws ModelInterpolationException { Properties props = new Properties(); props.putAll(context); diff --git a/maven-compat/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java b/maven-compat/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java index 41a459d833..3092cdc213 100644 --- a/maven-compat/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java +++ b/maven-compat/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java @@ -38,11 +38,13 @@ public interface ModelInterpolator { /** * @deprecated Use {@link ModelInterpolator#interpolate(Model, File, ProjectBuilderConfiguration, boolean)} instead. */ + @Deprecated Model interpolate(Model project, Map context) throws ModelInterpolationException; /** * @deprecated Use {@link ModelInterpolator#interpolate(Model, File, ProjectBuilderConfiguration, boolean)} instead. */ + @Deprecated Model interpolate(Model model, Map context, boolean strict) throws ModelInterpolationException; Model interpolate(Model model, File projectDir, ProjectBuilderConfiguration config, boolean debugEnabled) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java index b9735f5d80..c82b70164f 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java @@ -36,6 +36,7 @@ public class DefaultLifecycleMapping implements LifecycleMapping { private Map lifecycleMap; /** @deprecated use lifecycles instead */ + @Deprecated private Map phases; /** diff --git a/maven-core/src/main/java/org/apache/maven/project/DuplicateProjectException.java b/maven-core/src/main/java/org/apache/maven/project/DuplicateProjectException.java index a19c25755a..a1cd6ac277 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DuplicateProjectException.java +++ b/maven-core/src/main/java/org/apache/maven/project/DuplicateProjectException.java @@ -35,6 +35,7 @@ public class DuplicateProjectException extends Exception { /** * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} */ + @Deprecated public DuplicateProjectException(String message) { this(null, null, null, message); } @@ -42,6 +43,7 @@ public class DuplicateProjectException extends Exception { /** * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} */ + @Deprecated public DuplicateProjectException(String message, Exception e) { super(message, e); this.projectId = null; diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingException.java b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingException.java index 41016c5658..7665acc746 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingException.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingException.java @@ -77,6 +77,7 @@ public class ProjectBuildingException extends Exception { /** * @deprecated use {@link #getPomFile()} */ + @Deprecated public String getPomLocation() { if (getPomFile() != null) { return getPomFile().getAbsolutePath(); diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java index 5c276948a3..4f70d62a8b 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java @@ -29,6 +29,7 @@ import org.codehaus.plexus.logging.Logger; * @deprecated clients that do not require compatibility with Maven 3.2.3 and earlier should link to * {@link JavaToolchainImpl} instead. */ +@Deprecated public class DefaultJavaToolChain extends JavaToolchainImpl { public static final String KEY_JAVAHOME = JavaToolchainImpl.KEY_JAVAHOME;