Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 79193 invoked by uid 500); 28 Aug 2001 13:24:08 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 79182 invoked by uid 500); 28 Aug 2001 13:24:08 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 28 Aug 2001 13:23:35 -0000 Message-ID: <20010828132335.98586.qmail@icarus.apache.org> From: dims@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N dims 01/08/28 06:23:35 Modified: src/org/apache/cocoon/components/language/markup/sitemap/java Tag: cocoon_20_branch sitemap.xsl Log: Patch for "memory leak that affects Matchers and Selectors" from Christian Schmitt Revision Changes Path No revision No revision 1.11.2.28 +27 -4 xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl Index: sitemap.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v retrieving revision 1.11.2.27 retrieving revision 1.11.2.28 diff -u -r1.11.2.27 -r1.11.2.28 --- sitemap.xsl 2001/08/16 07:49:35 1.11.2.27 +++ sitemap.xsl 2001/08/28 13:23:35 1.11.2.28 @@ -124,7 +124,7 @@ * * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a> * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a> - * @version CVS $Id: sitemap.xsl,v 1.11.2.27 2001/08/16 07:49:35 cziegeler Exp $ + * @version CVS $Id: sitemap.xsl,v 1.11.2.28 2001/08/28 13:23:35 dims Exp $ */ public class extends AbstractSitemap { static final String LOCATION = "."; @@ -197,6 +197,29 @@ /** + * Method that handles non-factory selectors. + */ + private boolean isSelected(String hint, String testValue, List listOfMaps, Parameters params, Map objectModel) throws Exception { + boolean retVal; + Selector selector = (Selector)this.selectors.select(hint); + retVal = selector.select(substitute(listOfMaps, testValue), objectModel, params); + this.selectors.release(selector); + return retVal; + } + + /** + * Method that handles non-factory matchers. + */ + private Map matches(String hint, String patternValue, List listOfMaps, Parameters params, Map objectModel) throws Exception { + Map map; + Matcher matcher = (Matcher)this.matchers.select(hint); + map = matcher.match(substitute(listOfMaps, patternValue), objectModel, params); + this.matchers.release(matcher); + return map; + } + + + /** * Pass a <code>Configuration</code> instance to this * <code>Configurable</code> class. */ @@ -646,12 +669,11 @@ Match(_expr, objectModel, ) - ((Matcher)this.matchers.select("")).match(substitute(listOfMaps,""), objectModel, ) + matches("", "", listOfMaps, , objectModel) - // handling "" if ((map = ) != null) { @@ -842,10 +864,11 @@ Select(_expr, objectModel, ) - ((Selector)this.selectors.select("")).select(substitute(listOfMaps,""), objectModel, ) + isSelected("", "", listOfMaps, , objectModel) + ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org