cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation FileGenerator.java
Date Tue, 28 May 2002 09:06:33 GMT
cziegeler    02/05/28 02:06:33

  Modified:    src/java/org/apache/cocoon/components/pipeline/impl
                        CachingProcessingPipeline.java
               src/java/org/apache/cocoon/generation FileGenerator.java
  Log:
  Fixed NPE
  
  Revision  Changes    Path
  1.17      +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/CachingProcessingPipeline.java
  
  Index: CachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/CachingProcessingPipeline.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CachingProcessingPipeline.java	28 May 2002 08:55:54 -0000	1.16
  +++ CachingProcessingPipeline.java	28 May 2002 09:06:33 -0000	1.17
  @@ -92,7 +92,7 @@
    *
    * @since @next-version@
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Id: CachingProcessingPipeline.java,v 1.16 2002/05/28 08:55:54 cziegeler
Exp $
  + * @version CVS $Id: CachingProcessingPipeline.java,v 1.17 2002/05/28 09:06:33 cziegeler
Exp $
    */
   public class CachingProcessingPipeline
   extends AbstractProcessingPipeline
  @@ -366,10 +366,10 @@
           while (cachedPipelineKey != null && !finished) {
               finished = true;
               CachedResponse response = this.cache.get( cachedPipelineKey );
  -            this.cachedResponse = response.getResponse();
   
               // now test validity
               if (response != null) {
  +                this.cachedResponse = response.getResponse();
                   boolean responseIsValid = true;
                   boolean responseIsUsable = true;
                   SourceValidity[] validities = response.getValidityObjects();
  
  
  
  1.11      +8 -13     xml-cocoon2/src/java/org/apache/cocoon/generation/FileGenerator.java
  
  Index: FileGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/FileGenerator.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FileGenerator.java	24 May 2002 08:52:33 -0000	1.10
  +++ FileGenerator.java	28 May 2002 09:06:33 -0000	1.11
  @@ -52,13 +52,11 @@
   
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.caching.CacheValidity;
  -import org.apache.cocoon.caching.Cacheable;
  -import org.apache.cocoon.caching.SourceCacheValidity;
  +import org.apache.cocoon.caching.CacheableProcessingComponent;
   import org.apache.cocoon.environment.SourceResolver;
  -import org.apache.cocoon.util.HashUtil;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
  +import org.apache.excalibur.source.SourceValidity;
   import org.xml.sax.SAXException;
   
   import java.io.IOException;
  @@ -74,10 +72,10 @@
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Id: FileGenerator.java,v 1.10 2002/05/24 08:52:33 cziegeler Exp $
  + * @version CVS $Id: FileGenerator.java,v 1.11 2002/05/28 09:06:33 cziegeler Exp $
    */
   public class FileGenerator extends ComposerGenerator
  -implements Cacheable {
  +implements CacheableProcessingComponent {
   
       /** The input source */
       protected Source inputSource;
  @@ -112,8 +110,8 @@
        *
        * @return The generated key hashes the src
        */
  -    public long generateKey() {
  -        return HashUtil.hash(this.inputSource.getSystemId());
  +    public java.io.Serializable generateKey() {
  +        return this.inputSource.getSystemId();
       }
   
       /**
  @@ -122,11 +120,8 @@
        * @return The generated validity object or <code>null</code> if the
        *         component is currently not cacheable.
        */
  -    public CacheValidity generateValidity() {
  -        if (this.inputSource.getValidity() != null) {
  -            return new SourceCacheValidity(this.inputSource.getValidity());
  -        }
  -        return null;
  +    public SourceValidity generateValidity() {
  +        return this.inputSource.getValidity();
       }
   
       /**
  
  
  

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