diff --git a/src/main/org/apache/tools/ant/util/GlobPatternMapper.java b/src/main/org/apache/tools/ant/util/GlobPatternMapper.java index 9aabf969b..076efd6be 100644 --- a/src/main/org/apache/tools/ant/util/GlobPatternMapper.java +++ b/src/main/org/apache/tools/ant/util/GlobPatternMapper.java @@ -98,16 +98,16 @@ public class GlobPatternMapper implements FileNameMapper { */ public void setFrom(String from) { 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 { throw new BuildException("this mapper requires a 'from' attribute"); } @@ -119,14 +119,14 @@ public class GlobPatternMapper implements FileNameMapper { */ public void setTo(String to) { 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 { throw new BuildException("this mapper requires a 'to' attribute"); } diff --git a/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java b/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java index 2971daaed..b132a2f8e 100644 --- a/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java +++ b/src/main/org/apache/tools/ant/util/RegexpPatternMapper.java @@ -81,14 +81,14 @@ public class RegexpPatternMapper implements FileNameMapper { */ public void setFrom(String from) throws BuildException { 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 { throw new BuildException("this mapper requires a 'from' attribute"); } @@ -101,7 +101,7 @@ public class RegexpPatternMapper implements FileNameMapper { */ public void setTo(String to) { if (to != null) { - this.to = to.toCharArray(); + this.to = to.toCharArray(); } else { throw new BuildException("this mapper requires a 'to' attribute"); }