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/src/main/org/apache/tools/ant/types/selectors SelectorUtils.java
Date Thu, 21 Nov 2002 22:00:29 GMT
umagesh     2002/11/21 14:00:29

  Modified:    src/main/org/apache/tools/ant/types/selectors
                        SelectorUtils.java
  Log:
  Patch that fix memory leaks in SelectorUtils.java
  
  The method matchPatternStart generates memory leaks due to the 2 Vectors:    patDirs and
strDirs,  used to hold tokenizedPaths.
  
  Submitted by: "Francis ANDRE" <francis.andre@e-xmlmedia.fr>
  
  Revision  Changes    Path
  1.4       +7 -0      jakarta-ant/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java
  
  Index: SelectorUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SelectorUtils.java	25 Jul 2002 15:21:23 -0000	1.3
  +++ SelectorUtils.java	21 Nov 2002 22:00:29 -0000	1.4
  @@ -227,6 +227,7 @@
               }
               if (!match(patDir,(String)strDirs.elementAt(strIdxStart),
                       isCaseSensitive)) {
  +                patDirs = null; strDirs = null;
                   return false;
               }
               patIdxStart++;
  @@ -236,6 +237,7 @@
               // String is exhausted
               for (int i = patIdxStart; i <= patIdxEnd; i++) {
                   if (!patDirs.elementAt(i).equals("**")) {
  +                    patDirs = null; strDirs = null;
                       return false;
                   }
               }
  @@ -243,6 +245,7 @@
           } else {
               if (patIdxStart > patIdxEnd) {
                   // String not exhausted, but pattern is. Failure.
  +                patDirs = null; strDirs = null;
                   return false;
               }
           }
  @@ -255,6 +258,7 @@
               }
               if (!match(patDir,(String)strDirs.elementAt(strIdxEnd),
                       isCaseSensitive)) {
  +                patDirs = null; strDirs = null;
                   return false;
               }
               patIdxEnd--;
  @@ -264,6 +268,7 @@
               // String is exhausted
               for (int i = patIdxStart; i <= patIdxEnd; i++) {
                   if (!patDirs.elementAt(i).equals("**")) {
  +                    patDirs = null; strDirs = null;
                       return false;
                   }
               }
  @@ -303,6 +308,7 @@
               }
   
               if (foundIdx == -1) {
  +                patDirs = null; strDirs = null;
                   return false;
               }
   
  @@ -312,6 +318,7 @@
   
           for (int i = patIdxStart; i <= patIdxEnd; i++) {
               if (!patDirs.elementAt(i).equals("**")) {
  +                patDirs = null; strDirs = null;
                   return false;
               }
           }
  
  
  

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