You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by lg...@apache.org on 2004/11/29 15:10:09 UTC

svn commit: r106909 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java

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;