vgritsenko    01/06/21 19:24:33

  Modified:    src/org/apache/cocoon/sitemap ContentAggregator.java
                        AbstractSitemap.java
  Log:
  code cleanup, minor optimization
  
  Revision  Changes    Path
  1.8       +5 -2      xml-cocoon2/src/org/apache/cocoon/sitemap/ContentAggregator.java
  
  Index: ContentAggregator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/ContentAggregator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContentAggregator.java    2001/06/19 21:32:01     1.7
  +++ ContentAggregator.java    2001/06/22 02:24:30     1.8
  @@ -42,7 +42,7 @@
   
   /**
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
  - * @version CVS $Id: ContentAggregator.java,v 1.7 2001/06/19 21:32:01 giacomo Exp $
  + * @version CVS $Id: ContentAggregator.java,v 1.8 2001/06/22 02:24:30 vgritsenko 
Exp $
    */
   public class ContentAggregator extends ContentHandlerWrapper implements Generator, 
Cacheable, Composable {
       /** the current sitemap */
  @@ -158,6 +158,9 @@
                   try {
                       this.environment.pushURI(part.uri);
                       ep.process(this.environment);
  +                } catch (ProcessingException e) {
  +                    // Already reported to log, rethrowing.
  +                    throw e;
                   } catch (Exception e) {
                       getLogger().error("ContentAggregator: cannot process event 
pipeline for URI " + part.uri, e);
                       throw new ProcessingException("ContentAggregator: cannot 
process event pipeline for URI " + part.uri, e);
  @@ -342,8 +345,8 @@
               Component component = (Component)this.partEventPipelines.get(i);
               this.manager.release(component);
           }
  -        this.partEventPipelines.clear();
   
  +        this.partEventPipelines.clear();
           this.currentNS.clear();
           this.xmlConsumer = null;
           this.contentHandler = null;
  
  
  
  1.8       +6 -8      xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java
  
  Index: AbstractSitemap.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractSitemap.java      2001/06/14 16:44:17     1.7
  +++ AbstractSitemap.java      2001/06/22 02:24:31     1.8
  @@ -43,7 +43,7 @@
    * Base class for generated <code>Sitemap</code> classes
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
  - * @version CVS $Revision: 1.7 $ $Date: 2001/06/14 16:44:17 $
  + * @version CVS $Revision: 1.8 $ $Date: 2001/06/22 02:24:31 $
    */
   public abstract class AbstractSitemap extends AbstractLoggable implements Sitemap, 
Disposable, ThreadSafe {
       private Context context;
  @@ -274,20 +274,18 @@
                       throw new PatternException("invalid expression in \"" + expr + 
"\"");
                   }
                   ii = j + 1;
  -                if (j == -1) {
  -                    throw new PatternException("invalid expression in URL " + expr);
  -                }
                   k = list.size() - 1;
                   s = expr.substring(i + 1, j);
  -                l = -1;
  -                while ((l = s.indexOf("../", l + 1)) != -1) {
  +                l = -3;
  +                m = -1;
  +                while ((l = s.indexOf("../", l + 3)) != -1) {
                       k--;
  +                    m = l;
                   }
  -                m = s.lastIndexOf('/');
                   if (m == -1) {
                       result.append(((Object)((Map)list.get(k)).get(s)).toString());
                   } else {
  -                    result.append(((Object)((Map)list.get(k)).get(s.substring(m + 
1))).toString());
  +                    result.append(((Object)((Map)list.get(k)).get(s.substring(m + 
3))).toString());
                   }
                   getLogger().debug("substitute evaluated value for " + ((m == -1) ? 
s : s.substring(m + 1)) + " as " +
                       ((Object)((Map)list.get(k)).get((m == -1) ? s : s.substring(m + 
1))).toString());
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to