diff --git a/src/main/org/apache/tools/ant/BuildException.java b/src/main/org/apache/tools/ant/BuildException.java
index 442071fb7..827f3173e 100644
--- a/src/main/org/apache/tools/ant/BuildException.java
+++ b/src/main/org/apache/tools/ant/BuildException.java
@@ -131,6 +131,7 @@ public class BuildException extends RuntimeException {
* exception is associated with this one
* @deprecated Use {@link #getCause} instead.
*/
+ @Deprecated
public Throwable getException() {
return getCause();
}
diff --git a/src/main/org/apache/tools/ant/Diagnostics.java b/src/main/org/apache/tools/ant/Diagnostics.java
index 9f1aa0cd7..80180cd0a 100644
--- a/src/main/org/apache/tools/ant/Diagnostics.java
+++ b/src/main/org/apache/tools/ant/Diagnostics.java
@@ -88,6 +88,7 @@ public final class Diagnostics {
* @deprecated Obsolete since Ant 1.8.2
* @return true
*/
+ @Deprecated
public static boolean isOptionalAvailable() {
return true;
}
@@ -96,6 +97,7 @@ public final class Diagnostics {
* Doesn't do anything.
* @deprecated Obsolete since Ant 1.8.2
*/
+ @Deprecated
public static void validateVersion() throws BuildException {
}
diff --git a/src/main/org/apache/tools/ant/ProjectComponent.java b/src/main/org/apache/tools/ant/ProjectComponent.java
index 8c8feac0d..55ae6860f 100644
--- a/src/main/org/apache/tools/ant/ProjectComponent.java
+++ b/src/main/org/apache/tools/ant/ProjectComponent.java
@@ -32,6 +32,7 @@ public abstract class ProjectComponent implements Cloneable {
* You should access project object via the getProject()
* or setProject() accessor/mutators.
*/
+ @Deprecated
protected Project project;
/**
@@ -40,6 +41,7 @@ public abstract class ProjectComponent implements Cloneable {
* You should not be accessing this variable directly.
* Please use the {@link #getLocation()} method.
*/
+ @Deprecated
protected Location location = Location.UNKNOWN_LOCATION;
/**
@@ -47,6 +49,7 @@ public abstract class ProjectComponent implements Cloneable {
* @deprecated since 1.6.x.
* You should not be accessing this variable directly.
*/
+ @Deprecated
protected String description;
// CheckStyle:VisibilityModifier ON
diff --git a/src/main/org/apache/tools/ant/ProjectHelper.java b/src/main/org/apache/tools/ant/ProjectHelper.java
index 93f5576c5..9bf9607ae 100644
--- a/src/main/org/apache/tools/ant/ProjectHelper.java
+++ b/src/main/org/apache/tools/ant/ProjectHelper.java
@@ -305,6 +305,7 @@ public class ProjectHelper {
* @return the current context class loader, or null
* if the context class loader is unavailable.
*/
+ @Deprecated
public static ClassLoader getContextClassLoader() {
return LoaderUtils.isContextLoaderAvailable() ? LoaderUtils.getContextClassLoader() : null;
}
@@ -327,6 +328,7 @@ public class ProjectHelper {
* @exception BuildException if any of the attributes can't be handled by
* the target
*/
+ @Deprecated
public static void configure(Object target, AttributeList attrs,
Project project) throws BuildException {
if (target instanceof TypeAdapter) {
@@ -430,6 +432,7 @@ public class ProjectHelper {
* Use project.replaceProperties().
* @since 1.5
*/
+ @Deprecated
public static String replaceProperties(Project project, String value) throws BuildException {
// needed since project properties are not accessible
return project.replaceProperties(value);
@@ -455,6 +458,7 @@ public class ProjectHelper {
* @deprecated since 1.6.x.
* Use PropertyHelper.
*/
+ @Deprecated
public static String replaceProperties(Project project, String value, Hashtable keys)
throws BuildException {
PropertyHelper ph = PropertyHelper.getPropertyHelper(project);
@@ -482,6 +486,7 @@ public class ProjectHelper {
* @exception BuildException if the string contains an opening
* ${
without a closing }
*/
+ @Deprecated
public static void parsePropertyString(String value, Vector fragments, Vector propertyRefs)
throws BuildException {
PropertyHelper.parsePropertyStringDefault(value, fragments, propertyRefs);
diff --git a/src/main/org/apache/tools/ant/PropertyHelper.java b/src/main/org/apache/tools/ant/PropertyHelper.java
index 4449fcbac..a70a19b60 100644
--- a/src/main/org/apache/tools/ant/PropertyHelper.java
+++ b/src/main/org/apache/tools/ant/PropertyHelper.java
@@ -347,6 +347,7 @@ public class PropertyHelper implements GetProperty {
* @param next the next property helper in the chain.
* @deprecated use the delegate mechanism instead
*/
+ @Deprecated
public void setNext(PropertyHelper next) {
this.next = next;
}
@@ -362,6 +363,7 @@ public class PropertyHelper implements GetProperty {
* @return the next property helper.
* @deprecated use the delegate mechanism instead
*/
+ @Deprecated
public PropertyHelper getNext() {
return next;
}
@@ -432,6 +434,7 @@ public class PropertyHelper implements GetProperty {
* has a good reason not to).
* @deprecated PropertyHelper chaining is deprecated.
*/
+ @Deprecated
public boolean setPropertyHook(String ns, String name,
Object value,
boolean inherited, boolean user,
@@ -459,6 +462,7 @@ public class PropertyHelper implements GetProperty {
* @return The property, if returned by a hook, or null if none.
* @deprecated PropertyHelper chaining is deprecated.
*/
+ @Deprecated
public Object getPropertyHook(String ns, String name, boolean user) {
if (getNext() != null) {
Object o = getNext().getPropertyHook(ns, name, user);
@@ -506,6 +510,7 @@ public class PropertyHelper implements GetProperty {
* }
* @deprecated use the other mechanisms of this class instead
*/
+ @Deprecated
public void parsePropertyString(String value, Vector fragments,
Vector propertyRefs) throws BuildException {
parsePropertyStringDefault(value, fragments, propertyRefs);
@@ -605,6 +610,7 @@ public class PropertyHelper implements GetProperty {
* @return true if the property is set.
* @deprecated namespaces are unnecessary.
*/
+ @Deprecated
public boolean setProperty(String ns, String name, Object value, boolean verbose) {
return setProperty(name, value, verbose);
}
@@ -662,6 +668,7 @@ public class PropertyHelper implements GetProperty {
* @since Ant 1.6
* @deprecated namespaces are unnecessary.
*/
+ @Deprecated
public void setNewProperty(String ns, String name, Object value) {
setNewProperty(name, value);
}
@@ -713,6 +720,7 @@ public class PropertyHelper implements GetProperty {
* Must not be null
.
* @deprecated namespaces are unnecessary.
*/
+ @Deprecated
public void setUserProperty(String ns, String name, Object value) {
setUserProperty(name, value);
}
@@ -755,6 +763,7 @@ public class PropertyHelper implements GetProperty {
* Must not be null
.
* @deprecated namespaces are unnecessary.
*/
+ @Deprecated
public void setInheritedProperty(String ns, String name, Object value) {
setInheritedProperty(name, value);
}
@@ -801,6 +810,7 @@ public class PropertyHelper implements GetProperty {
* or if a null
name is provided.
* @deprecated namespaces are unnecessary.
*/
+ @Deprecated
public Object getProperty(String ns, String name) {
return getProperty(name);
}
@@ -849,6 +859,7 @@ public class PropertyHelper implements GetProperty {
* or if a null
name is provided.
* @deprecated namespaces are unnecessary.
*/
+ @Deprecated
public Object getUserProperty(String ns, String name) {
return getUserProperty(name);
}
diff --git a/src/main/org/apache/tools/ant/RuntimeConfigurable.java b/src/main/org/apache/tools/ant/RuntimeConfigurable.java
index a850b28c6..7ebfabd09 100644
--- a/src/main/org/apache/tools/ant/RuntimeConfigurable.java
+++ b/src/main/org/apache/tools/ant/RuntimeConfigurable.java
@@ -63,6 +63,7 @@ public class RuntimeConfigurable implements Serializable {
* XML attributes for the element.
* @deprecated since 1.6.x
*/
+ @Deprecated
private transient AttributeList attributes;
// The following is set to true if any of the attributes are namespaced
diff --git a/src/main/org/apache/tools/ant/Task.java b/src/main/org/apache/tools/ant/Task.java
index bdd233715..38d89e1ff 100644
--- a/src/main/org/apache/tools/ant/Task.java
+++ b/src/main/org/apache/tools/ant/Task.java
@@ -39,6 +39,7 @@ public abstract class Task extends ProjectComponent {
* You should not be accessing this variable directly.
* Please use the {@link #getOwningTarget()} method.
*/
+ @Deprecated
protected Target target;
/**
@@ -52,6 +53,7 @@ public abstract class Task extends ProjectComponent {
* You should not be accessing this variable directly.
* Please use the {@link #getTaskName()} method.
*/
+ @Deprecated
protected String taskName;
/**
@@ -61,6 +63,7 @@ public abstract class Task extends ProjectComponent {
* You should not be accessing this variable directly.
* Please use the {@link #getTaskType()} method.
*/
+ @Deprecated
protected String taskType;
/**
@@ -70,6 +73,7 @@ public abstract class Task extends ProjectComponent {
* You should not be accessing this variable directly.
* Please use the {@link #getWrapper()} method.
*/
+ @Deprecated
protected RuntimeConfigurable wrapper;
// CheckStyle:VisibilityModifier ON
diff --git a/src/main/org/apache/tools/ant/taskdefs/CopyPath.java b/src/main/org/apache/tools/ant/taskdefs/CopyPath.java
index bad9e5d93..afedf70e5 100644
--- a/src/main/org/apache/tools/ant/taskdefs/CopyPath.java
+++ b/src/main/org/apache/tools/ant/taskdefs/CopyPath.java
@@ -39,7 +39,7 @@ import org.apache.tools.ant.util.FileUtils;
* obsoleted by ResourceCollection support in Copy available since Ant
* 1.7.0. Don't use it.
*/
-
+@Deprecated
public class CopyPath extends Task {
// Error messages
diff --git a/src/main/org/apache/tools/ant/taskdefs/DefBase.java b/src/main/org/apache/tools/ant/taskdefs/DefBase.java
index b52bbb726..ca38fddee 100644
--- a/src/main/org/apache/tools/ant/taskdefs/DefBase.java
+++ b/src/main/org/apache/tools/ant/taskdefs/DefBase.java
@@ -51,6 +51,7 @@ public abstract class DefBase extends AntlibDefinition {
* stop using this attribute
* @ant.attribute ignore="true"
*/
+ @Deprecated
public void setReverseLoader(boolean reverseLoader) {
getDelegate().setReverseLoader(reverseLoader);
log("The reverseloader attribute is DEPRECATED. It will be removed",
diff --git a/src/main/org/apache/tools/ant/taskdefs/Deltree.java b/src/main/org/apache/tools/ant/taskdefs/Deltree.java
index 098d6e5f2..7290a6307 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Deltree.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Deltree.java
@@ -32,7 +32,7 @@ import org.apache.tools.ant.Task;
* @deprecated The deltree task is deprecated since Ant 1.2. Use
* delete instead.
*/
-
+@Deprecated
public class Deltree extends Task {
private File dir;
diff --git a/src/main/org/apache/tools/ant/taskdefs/Jikes.java b/src/main/org/apache/tools/ant/taskdefs/Jikes.java
index 4bc6835be..c94becab5 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Jikes.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Jikes.java
@@ -38,6 +38,7 @@ import org.apache.tools.ant.util.FileUtils;
* @deprecated since 1.2.
* Merged into the class Javac.
*/
+@Deprecated
public class Jikes {
// There have been reports that 300 files could be compiled
// on a command line so 250 is a conservative approach
diff --git a/src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java b/src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java
index 18bce30cf..b0fc19ddb 100644
--- a/src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java
+++ b/src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java
@@ -38,6 +38,7 @@ import org.apache.tools.ant.Task;
* @deprecated since 1.2.
* Use Jikes' exit value to detect compilation failure.
*/
+@Deprecated
public class JikesOutputParser implements ExecuteStreamHandler {
// CheckStyle:VisibilityModifier OFF - bc
protected Task task;
diff --git a/src/main/org/apache/tools/ant/taskdefs/KeySubst.java b/src/main/org/apache/tools/ant/taskdefs/KeySubst.java
index 4e331dace..ee476e7c6 100644
--- a/src/main/org/apache/tools/ant/taskdefs/KeySubst.java
+++ b/src/main/org/apache/tools/ant/taskdefs/KeySubst.java
@@ -43,6 +43,7 @@ import org.apache.tools.ant.util.StringUtils;
* @deprecated KeySubst is deprecated since Ant 1.1. Use Filter + Copy
* instead.
*/
+@Deprecated
public class KeySubst extends Task {
private File source = null;
private File dest = null;
diff --git a/src/main/org/apache/tools/ant/taskdefs/Rename.java b/src/main/org/apache/tools/ant/taskdefs/Rename.java
index 382c2a775..f4199bb2c 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Rename.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Rename.java
@@ -32,6 +32,7 @@ import org.apache.tools.ant.util.FileUtils;
* @deprecated The rename task is deprecated since Ant 1.2. Use move instead.
* @since Ant 1.1
*/
+@Deprecated
public class Rename extends Task {
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
diff --git a/src/main/org/apache/tools/ant/taskdefs/SendEmail.java b/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
index 58d5cdc0a..1db8de32b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
+++ b/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
@@ -39,6 +39,7 @@ public class SendEmail extends EmailTask {
* @deprecated since 1.5.x.
* Use {@link #setMailport(int)} instead.
*/
+ @Deprecated
public void setMailport(Integer value) {
setMailport(value.intValue());
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/TaskOutputStream.java b/src/main/org/apache/tools/ant/taskdefs/TaskOutputStream.java
index 0fdeeff68..2ba5a618b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/TaskOutputStream.java
+++ b/src/main/org/apache/tools/ant/taskdefs/TaskOutputStream.java
@@ -38,7 +38,7 @@ import org.apache.tools.ant.Task;
* @deprecated since 1.2.x.
* Use LogOutputStream instead.
*/
-
+@Deprecated
public class TaskOutputStream extends OutputStream {
private Task task;
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
index 1bb259590..6865e055f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
+++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
@@ -37,6 +37,7 @@ import org.apache.tools.ant.util.JavaEnvUtils;
* @since Ant 1.3
* @deprecated Use {@link Javac13} instead.
*/
+@Deprecated
public class Javac12 extends DefaultCompilerAdapter {
protected static final String CLASSIC_COMPILER_CLASSNAME = "sun.tools.javac.Main";
diff --git a/src/main/org/apache/tools/ant/types/DataType.java b/src/main/org/apache/tools/ant/types/DataType.java
index decfaa8c3..aa245891b 100644
--- a/src/main/org/apache/tools/ant/types/DataType.java
+++ b/src/main/org/apache/tools/ant/types/DataType.java
@@ -47,6 +47,7 @@ public abstract class DataType extends ProjectComponent implements Cloneable {
* The user should not be directly referencing
* variable. Please use {@link #getRefid} instead.
*/
+ @Deprecated
protected Reference ref;
/**
@@ -62,6 +63,7 @@ public abstract class DataType extends ProjectComponent implements Cloneable {
* variable. Please use {@link #setChecked} or
* {@link #isChecked} instead.
*/
+ @Deprecated
protected boolean checked = true;
// CheckStyle:VisibilityModifier ON
diff --git a/src/main/org/apache/tools/ant/types/Mapper.java b/src/main/org/apache/tools/ant/types/Mapper.java
index 6b922a770..86c62a080 100644
--- a/src/main/org/apache/tools/ant/types/Mapper.java
+++ b/src/main/org/apache/tools/ant/types/Mapper.java
@@ -275,6 +275,7 @@ public class Mapper extends DataType {
* FileNameMapper implementation directly.
* @return the referenced Mapper
*/
+ @Deprecated
protected Mapper getRef() {
return getCheckedRef(Mapper.class, getDataTypeName());
}
diff --git a/src/main/org/apache/tools/ant/types/Reference.java b/src/main/org/apache/tools/ant/types/Reference.java
index e5e9b25ce..eefabcfb8 100644
--- a/src/main/org/apache/tools/ant/types/Reference.java
+++ b/src/main/org/apache/tools/ant/types/Reference.java
@@ -36,6 +36,7 @@ public class Reference {
* Please use {@link Reference#Reference(Project,String)}
* instead.
*/
+ @Deprecated
public Reference() {
}
@@ -46,6 +47,7 @@ public class Reference {
* Please use {@link Reference#Reference(Project,String)}
* instead.
*/
+ @Deprecated
public Reference(String id) {
setRefId(id);
}
diff --git a/src/main/org/apache/tools/ant/types/resources/FileResourceIterator.java b/src/main/org/apache/tools/ant/types/resources/FileResourceIterator.java
index 258411755..19a042c00 100644
--- a/src/main/org/apache/tools/ant/types/resources/FileResourceIterator.java
+++ b/src/main/org/apache/tools/ant/types/resources/FileResourceIterator.java
@@ -38,6 +38,7 @@ public class FileResourceIterator implements Iterator {
* Construct a new FileResourceIterator.
* @deprecated in favor of {@link FileResourceIterator#FileResourceIterator(Project)}
*/
+ @Deprecated
public FileResourceIterator() {
}
@@ -56,6 +57,7 @@ public class FileResourceIterator implements Iterator {
* @param basedir the base directory of this instance.
* @deprecated in favor of {@link FileResourceIterator#FileResourceIterator(Project, File)}
*/
+ @Deprecated
public FileResourceIterator(File basedir) {
this(null, basedir);
}
@@ -79,6 +81,7 @@ public class FileResourceIterator implements Iterator {
* @param filenames the String[] of filenames.
* @deprecated in favor of {@link FileResourceIterator#FileResourceIterator(Project, File, String[])}
*/
+ @Deprecated
public FileResourceIterator(File basedir, String[] filenames) {
this(null, basedir, filenames);
}
diff --git a/src/main/org/apache/tools/ant/util/CollectionUtils.java b/src/main/org/apache/tools/ant/util/CollectionUtils.java
index 2119a9e63..c8f8135d8 100644
--- a/src/main/org/apache/tools/ant/util/CollectionUtils.java
+++ b/src/main/org/apache/tools/ant/util/CollectionUtils.java
@@ -50,6 +50,7 @@ public class CollectionUtils {
* @since Ant 1.5
* @deprecated since 1.6.x.
*/
+ @Deprecated
public static boolean equals(Vector> v1, Vector> v2) {
return Objects.equals(v1, v2);
}
@@ -65,6 +66,7 @@ public class CollectionUtils {
* @since Ant 1.5
* @deprecated since 1.6.x.
*/
+ @Deprecated
public static boolean equals(Dictionary, ?> d1, Dictionary, ?> d2) {
if (d1 == d2) {
return true;
@@ -115,6 +117,7 @@ public class CollectionUtils {
* @since Ant 1.6
* @deprecated since 1.6.x.
*/
+ @Deprecated
public static void putAll(Dictionary super K, ? super V> m1,
Dictionary extends K, ? extends V> m2) {
for (Enumeration extends K> it = m2.keys(); it.hasMoreElements();) {
diff --git a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
index e8cd4ef27..b8f9876e3 100644
--- a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
+++ b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
@@ -111,11 +111,13 @@ public final class JavaEnvUtils {
* Version constant for Java 1.9
* @deprecated use #JAVA_9 instead
*/
+ @Deprecated
public static final String JAVA_1_9 = "1.9";
/**
* Number Version constant for Java 1.9
* @deprecated use #VERSION_9 instead
*/
+ @Deprecated
public static final int VERSION_1_9 = 19;
/**
@@ -250,6 +252,7 @@ public final class JavaEnvUtils {
* be 0 for all versions of Java starting with Java 9.
* @deprecated use #getParsedJavaVersion instead
*/
+ @Deprecated
public static int getJavaVersionNumber() {
return javaVersionNumber;
}
diff --git a/src/main/org/apache/tools/ant/util/StringUtils.java b/src/main/org/apache/tools/ant/util/StringUtils.java
index 70191edef..e738da12a 100644
--- a/src/main/org/apache/tools/ant/util/StringUtils.java
+++ b/src/main/org/apache/tools/ant/util/StringUtils.java
@@ -85,6 +85,7 @@ public final class StringUtils {
* @return the new string with replaced occurrences.
* @deprecated Use {@link String#replace(CharSequence, CharSequence)} now.
*/
+ @Deprecated
public static String replace(String data, String from, String to) {
return data.replace(from, to);
}