Browse Source

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>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273571 13f79535-47bb-0310-9956-ffa450edef68
master
Magesh Umasankar 22 years ago
parent
commit
dba647572b
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java

+ 7
- 0
src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java View File

@@ -227,6 +227,7 @@ public final class SelectorUtils {
}
if (!match(patDir,(String)strDirs.elementAt(strIdxStart),
isCaseSensitive)) {
patDirs = null; strDirs = null;
return false;
}
patIdxStart++;
@@ -236,6 +237,7 @@ public final class SelectorUtils {
// 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 @@ public final class SelectorUtils {
} else {
if (patIdxStart > patIdxEnd) {
// String not exhausted, but pattern is. Failure.
patDirs = null; strDirs = null;
return false;
}
}
@@ -255,6 +258,7 @@ public final class SelectorUtils {
}
if (!match(patDir,(String)strDirs.elementAt(strIdxEnd),
isCaseSensitive)) {
patDirs = null; strDirs = null;
return false;
}
patIdxEnd--;
@@ -264,6 +268,7 @@ public final class SelectorUtils {
// 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 @@ strLoop:
}

if (foundIdx == -1) {
patDirs = null; strDirs = null;
return false;
}

@@ -312,6 +318,7 @@ strLoop:

for (int i = patIdxStart; i <= patIdxEnd; i++) {
if (!patDirs.elementAt(i).equals("**")) {
patDirs = null; strDirs = null;
return false;
}
}


Loading…
Cancel
Save