cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl
Date Thu, 30 Aug 2001 08:45:26 GMT
sylvain     01/08/30 01:45:26

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap/java
                        sitemap.xsl
  Log:
  Ensure matchers and selectors are released even when an exception occurs.
  
  Revision  Changes    Path
  1.37      +11 -9     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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- sitemap.xsl	2001/08/28 13:23:14	1.36
  +++ sitemap.xsl	2001/08/30 08:45:26	1.37
  @@ -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.36 2001/08/28 13:23:14 dims Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.37 2001/08/30 08:45:26 sylvain Exp $
        */
       public class <xsl:value-of select="@file-name"/> extends AbstractSitemap {
         static final String LOCATION = "<xsl:value-of select="translate(@file-path, '/',
'.')"/>.<xsl:value-of select="@file-name"/>";
  @@ -200,22 +200,24 @@
          * 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;
  +        try {
  +          return selector.select(substitute(listOfMaps, testValue), objectModel, params);
  +        } finally {
  +          this.selectors.release(selector);
  +        }
         }
   
         /**
          * 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;
  +        try {
  +          return matcher.match(substitute(listOfMaps, patternValue), objectModel, params);
  +        } finally {
  +          this.matchers.release(matcher);
  +        }
         }
   
   
  
  
  

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


Mime
View raw message