Browse Source

This is a simple patch which adds an attribute "classname" as an alias for

the "class" attribute in various taskdefs. This is required for use under
JDK 1.3 (RC1) due to changes in the way introspection works. Don't know
about the final version of 1.3 but changing to "classname" is probably a
good idea in any case. By leaving the setClass method in place, current
build files can continue to be used under JDKs prior to 1.3. It also allows
time for build files to be migrated. Eventually setClass should be removed.

Note: I added a deprecation warning to the output whenever the class
      attribute is used.

Submitted by: Conor MacNeill <conor@m64.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267611 13f79535-47bb-0310-9956-ffa450edef68
master
Sam Ruby 25 years ago
parent
commit
653124c46b
4 changed files with 32 additions and 1 deletions
  1. +7
    -0
      src/main/org/apache/tools/ant/taskdefs/Available.java
  2. +11
    -1
      src/main/org/apache/tools/ant/taskdefs/Java.java
  3. +7
    -0
      src/main/org/apache/tools/ant/taskdefs/Rmic.java
  4. +7
    -0
      src/main/org/apache/tools/ant/taskdefs/Taskdef.java

+ 7
- 0
src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -76,6 +76,13 @@ public class Available extends Task {
} }


public void setClass(String classname) { public void setClass(String classname) {
project.log("The class attribute is deprecated. " +
"Please use the classname attribute.",
Project.MSG_WARN);
this.classname = classname;
}

public void setClassname(String classname) {
this.classname = classname; this.classname = classname;
} }




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

@@ -118,9 +118,19 @@ public class Java extends Exec {
} }
/** /**
* Set the source file.
* Set the source file (deprecated).
*/ */
public void setClass(String s) { public void setClass(String s) {
project.log("The class attribute is deprecated. " +
"Please use the classname attribute.",
Project.MSG_WARN);
this.classname = s;
}

/**
* Set the source file.
*/
public void setClassname(String s) {
this.classname = s; this.classname = s;
} }




+ 7
- 0
src/main/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -89,6 +89,13 @@ public class Rmic extends Task {
} }


public void setClass(String classname) { public void setClass(String classname) {
project.log("The class attribute is deprecated. " +
"Please use the classname attribute.",
Project.MSG_WARN);
this.classname = classname;
}

public void setClassname(String classname) {
this.classname = classname; this.classname = classname;
} }




+ 7
- 0
src/main/org/apache/tools/ant/taskdefs/Taskdef.java View File

@@ -90,6 +90,13 @@ public class Taskdef extends Task {
} }


public void setClass(String v) { public void setClass(String v) {
project.log("The class attribute is deprecated. " +
"Please use the classname attribute.",
Project.MSG_WARN);
value = v;
}

public void setClassname(String v) {
value = v; value = v;
} }
} }

Loading…
Cancel
Save