From 3ca907710e149dcb83209271754ce53266f7de21 Mon Sep 17 00:00:00 2001 From: Magesh Umasankar Date: Mon, 18 Feb 2002 01:00:37 +0000 Subject: [PATCH] 1. Use a variable name that better represents the type of data stored. 2. Minor code cleanup. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271392 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/filters/ReplaceTokens.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/ReplaceTokens.java b/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/ReplaceTokens.java index f2fdea123..1cac44a7a 100644 --- a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/ReplaceTokens.java +++ b/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/ReplaceTokens.java @@ -17,7 +17,7 @@ import org.apache.tools.ant.types.Parameterizable; * * * - * + * * * @author Magesh Umasankar */ @@ -29,7 +29,7 @@ public final class ReplaceTokens private static final char DEFAULT_END_TOKEN = '@'; - private String storedData = null; + private String queuedData = null; private Parameter[] parameters; @@ -59,19 +59,19 @@ public final class ReplaceTokens initialized = true; } - if (storedData != null && storedData.length() > 0) { - int ch = storedData.charAt(0); - if (storedData.length() > 1) { - storedData = storedData.substring(1); + if (queuedData != null && queuedData.length() > 0) { + final int ch = queuedData.charAt(0); + if (queuedData.length() > 1) { + queuedData = queuedData.substring(1); } else { - storedData = null; + queuedData = null; } return ch; } int ch = in.read(); if (ch == beginToken) { - StringBuffer key = new StringBuffer(""); + final StringBuffer key = new StringBuffer(""); do { ch = in.read(); if (ch != -1) { @@ -82,16 +82,16 @@ public final class ReplaceTokens } while (ch != endToken); if (ch == -1) { - storedData = beginToken + key.toString(); + queuedData = beginToken + key.toString(); return read(); } else { key.setLength(key.length() - 1); final String replaceWith = (String) hash.get(key.toString()); if (replaceWith != null) { - storedData = replaceWith; + queuedData = replaceWith; return read(); } else { - storedData = beginToken + key.toString() + endToken; + queuedData = beginToken + key.toString() + endToken; return read(); } }