cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r123786 - in cocoon/trunk/src: blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib blocks/forms/java/org/apache/cocoon/forms/binding blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2 blocks/petstore/java/org/apache/cocoon/components/flow/javascript java/org/apache/cocoon/acting java/org/apache/cocoon/components/treeprocessor/sitemap
Date Fri, 31 Dec 2004 11:50:40 GMT
Author: antonio
Date: Fri Dec 31 03:50:37 2004
New Revision: 123786

URL: http://svn.apache.org/viewcvs?view=rev&rev=123786
Log:
Don't create Booleans
Modified:
   cocoon/trunk/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib/MapTag.java
   cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
   cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2/ScriptableWidget.java
   cocoon/trunk/src/blocks/petstore/java/org/apache/cocoon/components/flow/javascript/ScriptableResult.java
   cocoon/trunk/src/java/org/apache/cocoon/acting/PropagatorAction.java
   cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java

Modified: cocoon/trunk/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib/MapTag.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib/MapTag.java?view=diff&rev=123786&p1=cocoon/trunk/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib/MapTag.java&r1=123785&p2=cocoon/trunk/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib/MapTag.java&r2=123786
==============================================================================
--- cocoon/trunk/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib/MapTag.java
(original)
+++ cocoon/trunk/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/taglib/MapTag.java
Fri Dec 31 03:50:37 2004
@@ -43,6 +43,7 @@
 import org.apache.cocoon.faces.taglib.UIComponentTag;
 import org.apache.cocoon.faces.samples.components.components.MapComponent;
 import org.apache.cocoon.faces.samples.components.renderkit.Util;
+import org.apache.commons.lang.BooleanUtils;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -165,8 +166,7 @@
                     createValueBinding(immediate);
                 map.setValueBinding("immediate", vb);
             } else {
-                boolean _immediate = new Boolean(immediate).booleanValue();
-                map.setImmediate(_immediate);
+                map.setImmediate(BooleanUtils.toBoolean(immediate));
             }
         }
 

Modified: cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java?view=diff&rev=123786&p1=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java&r1=123785&p2=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java&r2=123786
==============================================================================
--- cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
(original)
+++ cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
Fri Dec 31 03:50:37 2004
@@ -18,6 +18,7 @@
 import org.apache.avalon.framework.logger.LogEnabled;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.cocoon.forms.util.DomHelper;
+import org.apache.commons.lang.BooleanUtils;
 import org.w3c.dom.Element;
 
 /**
@@ -168,13 +169,10 @@
          * Interpretes the value of the lenient attribute into a Boolean object
          * allowing three-state logic (true/false/unset)
          * @param leniency value of the @lenient attribute
-         * @return null if the leniency parameter is String, otherwise the
+         * @return null if the leniency parameter is is null or a String otherwise the allowed
values
          */
         private static Boolean decideLeniency(String leniency) {
-            if (leniency == null) {
-                return null;
-            }
-            return new Boolean(leniency);
+            return BooleanUtils.toBooleanObject(leniency);
         }
     }
 }

Modified: cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2/ScriptableWidget.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2/ScriptableWidget.java?view=diff&rev=123786&p1=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2/ScriptableWidget.java&r1=123785&p2=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2/ScriptableWidget.java&r2=123786
==============================================================================
--- cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2/ScriptableWidget.java
(original)
+++ cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v2/ScriptableWidget.java
Fri Dec 31 03:50:37 2004
@@ -38,6 +38,7 @@
 import org.apache.cocoon.forms.formmodel.WidgetState;
 import org.apache.cocoon.forms.validation.ValidationError;
 import org.apache.cocoon.forms.validation.ValidationErrorAware;
+import org.apache.commons.lang.BooleanUtils;
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.JavaScriptException;
 import org.mozilla.javascript.NativeArray;
@@ -393,7 +394,7 @@
             delegate.setValue(value);
         } else if (delegate instanceof BooleanField) {
             BooleanField field = (BooleanField)delegate;
-            field.setValue(new Boolean(Context.toBoolean(value)));
+            field.setValue(BooleanUtils.toBooleanObject(Context.toBoolean(value)));
         } else if (delegate instanceof Repeater) {
             Repeater repeater = (Repeater)delegate;
             if (value instanceof NativeArray) {

Modified: cocoon/trunk/src/blocks/petstore/java/org/apache/cocoon/components/flow/javascript/ScriptableResult.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/petstore/java/org/apache/cocoon/components/flow/javascript/ScriptableResult.java?view=diff&rev=123786&p1=cocoon/trunk/src/blocks/petstore/java/org/apache/cocoon/components/flow/javascript/ScriptableResult.java&r1=123785&p2=cocoon/trunk/src/blocks/petstore/java/org/apache/cocoon/components/flow/javascript/ScriptableResult.java&r2=123786
==============================================================================
--- cocoon/trunk/src/blocks/petstore/java/org/apache/cocoon/components/flow/javascript/ScriptableResult.java
(original)
+++ cocoon/trunk/src/blocks/petstore/java/org/apache/cocoon/components/flow/javascript/ScriptableResult.java
Fri Dec 31 03:50:37 2004
@@ -19,6 +19,7 @@
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 
+import org.apache.commons.lang.BooleanUtils;
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.JavaScriptException;
 import org.mozilla.javascript.NotAFunctionException;
@@ -28,7 +29,7 @@
 
 /**
  *
- * @version CVS $Id: ScriptableResult.java,v 1.4 2004/03/05 13:02:03 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class ScriptableResult extends ScriptableObject {
 
@@ -114,7 +115,7 @@
             index++;
         }
         put("rowCount", this, new Integer(index));
-        put("isLimitedByMaxRows", this, new Boolean(isLimited));
+        put("isLimitedByMaxRows", this, BooleanUtils.toBooleanObject(isLimited));
     }
 }
 

Modified: cocoon/trunk/src/java/org/apache/cocoon/acting/PropagatorAction.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/acting/PropagatorAction.java?view=diff&rev=123786&p1=cocoon/trunk/src/java/org/apache/cocoon/acting/PropagatorAction.java&r1=123785&p2=cocoon/trunk/src/java/org/apache/cocoon/acting/PropagatorAction.java&r2=123786
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/acting/PropagatorAction.java	(original)
+++ cocoon/trunk/src/java/org/apache/cocoon/acting/PropagatorAction.java	Fri Dec 31 03:50:37
2004
@@ -25,6 +25,7 @@
 import org.apache.cocoon.components.modules.output.OutputModule;
 import org.apache.cocoon.environment.Redirector;
 import org.apache.cocoon.environment.SourceResolver;
+import org.apache.commons.lang.BooleanUtils;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -111,7 +112,7 @@
  *
  * @author <a href="mailto:haul@apache.org">Christian Haul</a>
  * @author <a href="mailto:Martin.Man@seznam.cz">Martin Man</a>
- * @version CVS $Id: PropagatorAction.java,v 1.3 2004/03/05 13:02:43 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class PropagatorAction
 	extends  ServiceableAction
@@ -195,10 +196,9 @@
 		String outputName =
 			param.getParameter(ACTION_PREFIX + CONFIG_OUTPUT_MODULE, null);
 		Boolean storeEmpty =
-			new Boolean(
+			BooleanUtils.toBooleanObject(
 				param.getParameterAsBoolean(
-					ACTION_PREFIX + CONFIG_STORE_EMPTY,
-					this.storeEmpty));
+					ACTION_PREFIX + CONFIG_STORE_EMPTY, this.storeEmpty));
 		param.removeParameter(ACTION_PREFIX + CONFIG_OUTPUT_MODULE);
 		param.removeParameter(ACTION_PREFIX + CONFIG_STORE_EMPTY);
 		return new Object[] { outputName, storeEmpty };

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java?view=diff&rev=123786&p1=cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java&r1=123785&p2=cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java&r2=123786
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
(original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
Fri Dec 31 03:50:37 2004
@@ -27,6 +27,7 @@
 import org.apache.cocoon.components.treeprocessor.TreeProcessor;
 import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
 import org.apache.cocoon.environment.Environment;
+import org.apache.commons.lang.BooleanUtils;
 
 /**
  *
@@ -37,7 +38,7 @@
 public class MountNode extends AbstractProcessingNode
                        implements Disposable {
 
-    /** The  key to get the pass_through value fron the Environment*/
+    /** The key to get the pass_through value from the Environment*/
     protected final static String COCOON_PASS_THROUGH = "COCOON_PASS_THROUGH";
 
 
@@ -92,7 +93,7 @@
         String oldPrefix = env.getURIPrefix();
         String oldURI    = env.getURI();
         Object oldPassThrough = env.getAttribute(COCOON_PASS_THROUGH);
-        env.setAttribute(COCOON_PASS_THROUGH, new Boolean(passThrough));
+        env.setAttribute(COCOON_PASS_THROUGH, BooleanUtils.toBooleanObject(passThrough));
 
         try {
             processor.getEnvironmentHelper().changeContext(env);

Mime
View raw message