Browse Source

fix failing test

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@537876 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
16be80c8a5
1 changed files with 6 additions and 10 deletions
  1. +6
    -10
      src/main/org/apache/tools/ant/taskdefs/condition/ResourceContains.java

+ 6
- 10
src/main/org/apache/tools/ant/taskdefs/condition/ResourceContains.java View File

@@ -80,18 +80,14 @@ public class ResourceContains implements Condition {
try {
reader = new BufferedReader(new InputStreamReader(resource.getInputStream()));
String contents = FileUtils.readFully(reader);
if (casesensitive) {
if (contents.indexOf(substring) > -1) {
return true;
}
} else {
if (contents.toLowerCase().indexOf(substring) > -1) {
return true;
}
String sub = substring;
if (!casesensitive) {
contents = contents.toLowerCase();
sub = sub.toLowerCase();
}
return false;
return contents.indexOf(sub) >= 0;
} catch (IOException e) {
throw new BuildException("There was a problem accessing resource : "+resource);
throw new BuildException("There was a problem accessing resource : " + resource);
} finally {
FileUtils.close(reader);
}


Loading…
Cancel
Save