From 71bdf3e03d71b08d17c9489c9064872bdd7cde3e Mon Sep 17 00:00:00 2001 From: Costin Manolache Date: Tue, 31 Dec 2002 17:36:15 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273734 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Ant.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java index 507fc6bd4..29893348c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Ant.java +++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java @@ -88,7 +88,7 @@ import org.apache.tools.ant.util.FileUtils; * * * - * @author costin@dnt.ro + * @author Costin Manolache * * @since Ant 1.1 * @@ -467,6 +467,11 @@ public class Ant extends Task { */ 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 {