ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umag...@apache.org
Subject cvs commit: jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters ReplaceTokens.java
Date Mon, 18 Feb 2002 01:00:37 GMT
umagesh     02/02/17 17:00:37

  Modified:    proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters
                        ReplaceTokens.java
  Log:
  1.  Use a variable name that better represents the type of data stored.
  2.  Minor code cleanup.
  
  Revision  Changes    Path
  1.2       +11 -11    jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/ReplaceTokens.java
  
  Index: ReplaceTokens.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/ReplaceTokens.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReplaceTokens.java	17 Feb 2002 02:19:25 -0000	1.1
  +++ ReplaceTokens.java	18 Feb 2002 01:00:37 -0000	1.2
  @@ -17,7 +17,7 @@
    *    <param type="tokenchar" name="begintoken" value="#"/>
    *    <param type="tokenchar" name="endtoken" value="#"/>
    *    <param type="token" name="DATE" value="${DATE}"/>
  - * <filterreader>
  + * </filterreader>
    *
    * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
    */
  @@ -29,7 +29,7 @@
   
       private static final char DEFAULT_END_TOKEN = '@';
   
  -    private String storedData = null;
  +    private String queuedData = null;
   
       private Parameter[] parameters;
   
  @@ -59,19 +59,19 @@
               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 @@
               } 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();
                   }
               }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message