ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/filters LineContains.java
Date Tue, 11 Jun 2002 16:08:33 GMT
bodewig     2002/06/11 09:08:32

  Modified:    .        Tag: ANT_15_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/filters Tag: ANT_15_BRANCH
                        LineContains.java
  Log:
  Make <linecontains> use the slightly simpler logic of
  <linecontainsregexp> to determine matching lines - and avoid
  swallowing lines that way.
  
  PR: 9762
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.263.2.34 +2 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.263.2.33
  retrieving revision 1.263.2.34
  diff -u -r1.263.2.33 -r1.263.2.34
  --- WHATSNEW	11 Jun 2002 15:43:33 -0000	1.263.2.33
  +++ WHATSNEW	11 Jun 2002 16:08:32 -0000	1.263.2.34
  @@ -22,6 +22,8 @@
   
   * <xslt>'s outputtype attribute wouldn't do anything.
   
  +* <linecontains> filterreader could swallow lines.
  +
   Other changes:
   --------------
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.2   +5 -8      jakarta-ant/src/main/org/apache/tools/ant/filters/LineContains.java
  
  Index: LineContains.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/LineContains.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- LineContains.java	24 May 2002 13:52:12 -0000	1.4.2.1
  +++ LineContains.java	11 Jun 2002 16:08:32 -0000	1.4.2.2
  @@ -145,22 +145,19 @@
           } else {
               String goodLine = null;
               line = readLine();
  -            while((line != null) && (goodLine == null)) {
  -                goodLine = line;
  +            if (line == null) {
  +                ch = -1;
  +            } else {
                   int containsSize = contains.size();
                   for (int i = 0; i < containsSize; i++) {
                       String containsStr = (String) contains.elementAt(i);
                       if (line.indexOf(containsStr) == -1) {
  -                        goodLine = null;
  +                        line = null;
                           break;
                       }
                   }
  -                line = readLine();
  -            }
  -            if (goodLine != null) {
  -                line = goodLine;
                   return read();
  -            };
  +            }
           }
   
           return ch;
  
  
  

--
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