Browse Source

More diagnostics. Because some of us never get regexps right first time

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275410 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 22 years ago
parent
commit
1dc3ff85f6
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java

+ 4
- 0
src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java View File

@@ -306,6 +306,7 @@ public class ReplaceRegExp extends Task {
Regexp regexp = r.getRegexp(getProject());

if (regexp.matches(input, options)) {
log("Found match; substituting",Project.MSG_DEBUG);
res = regexp.substitute(input, s.getExpression(getProject()),
options);
}
@@ -436,6 +437,7 @@ public class ReplaceRegExp extends Task {
w = null;

if (changes) {
log("File has changed; saving the updated file",Project.MSG_VERBOSE);
try {
fileUtils.rename(temp, f);
temp = null;
@@ -443,6 +445,8 @@ public class ReplaceRegExp extends Task {
throw new BuildException("Couldn't rename temporary file "
+ temp, getLocation());
}
} else {
log("No change made",Project.MSG_DEBUG);
}
} finally {
try {


Loading…
Cancel
Save