costin 2002/12/31 09:36:16
Modified: src/main/org/apache/tools/ant/taskdefs Ant.java
Log:
Ant will try to copy all inheritedReferences. Some may not exist.
Display a warning.
I don't understand very well the code - but we take the name from
"references" ( which is specified by the user ), and assume that
all of them exist. For some reason that's not allways true.
Revision Changes Path
1.68 +6 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
Index: Ant.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- Ant.java 25 Sep 2002 14:08:48 -0000 1.67
+++ Ant.java 31 Dec 2002 17:36:15 -0000 1.68
@@ -88,7 +88,7 @@
* </pre>
*
*
- * @author [EMAIL PROTECTED]
+ * @author Costin Manolache
*
* @since Ant 1.1
*
@@ -467,6 +467,11 @@
*/
private void copyReference(String oldKey, String newKey) {
Object orig = getProject().getReference(oldKey);
+ if( orig==null ) {
+ log( "No object referenced by " + oldKey + ". Can't copy to " +
newKey,
+ Project.MSG_WARN);
+ return;
+ }
Class c = orig.getClass();
Object copy = orig;
try {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>