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/components/profiler ProfilingCachingProcessingPipeline.java ProfilingNonCachingProcessingPipeline.java
Date Tue, 25 Jun 2002 06:09:01 GMT
cziegeler    2002/06/24 23:09:01

  Modified:    src/java/org/apache/cocoon/components/profiler
                        ProfilingCachingProcessingPipeline.java
                        ProfilingNonCachingProcessingPipeline.java
  Log:
  Fixed NPE in profiling code
  
  Revision  Changes    Path
  1.2       +17 -12    xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
  
  Index: ProfilingCachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProfilingCachingProcessingPipeline.java	28 May 2002 07:11:44 -0000	1.1
  +++ ProfilingCachingProcessingPipeline.java	25 Jun 2002 06:09:01 -0000	1.2
  @@ -111,17 +111,22 @@
   
       public boolean process(Environment environment)
       throws ProcessingException {
  -        this.data.addComponent(super.lastConsumer, null, null);
  -        environment.getObjectModel().put("profiler", data);
  +        // FIXME - If a reader is used, data is not set
  +        if (this.data != null) {
  +            this.data.addComponent(super.lastConsumer, null, null);
  +            environment.getObjectModel().put("profiler", data);
   
  -        // Execute pipeline
  -        long time = System.currentTimeMillis();
  -        boolean result = super.process(environment);
  -        this.data.setTime(0, System.currentTimeMillis() - time);
  +            // Execute pipeline
  +            long time = System.currentTimeMillis();
  +            boolean result = super.process(environment);
  +            this.data.setTime(0, System.currentTimeMillis() - time);
   
  -        // Report
  -        profiler.addResult(environment.getURI(), data);
  -        return result;
  +            // Report
  +            profiler.addResult(environment.getURI(), data);
  +            return result;
  +        } else {
  +            return super.process( environment );
  +        }
       }
   
       public void recycle() {
  
  
  
  1.2       +17 -12    xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
  
  Index: ProfilingNonCachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProfilingNonCachingProcessingPipeline.java	28 May 2002 07:11:44 -0000	1.1
  +++ ProfilingNonCachingProcessingPipeline.java	25 Jun 2002 06:09:01 -0000	1.2
  @@ -110,17 +110,22 @@
   
       public boolean process(Environment environment)
       throws ProcessingException {
  -        this.data.addComponent(super.lastConsumer, null, null);
  -        environment.getObjectModel().put("profiler", data);
  +        // FIXME - If a reader is used, data is not set
  +        if (this.data != null) {
  +            this.data.addComponent(super.lastConsumer, null, null);
  +            environment.getObjectModel().put("profiler", data);
   
  -        // Execute pipeline
  -        long time = System.currentTimeMillis();
  -        boolean result = super.process(environment);
  -        this.data.setTime(0, System.currentTimeMillis() - time);
  +            // Execute pipeline
  +            long time = System.currentTimeMillis();
  +            boolean result = super.process(environment);
  +            this.data.setTime(0, System.currentTimeMillis() - time);
   
  -        // Report
  -        profiler.addResult(environment.getURI(), data);
  -        return result;
  +            // Report
  +            profiler.addResult(environment.getURI(), data);
  +            return result;
  +        } else {
  +            return super.process( environment );
  +        }
       }
   
       public void recycle() {
  
  
  

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