You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2007/09/03 17:56:17 UTC

svn commit: r572374 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/Project.java src/tests/antunit/types/conditions/isreference-test.xml

Author: peterreilly
Date: Mon Sep  3 08:56:16 2007
New Revision: 572374

URL: http://svn.apache.org/viewvc?rev=572374&view=rev
Log:
remove resolution for references that are not resolved during normal runtime execution

Added:
    ant/core/trunk/src/tests/antunit/types/conditions/isreference-test.xml   (with props)
Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/Project.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=572374&r1=572373&r2=572374&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Sep  3 08:56:16 2007
@@ -24,7 +24,10 @@
 * In the <touch> task when a <mapper> is used, the millis and datetime
   attributes now override the time of the source resource if provisioned. 
   Bugzilla report 43235.
-  
+
+* Remove fall-back mechanism for references that are not resolved
+  during normal runtime execution.
+
 Fixed bugs:
 -----------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Project.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Project.java?rev=572374&r1=572373&r2=572374&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Project.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Project.java Mon Sep  3 08:56:16 2007
@@ -1886,28 +1886,6 @@
     }
 
     /**
-     * Attempt to resolve an Unknown Reference using the
-     * parsed id's - for BC.
-     */
-    private Object resolveIdReference(String key, Project callerProject) {
-        UnknownElement origUE = (UnknownElement) idReferences.get(key);
-        if (origUE == null) {
-            return parentIdProject == null
-                ? null
-                : parentIdProject.resolveIdReference(key, callerProject);
-        }
-        callerProject.log(
-            "Warning: Reference " + key + " has not been set at runtime,"
-            + " but was found during" + LINE_SEP
-            + "build file parsing, attempting to resolve."
-            + " Future versions of Ant may support" + LINE_SEP
-            + " referencing ids defined in non-executed targets.", MSG_WARN);
-        UnknownElement copyUE = origUE.copy(callerProject);
-        copyUE.maybeConfigure();
-        return copyUE.getRealThing();
-    }
-
-    /**
      * Add an id reference.
      * Used for broken build files.
      * @param id the id to set.
@@ -1963,9 +1941,7 @@
         if (ret != null) {
             return ret;
         }
-        // Check for old id behaviour
-        ret = resolveIdReference(key, this);
-        if (ret == null && !key.equals(MagicNames.REFID_PROPERTY_HELPER)) {
+        if (!key.equals(MagicNames.REFID_PROPERTY_HELPER)) {
             try {
                 if (PropertyHelper.getPropertyHelper(this).containsProperties(key)) {
                     log("Unresolvable reference " + key

Added: ant/core/trunk/src/tests/antunit/types/conditions/isreference-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/types/conditions/isreference-test.xml?rev=572374&view=auto
==============================================================================
--- ant/core/trunk/src/tests/antunit/types/conditions/isreference-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/types/conditions/isreference-test.xml Mon Sep  3 08:56:16 2007
@@ -0,0 +1,23 @@
+<project name="isreference-test" default="antunit"
+         xmlns:au="antlib:org.apache.ant.antunit">
+
+  <import file="../../antunit-base.xml" />
+
+  <target name="out-of-band">
+    <path id="out-of-band" path="."/>
+  </target>
+
+  <target name="testOutOfBand">
+    <au:assertFalse>
+      <isreference refid="out-of-band"/>
+    </au:assertFalse>
+  </target>
+
+  <target name="testInBand">
+    <path id="in-band" path="."/>
+    <au:assertTrue>
+      <isreference refid="in-band"/>
+    </au:assertTrue>
+  </target>
+</project>
+

Propchange: ant/core/trunk/src/tests/antunit/types/conditions/isreference-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org