cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r106909 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
Date Mon, 29 Nov 2004 14:10:09 GMT
Author: lgawron
Date: Mon Nov 29 06:10:06 2004
New Revision: 106909

URL: http://svn.apache.org/viewcvs?view=rev&rev=106909
Log:
fix possible NPE
Modified:
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java?view=diff&rev=106909&p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java&r1=106908&p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java&r2=106909
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
Mon Nov 29 06:10:06 2004
@@ -116,9 +116,6 @@
         continuationsInvalidated = new CounterInstrument("invalidates");
     }
 
-    /**
-     * Get the command sink so that we can be notified of changes
-     */
     public void service(final ServiceManager manager) throws ServiceException {
         this.serviceManager = manager;
     }
@@ -132,11 +129,11 @@
         try {
             final RunnableManager runnableManager = (RunnableManager)serviceManager.lookup(RunnableManager.ROLE);
             runnableManager.execute( new Runnable() {
-                public void run()
-                {
-                    expireContinuations();
-                }
-            }, initialDelay, interval);
+                    public void run()
+                    {
+                        expireContinuations();
+                    }
+                }, initialDelay, interval);
             serviceManager.release(runnableManager);
         } catch (Exception e) {
             getLogger().warn("Could not enqueue continuations expiration task. " +
@@ -203,7 +200,9 @@
         // REVISIT: Is the following check needed to avoid threading issues:
         // return wk only if !(wk.hasExpired) ?
         WebContinuation kont = (WebContinuation) idToWebCont.get(id);
-        return (kont.interpreterMatches(interpreterId)) ? kont : null;
+        if ( kont != null )
+        	return (kont.interpreterMatches(interpreterId)) ? kont : null;
+        return null;
     }
 
     /**
@@ -226,7 +225,7 @@
                                                  WebContinuation parent,
                                                  int ttl,
                                                  String interpreterId,
-                                                 ContinuationsDisposer disposer ) {
+                                                 ContinuationsDisposer disposer) {
 
         char[] result = new char[bytes.length * 2];
         WebContinuation wk = null;

Mime
View raw message