Browse Source

java 11's javac whines if @Deprecated Annotation is missing

master
Stefan Bodewig 7 years ago
parent
commit
e50fdd719c
24 changed files with 52 additions and 3 deletions
  1. +1
    -0
      src/main/org/apache/tools/ant/BuildException.java
  2. +2
    -0
      src/main/org/apache/tools/ant/Diagnostics.java
  3. +3
    -0
      src/main/org/apache/tools/ant/ProjectComponent.java
  4. +5
    -0
      src/main/org/apache/tools/ant/ProjectHelper.java
  5. +11
    -0
      src/main/org/apache/tools/ant/PropertyHelper.java
  6. +1
    -0
      src/main/org/apache/tools/ant/RuntimeConfigurable.java
  7. +4
    -0
      src/main/org/apache/tools/ant/Task.java
  8. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/CopyPath.java
  9. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/DefBase.java
  10. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Deltree.java
  11. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/Jikes.java
  12. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java
  13. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/KeySubst.java
  14. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/Rename.java
  15. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/SendEmail.java
  16. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/TaskOutputStream.java
  17. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
  18. +2
    -0
      src/main/org/apache/tools/ant/types/DataType.java
  19. +1
    -0
      src/main/org/apache/tools/ant/types/Mapper.java
  20. +2
    -0
      src/main/org/apache/tools/ant/types/Reference.java
  21. +3
    -0
      src/main/org/apache/tools/ant/types/resources/FileResourceIterator.java
  22. +3
    -0
      src/main/org/apache/tools/ant/util/CollectionUtils.java
  23. +3
    -0
      src/main/org/apache/tools/ant/util/JavaEnvUtils.java
  24. +1
    -0
      src/main/org/apache/tools/ant/util/StringUtils.java

+ 1
- 0
src/main/org/apache/tools/ant/BuildException.java View File

@@ -118,6 +118,7 @@ public class BuildException extends RuntimeException {
* exception is associated with this one
* @deprecated Use {@link #getCause} instead.
*/
@Deprecated
public Throwable getException() {
return getCause();
}


+ 2
- 0
src/main/org/apache/tools/ant/Diagnostics.java View File

@@ -90,6 +90,7 @@ public final class Diagnostics {
* @deprecated Obsolete since Ant 1.8.2
* @return <tt>true</tt>
*/
@Deprecated
public static boolean isOptionalAvailable() {
return true;
}
@@ -98,6 +99,7 @@ public final class Diagnostics {
* Doesn't do anything.
* @deprecated Obsolete since Ant 1.8.2
*/
@Deprecated
public static void validateVersion() throws BuildException {
}



+ 3
- 0
src/main/org/apache/tools/ant/ProjectComponent.java View File

@@ -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



+ 5
- 0
src/main/org/apache/tools/ant/ProjectHelper.java View File

@@ -309,6 +309,7 @@ public class ProjectHelper {
* @return the current context class loader, or <code>null</code>
* if the context class loader is unavailable.
*/
@Deprecated
public static ClassLoader getContextClassLoader() {
return LoaderUtils.isContextLoaderAvailable() ? LoaderUtils.getContextClassLoader() : null;
}
@@ -331,6 +332,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) {
@@ -434,6 +436,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);
@@ -459,6 +462,7 @@ public class ProjectHelper {
* @deprecated since 1.6.x.
* Use PropertyHelper.
*/
@Deprecated
public static String replaceProperties(Project project, String value, Hashtable<String, Object> keys)
throws BuildException {
PropertyHelper ph = PropertyHelper.getPropertyHelper(project);
@@ -486,6 +490,7 @@ public class ProjectHelper {
* @exception BuildException if the string contains an opening
* <code>${</code> without a closing <code>}</code>
*/
@Deprecated
public static void parsePropertyString(String value, Vector<String> fragments, Vector<String> propertyRefs)
throws BuildException {
PropertyHelper.parsePropertyStringDefault(value, fragments, propertyRefs);


+ 11
- 0
src/main/org/apache/tools/ant/PropertyHelper.java View File

@@ -360,6 +360,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;
}
@@ -375,6 +376,7 @@ public class PropertyHelper implements GetProperty {
* @return the next property helper.
* @deprecated use the delegate mechanism instead
*/
@Deprecated
public PropertyHelper getNext() {
return next;
}
@@ -445,6 +447,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,
@@ -472,6 +475,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);
@@ -519,6 +523,7 @@ public class PropertyHelper implements GetProperty {
* <code>}</code>
* @deprecated use the other mechanisms of this class instead
*/
@Deprecated
public void parsePropertyString(String value, Vector<String> fragments,
Vector<String> propertyRefs) throws BuildException {
parsePropertyStringDefault(value, fragments, propertyRefs);
@@ -618,6 +623,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);
}
@@ -675,6 +681,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);
}
@@ -726,6 +733,7 @@ public class PropertyHelper implements GetProperty {
* Must not be <code>null</code>.
* @deprecated namespaces are unnecessary.
*/
@Deprecated
public void setUserProperty(String ns, String name, Object value) {
setUserProperty(name, value);
}
@@ -768,6 +776,7 @@ public class PropertyHelper implements GetProperty {
* Must not be <code>null</code>.
* @deprecated namespaces are unnecessary.
*/
@Deprecated
public void setInheritedProperty(String ns, String name, Object value) {
setInheritedProperty(name, value);
}
@@ -814,6 +823,7 @@ public class PropertyHelper implements GetProperty {
* or if a <code>null</code> name is provided.
* @deprecated namespaces are unnecessary.
*/
@Deprecated
public Object getProperty(String ns, String name) {
return getProperty(name);
}
@@ -862,6 +872,7 @@ public class PropertyHelper implements GetProperty {
* or if a <code>null</code> name is provided.
* @deprecated namespaces are unnecessary.
*/
@Deprecated
public Object getUserProperty(String ns, String name) {
return getUserProperty(name);
}


+ 1
- 0
src/main/org/apache/tools/ant/RuntimeConfigurable.java View File

@@ -64,6 +64,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


+ 4
- 0
src/main/org/apache/tools/ant/Task.java View File

@@ -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


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/CopyPath.java View File

@@ -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


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/DefBase.java View File

@@ -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",


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Deltree.java View File

@@ -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;


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/Jikes.java View File

@@ -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


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/JikesOutputParser.java View File

@@ -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;


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/KeySubst.java View File

@@ -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;


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/Rename.java View File

@@ -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();


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/SendEmail.java View File

@@ -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());
}


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/TaskOutputStream.java View File

@@ -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;


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java View File

@@ -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";



+ 2
- 0
src/main/org/apache/tools/ant/types/DataType.java View File

@@ -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



+ 1
- 0
src/main/org/apache/tools/ant/types/Mapper.java View File

@@ -274,6 +274,7 @@ public class Mapper extends DataType {
* FileNameMapper implementation directly.
* @return the referenced Mapper
*/
@Deprecated
protected Mapper getRef() {
return getCheckedRef(Mapper.class, getDataTypeName());
}


+ 2
- 0
src/main/org/apache/tools/ant/types/Reference.java View File

@@ -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);
}


+ 3
- 0
src/main/org/apache/tools/ant/types/resources/FileResourceIterator.java View File

@@ -38,6 +38,7 @@ public class FileResourceIterator implements Iterator<Resource> {
* Construct a new FileResourceIterator.
* @deprecated in favor of {@link FileResourceIterator#FileResourceIterator(Project)}
*/
@Deprecated
public FileResourceIterator() {
}

@@ -56,6 +57,7 @@ public class FileResourceIterator implements Iterator<Resource> {
* @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<Resource> {
* @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);
}


+ 3
- 0
src/main/org/apache/tools/ant/util/CollectionUtils.java View File

@@ -48,6 +48,7 @@ public class CollectionUtils {
* @since Ant 1.5
* @deprecated since 1.6.x.
*/
@Deprecated
public static boolean equals(Vector<?> v1, Vector<?> v2) {
if (v1 == v2) {
return true;
@@ -71,6 +72,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;
@@ -128,6 +130,7 @@ public class CollectionUtils {
* @since Ant 1.6
* @deprecated since 1.6.x.
*/
@Deprecated
public static <K, V> void putAll(Dictionary<? super K, ? super V> m1, Dictionary<? extends K, ? extends V> m2) {
for (Enumeration<? extends K> it = m2.keys(); it.hasMoreElements();) {
K key = it.nextElement();


+ 3
- 0
src/main/org/apache/tools/ant/util/JavaEnvUtils.java View File

@@ -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;
}


+ 1
- 0
src/main/org/apache/tools/ant/util/StringUtils.java View File

@@ -81,6 +81,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);
}


Loading…
Cancel
Save