From b522a2e89c065eb95466f1031d27332f8250c6b1 Mon Sep 17 00:00:00 2001 From: Magesh Umasankar Date: Tue, 3 Sep 2002 14:52:25 +0000 Subject: [PATCH] Merge from 1.5 Branch PR: 11675 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273284 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Checksum.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Checksum.java b/src/main/org/apache/tools/ant/taskdefs/Checksum.java index b9e17d011..40c5527e8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Checksum.java +++ b/src/main/org/apache/tools/ant/taskdefs/Checksum.java @@ -180,7 +180,7 @@ public class Checksum extends MatchingTask implements Condition { } /** - * Whether or not to overwrite existing file irrespective of + * Whether or not to overwrite existing file irrespective of * whether it is newer than * the source file. Defaults to false. */ @@ -254,12 +254,12 @@ public class Checksum extends MatchingTask implements Condition { if (file != null) { if (filesets.size() > 0) { - throw new BuildException("Multiple files cannot be used " + throw new BuildException("Multiple files cannot be used " + "when Property is specified"); } } else { if (filesets.size() > 1) { - throw new BuildException("Multiple files cannot be used " + throw new BuildException("Multiple files cannot be used " + "when Property is specified"); } } @@ -275,7 +275,7 @@ public class Checksum extends MatchingTask implements Condition { } if (isCondition && forceOverwrite) { - throw new BuildException("ForceOverwrite cannot be used when " + throw new BuildException("ForceOverwrite cannot be used when " + "conditions are being used."); } @@ -310,7 +310,7 @@ public class Checksum extends MatchingTask implements Condition { try { addToIncludeFileMap(file); - + int sizeofFileSet = filesets.size(); for (int i = 0; i < sizeofFileSet; i++) { FileSet fs = (FileSet) filesets.elementAt(i); @@ -337,7 +337,7 @@ public class Checksum extends MatchingTask implements Condition { if (file != null) { if (file.exists()) { if (property == null) { - File dest + File dest = new File(file.getParent(), file.getName() + fileext); if (forceOverwrite || isCondition || (file.lastModified() > dest.lastModified())) { @@ -398,7 +398,8 @@ public class Checksum extends MatchingTask implements Condition { if (destination instanceof java.lang.String) { String prop = (String) destination; if (isCondition) { - checksumMatches = checksum.equals(property); + checksumMatches = checksumMatches && + checksum.equals(property); } else { getProject().setNewProperty(prop, checksum); } @@ -414,7 +415,7 @@ public class Checksum extends MatchingTask implements Condition { fis = null; br.close(); isr.close(); - checksumMatches = + checksumMatches = checksumMatches && checksum.equals(suppliedChecksum); } else { checksumMatches = false;