ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Javadoc.java
Date Sun, 06 Feb 2000 19:28:54 GMT
rubys       00/02/06 11:28:54

  Modified:    src/main/org/apache/tools/ant/taskdefs Javadoc.java
  Log:
  Fixed javadoc so that it doesn't go into an infinite loop on lines such as:
  
      tmpExcludes.addElement("**/"+tok.nextToken().trim()+"/**");
  
  (currently found in org.apache.tools.ant.taskdefs.Copydir)
  
  Revision  Changes    Path
  1.4       +25 -6     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Javadoc.java	2000/02/06 00:26:57	1.3
  +++ Javadoc.java	2000/02/06 19:28:54	1.4
  @@ -554,10 +554,11 @@
       }
   
       /**
  -     * This is a java comment stripper reader that filters comments out
  -     * for more significant java parsing. Since this class heavily relies on
  -     * the single char read function, you are reccomended to make it work
  -     * on top of a buffered reader.
  +     * This is a java comment and string stripper reader that filters 
  +     * these lexical tokens out for purposes of simple Java parsing.
  +     * (if you have more complex Java parsing needs, use a real lexer).
  +     * Since this class heavily relies on the single char read function, 
  +     * you are reccomended to make it work on top of a buffered reader.
        */
       class JavaReader extends FilterReader {
   
  @@ -569,18 +570,36 @@
               int c = in.read();
               if (c == '/') {
                   c = in.read();
  -                if (c == '*') {
  +                if (c == '/') {
  +                    while (c != '\n') c = in.read();
  +                } else if (c == '*') {
                       while (true) {
                           c = in.read();
                           if (c == '*') {
                               c = in.read();
                               if (c == '/') {
  -                                c = in.read();
  +                                c = read();
                                   break;
                               }
                           }
                       }
                   }
  +            }
  +            if (c == '"') {
  +                while (true) {
  +                    c = in.read();
  +                    if (c == '\\') c = in.read();
  +                    if (c == '"') {
  +                        c = read();
  +                        break;
  +                    }
  +                }
  +            }
  +            if (c == '\'') {
  +                c = in.read();
  +                if (c == '\\') c = in.read();
  +                c = in.read();
  +                c = read();
               }
               return c;
           }
  
  
  

Mime
View raw message