Browse Source

whitespace

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@684722 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
22f2e929e9
2 changed files with 27 additions and 27 deletions
  1. +18
    -18
      src/main/org/apache/tools/ant/util/GlobPatternMapper.java
  2. +9
    -9
      src/main/org/apache/tools/ant/util/RegexpPatternMapper.java

+ 18
- 18
src/main/org/apache/tools/ant/util/GlobPatternMapper.java View File

@@ -98,16 +98,16 @@ public class GlobPatternMapper implements FileNameMapper {
*/ */
public void setFrom(String from) { public void setFrom(String from) {
if (from != null) { if (from != null) {
int index = from.lastIndexOf("*");
if (index == -1) {
fromPrefix = from;
fromPostfix = "";
} else {
fromPrefix = from.substring(0, index);
fromPostfix = from.substring(index + 1);
}
prefixLength = fromPrefix.length();
postfixLength = fromPostfix.length();
int index = from.lastIndexOf("*");
if (index == -1) {
fromPrefix = from;
fromPostfix = "";
} else {
fromPrefix = from.substring(0, index);
fromPostfix = from.substring(index + 1);
}
prefixLength = fromPrefix.length();
postfixLength = fromPostfix.length();
} else { } else {
throw new BuildException("this mapper requires a 'from' attribute"); throw new BuildException("this mapper requires a 'from' attribute");
} }
@@ -119,14 +119,14 @@ public class GlobPatternMapper implements FileNameMapper {
*/ */
public void setTo(String to) { public void setTo(String to) {
if (to != null) { if (to != null) {
int index = to.lastIndexOf("*");
if (index == -1) {
toPrefix = to;
toPostfix = "";
} else {
toPrefix = to.substring(0, index);
toPostfix = to.substring(index + 1);
}
int index = to.lastIndexOf("*");
if (index == -1) {
toPrefix = to;
toPostfix = "";
} else {
toPrefix = to.substring(0, index);
toPostfix = to.substring(index + 1);
}
} else { } else {
throw new BuildException("this mapper requires a 'to' attribute"); throw new BuildException("this mapper requires a 'to' attribute");
} }


+ 9
- 9
src/main/org/apache/tools/ant/util/RegexpPatternMapper.java View File

@@ -81,14 +81,14 @@ public class RegexpPatternMapper implements FileNameMapper {
*/ */
public void setFrom(String from) throws BuildException { public void setFrom(String from) throws BuildException {
if (from != null) { if (from != null) {
try {
reg.setPattern(from);
} catch (NoClassDefFoundError e) {
// depending on the implementation the actual RE won't
// get instantiated in the constructor.
throw new BuildException("Cannot load regular expression matcher",
e);
}
try {
reg.setPattern(from);
} catch (NoClassDefFoundError e) {
// depending on the implementation the actual RE won't
// get instantiated in the constructor.
throw new BuildException("Cannot load regular expression matcher",
e);
}
} else { } else {
throw new BuildException("this mapper requires a 'from' attribute"); throw new BuildException("this mapper requires a 'from' attribute");
} }
@@ -101,7 +101,7 @@ public class RegexpPatternMapper implements FileNameMapper {
*/ */
public void setTo(String to) { public void setTo(String to) {
if (to != null) { if (to != null) {
this.to = to.toCharArray();
this.to = to.toCharArray();
} else { } else {
throw new BuildException("this mapper requires a 'to' attribute"); throw new BuildException("this mapper requires a 'to' attribute");
} }


Loading…
Cancel
Save