ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r536536 - /ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java
Date Wed, 09 May 2007 14:08:50 GMT
Author: mbenson
Date: Wed May  9 07:08:50 2007
New Revision: 536536

URL: http://svn.apache.org/viewvc?view=rev&rev=536536
Log:
if either resource to be compared has an unknown size, we must compare content

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java?view=diff&rev=536536&r1=536535&r2=536536
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java Wed May  9 07:08:50
2007
@@ -438,8 +438,13 @@
         if (r1.equals(r2)) {
             return true;
         }
-        if (!text && r1.getSize() != r2.getSize()) {
-            return false;
+        if (!text) {
+            long s1 = r1.getSize();
+            long s2 = r2.getSize();
+            if (s1 != Resource.UNKNOWN_SIZE && s2 != Resource.UNKNOWN_SIZE
+                    && s1 != s2) {
+                return false;
+            }
         }
         return compareContent(r1, r2, text) == 0;
     }



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


Mime
View raw message