You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/10/18 01:34:19 UTC

svn commit: r585756 - /cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java

Author: vgritsenko
Date: Wed Oct 17 16:34:18 2007
New Revision: 585756

URL: http://svn.apache.org/viewvc?rev=585756&view=rev
Log:
cleanup

Modified:
    cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java

Modified: cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java?rev=585756&r1=585755&r2=585756&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java (original)
+++ cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java Wed Oct 17 16:34:18 2007
@@ -45,18 +45,15 @@
     }
 
     static private boolean isBookmark(WebContinuation wk) {
-        UserObject userObj = (UserObject)wk.getUserObject();
-        if (userObj == null) {
-            return false;
-        }
-        return userObj.isBookmark;
+        UserObject userObj = (UserObject) wk.getUserObject();
+        return userObj != null && userObj.isBookmark;
     }
 
+
     public FOM_WebContinuation() {
         this(null);
     }
 
-
     public FOM_WebContinuation(WebContinuation wk) {
         this.wk = wk;
     }
@@ -67,21 +64,21 @@
     public static Object jsConstructor(Context cx, Object[] args,
                                        Function ctorObj,
                                        boolean inNewExpr)
-        throws Exception {
-        FOM_WebContinuation result = null;
+    throws Exception {
         if (args.length < 1) {
             // error
         }
-        Continuation c = (Continuation)unwrap(args[0]);
+        Continuation c = (Continuation) unwrap(args[0]);
         FOM_WebContinuation parent = null;
         if (args.length > 1) {
-            parent = (FOM_WebContinuation)args[1];
+            parent = (FOM_WebContinuation) args[1];
         }
         int timeToLive = 0;
         if (args.length > 2) {
             timeToLive =
-                (int)org.mozilla.javascript.Context.toNumber(args[2]);
+                    (int) org.mozilla.javascript.Context.toNumber(args[2]);
         }
+
         WebContinuation wk;
         Scriptable scope = getTopLevelScope(c);
         FOM_Cocoon cocoon = (FOM_Cocoon)getProperty(scope, "cocoon");
@@ -91,6 +88,8 @@
                                            timeToLive,
                                            cocoon.getInterpreterId(), 
                                            null);
+
+        FOM_WebContinuation result;
         result = new FOM_WebContinuation(wk);
         result.setParentScope(getTopLevelScope(scope));
         result.setPrototype(getClassPrototype(scope, result.getClassName()));