lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ac2/sitemap SitemapPolicyManager.java
Date Tue, 05 Aug 2003 11:56:02 GMT
andreas     2003/08/05 04:56:02

  Modified:    src/java/org/apache/lenya/cms/ac2/sitemap
                        SitemapPolicyManager.java
  Log:
  releasing source
  
  Revision  Changes    Path
  1.6       +9 -3      cocoon-lenya/src/java/org/apache/lenya/cms/ac2/sitemap/SitemapPolicyManager.java
  
  Index: SitemapPolicyManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ac2/sitemap/SitemapPolicyManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SitemapPolicyManager.java	17 Jul 2003 16:24:20 -0000	1.5
  +++ SitemapPolicyManager.java	5 Aug 2003 11:56:02 -0000	1.6
  @@ -97,19 +97,25 @@
   
           SourceResolver resolver = null;
           Policy policy = null;
  +        Source source = null;
           try {
               resolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);
   
               String policyUrl = publicationId + "/policies" + url + ".acml";
               getLogger().debug("Policy URL: " + policyUrl);
  -            Source source = resolver.resolveURI("cocoon://" + policyUrl);
  +            source = resolver.resolveURI("cocoon://" + policyUrl);
               Document document = DocumentHelper.readDocument(source.getInputStream());
               policy = PolicyBuilder.getInstance().buildPolicy(accreditableManager, document);
   
           } catch (Exception e) {
               throw new AccessControlException(e);
           } finally {
  -            getManager().release(resolver);
  +            if (resolver != null) {
  +                if (source != null) {
  +                    resolver.release(source);
  +                }
  +                getManager().release(resolver);
  +            }
           }
           return policy;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message