From a7f39c75ec16c6c5a353dc4b7fc1f91f68dc31ae Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 1 Aug 2001 09:29:50 +0000 Subject: [PATCH] didn't mean to remove the toString method with my last commit. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269421 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/types/PatternSet.java | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/src/main/org/apache/tools/ant/types/PatternSet.java b/src/main/org/apache/tools/ant/types/PatternSet.java index 1a29f99d1..e36d1a4bb 100644 --- a/src/main/org/apache/tools/ant/types/PatternSet.java +++ b/src/main/org/apache/tools/ant/types/PatternSet.java @@ -121,26 +121,26 @@ public class PatternSet extends DataType { return true; } - public String toString() { - StringBuffer buf = new StringBuffer(name); - if ((ifCond != null) || (unlessCond != null)) { - buf.append(":"); - String connector = ""; - - if (ifCond != null) { - buf.append("if->"); - buf.append(ifCond); - connector = ";"; - } - if (unlessCond != null) { - buf.append(connector); - buf.append("unless->"); - buf.append(unlessCond); - } - } - - return buf.toString(); - } + public String toString() { + StringBuffer buf = new StringBuffer(name); + if ((ifCond != null) || (unlessCond != null)) { + buf.append(":"); + String connector = ""; + + if (ifCond != null) { + buf.append("if->"); + buf.append(ifCond); + connector = ";"; + } + if (unlessCond != null) { + buf.append(connector); + buf.append("unless->"); + buf.append(unlessCond); + } + } + + return buf.toString(); + } } public PatternSet() { @@ -402,16 +402,16 @@ public class PatternSet extends DataType { if (includesFileList.size() > 0) { Enumeration e = includesFileList.elements(); while (e.hasMoreElements()) { - NameEntry ne = (NameEntry)e.nextElement(); - String fileName = ne.evalName(p); - if (fileName != null) { + NameEntry ne = (NameEntry)e.nextElement(); + String fileName = ne.evalName(p); + if (fileName != null) { File inclFile = p.resolveFile(fileName); if (!inclFile.exists()) throw new BuildException("Includesfile " + inclFile.getAbsolutePath() + " not found."); readPatterns(inclFile, includeList, p); - } + } } includesFileList.clear(); } @@ -419,19 +419,25 @@ public class PatternSet extends DataType { if (excludesFileList.size() > 0) { Enumeration e = includesFileList.elements(); while (e.hasMoreElements()) { - NameEntry ne = (NameEntry)e.nextElement(); - String fileName = ne.evalName(p); - if (fileName != null) { + NameEntry ne = (NameEntry)e.nextElement(); + String fileName = ne.evalName(p); + if (fileName != null) { File exclFile = p.resolveFile(fileName); if (!exclFile.exists()) throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found."); readPatterns(exclFile, excludeList, p); - } + } } excludesFileList.clear(); } } + public String toString() + { + return "patternSet{ includes: " + includeList + + " excludes: " + excludeList + " }"; + } + }