cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r123788 - in cocoon/branches/BRANCH_2_1_X/src: blocks/batik/java/org/apache/cocoon/serialization blocks/databases/java/org/apache/cocoon/util blocks/lucene/java/org/apache/cocoon/bean/query blocks/mail/java/org/apache/cocoon/mail/transformation blocks/naming/java/org/apache/cocoon/transformation blocks/portal/java/org/apache/cocoon/portal/coplets/basket blocks/portal/java/org/apache/cocoon/portal/pluto/om/common blocks/portal/java/org/apache/cocoon/portal/transformation blocks/qdox/java/org/apache/cocoon/components/source/impl blocks/scratchpad/java/org/apache/cocoon/transformation/constrained blocks/taglib/java/org/apache/cocoon/taglib/core blocks/velocity/java/org/apache/cocoon/generation java/org/apache/cocoon/components/crawler java/org/apache/cocoon/generation java/org/apache/cocoon/serialization java/org/apache/cocoon/transformation java/org/apache/cocoon/util
Date Fri, 31 Dec 2004 12:43:01 GMT
Author: antonio
Date: Fri Dec 31 04:43:00 2004
New Revision: 123788

URL: http://svn.apache.org/viewcvs?view=rev&rev=123788
Log:
Don't create unnecesary Booleans, Strings. Don't use unnnecesary toString()
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/serialization/SVGSerializer.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneCriterionBean.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneQueryBean.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/transformation/LDAPTransformer.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketTransformer.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/PreferenceImpl.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/AbstractConstrainedTransformer.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/ElementValueEvent.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/XmlTreeConstraint.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/taglib/java/org/apache/cocoon/taglib/core/ForEachSupport.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/velocity/java/org/apache/cocoon/generation/VelocityGenerator.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/Tokenizer.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/serialization/SVGSerializer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/serialization/SVGSerializer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/serialization/SVGSerializer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/serialization/SVGSerializer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/serialization/SVGSerializer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/serialization/SVGSerializer.java
Fri Dec 31 04:43:00 2004
@@ -40,6 +40,7 @@
 import org.apache.cocoon.components.url.ParsedResourceURLProtocolHandler;
 import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.xml.dom.SVGBuilder;
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.NOPValidity;
 import org.w3c.dom.Document;
@@ -50,7 +51,7 @@
  *
  * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  * @author <a href="mailto:rossb@apache.org">Ross Burton</a>
- * @version CVS $Id: SVGSerializer.java,v 1.16 2004/03/28 05:29:04 antonio Exp $
+ * @version CVS $Id$
  */
 public class SVGSerializer extends SVGBuilder
 implements Serializer, Configurable, Poolable, CacheableProcessingComponent, Contextualizable
{
@@ -164,7 +165,7 @@
                     value = new Integer(parameters[i].getAttributeAsInteger("value"));
                 } else if ("BOOLEAN".equals(keyType)) {
                     // Can throw an exception.
-                    value = new Boolean(parameters[i].getAttributeAsBoolean("value"));
+                    value = BooleanUtils.toBooleanObject(parameters[i].getAttributeAsBoolean("value"));
                 } else if ("COLOR".equals(keyType)) {
                     // Can throw an exception
                     String stringValue = parameters[i].getAttribute("value");

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java
Fri Dec 31 04:43:00 2004
@@ -39,6 +39,7 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.cocoon.servlet.multipart.Part;
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.excalibur.source.Source;
 
 
@@ -77,7 +78,7 @@
  * <tr><td>object     </td><td>Object      </td><td>
       </td><td>Object       </td></tr>
  * </table></p>
  *
- * @version CVS $Id: JDBCTypeConversions.java,v 1.7 2004/03/05 13:01:55 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class JDBCTypeConversions {
     public static final Map typeConstants;
@@ -207,7 +208,7 @@
             value = set.getArray(dbcol); // new Integer(set.getInt(dbcol));
             break;
         case Types.BIT:
-            value = new Boolean(set.getBoolean(dbcol));
+            value = BooleanUtils.toBooleanObject(set.getBoolean(dbcol));
             break;
         case Types.STRUCT:
             value = (Struct) set.getObject(dbcol);
@@ -517,8 +518,8 @@
             Integer i = null;
             if (value instanceof Integer) {
                 i = (Integer) value;
-            } else if (value instanceof java.lang.Number) {
-                i = new Integer(((java.lang.Number) value).intValue());
+            } else if (value instanceof Number) {
+                i = new Integer(((Number) value).intValue());
             } else {
                 i = new Integer(value.toString());
             }
@@ -528,21 +529,19 @@
             //System.out.println("BIT");
             Boolean bo = null;
             if (value instanceof Boolean) {
-                bo = (Boolean) value;
-            } else if (value instanceof java.lang.Number) {
-                bo = new Boolean(((java.lang.Number) value).intValue()==1);
+                bo = (Boolean)value;
+            } else if (value instanceof Number) {
+                bo = BooleanUtils.toBooleanObject(((Number) value).intValue()==1);
             } else {
-                bo = new Boolean(value.toString());
+                bo = BooleanUtils.toBooleanObject(value.toString());
             }
             statement.setBoolean(position, bo.booleanValue());
             break;
-            
+
         default:
             //System.out.println("default");
             throw new SQLException("Impossible exception - invalid type ");
         }
         //System.out.println("========================================================================");
     }
-    
-    
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneCriterionBean.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneCriterionBean.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneCriterionBean.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneCriterionBean.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneCriterionBean.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneCriterionBean.java
Fri Dec 31 04:43:00 2004
@@ -90,9 +90,9 @@
 	 */
 	public SimpleLuceneCriterionBean copy () {
 		SimpleLuceneCriterionBean criterion = new SimpleLuceneCriterionBean ();
-		if (mField != null) criterion.setField (new String (mField));
-		if (mMatch != null) criterion.setMatch (new String (mMatch));
-		if (mValue != null) criterion.setValue (new String (mValue));
+		if (mField != null) criterion.setField(mField);
+		if (mMatch != null) criterion.setMatch(mMatch);
+		if (mValue != null) criterion.setValue(mValue);
 		return criterion;
 	}
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneQueryBean.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneQueryBean.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneQueryBean.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneQueryBean.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneQueryBean.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/java/org/apache/cocoon/bean/query/SimpleLuceneQueryBean.java
Fri Dec 31 04:43:00 2004
@@ -142,9 +142,9 @@
 	 */
 	public SimpleLuceneQuery copy() {
 		SimpleLuceneQueryBean query = new SimpleLuceneQueryBean ();
-		if (mName != null) query.setName (new String (mName));
-		if (mType != null) query.setType (new String (mType));
-		if (mBool != null) query.setBool (new String (mBool));
+		if (mName != null) query.setName(mName);
+		if (mType != null) query.setType(mType);
+		if (mBool != null) query.setBool(mBool);
 		query.setSize (DEFAULT_PAGE_SIZE);
 		query.setPage (new Long (0));
 		query.setTotal (null);

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
Fri Dec 31 04:43:00 2004
@@ -323,7 +323,7 @@
 
             String mType = attr.getValue("mime-type");
             if (mType != null) {
-                this.bodyMimeType = new String(mType);
+                this.bodyMimeType = mType;
             } else {
                 this.bodyMimeType = DEFAULT_BODY_MIMETYPE;
             }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/transformation/LDAPTransformer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/transformation/LDAPTransformer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/transformation/LDAPTransformer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/transformation/LDAPTransformer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/transformation/LDAPTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/transformation/LDAPTransformer.java
Fri Dec 31 04:43:00 2004
@@ -99,7 +99,7 @@
  * @author Felix Knecht
  * @author <a href="mailto:unico@hippo.nl">Unico Hommes</a>
  * @author <a href="mailto:yuryx@mobicomk.donpac.ru">Yury Mikhienko</a>
- * @version CVS $Id: LDAPTransformer.java,v 1.8 2004/03/05 13:02:01 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class LDAPTransformer extends AbstractTransformer {
 
@@ -1837,7 +1837,7 @@
 
                                                 /* confirm of success */
                                                 transformer.start(attrID, attr);
-                                                transformer.data(new String("replaced"));
+                                                transformer.data("replaced");
                                                 transformer.end(attrID);
                                             }
                                         }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketTransformer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketTransformer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketTransformer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketTransformer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketTransformer.java
Fri Dec 31 04:43:00 2004
@@ -27,6 +27,7 @@
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.transformation.AbstractSAXTransformer;
 import org.apache.cocoon.xml.AttributesImpl;
+import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
@@ -93,10 +94,7 @@
     throws ProcessingException, IOException, SAXException {
         if ( ADD_ITEM_ELEMENT.equals(name) ) {
             String value = attr.getValue("content");
-            boolean addContent = false;
-            if ( value != null ) {
-                addContent = new Boolean(value).booleanValue();
-            }
+            boolean addContent = BooleanUtils.toBoolean(value);
             String href = attr.getValue("href");
             PortalService service = null;
             try {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/PreferenceImpl.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/PreferenceImpl.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/PreferenceImpl.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/PreferenceImpl.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/PreferenceImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/PreferenceImpl.java
Fri Dec 31 04:43:00 2004
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.pluto.om.common.Preference;
 import org.apache.pluto.om.common.PreferenceCtrl;
 import org.apache.pluto.util.StringUtils;
@@ -114,7 +115,7 @@
     }
 
     public void setReadOnly(String readOnly) {
-        this.readOnly = new Boolean(readOnly);
+        this.readOnly = BooleanUtils.toBooleanObject(readOnly);
     }
 
     // additional methods.
@@ -122,10 +123,7 @@
     // internal methods only used by castor
 
     public String getReadOnly() {
-        if (readOnly == null) {
-            return Boolean.FALSE.toString();
-        }
-        return readOnly.toString();
+        return BooleanUtils.toStringTrueFalse(BooleanUtils.toBoolean(readOnly));
     }
 
     public Collection getCastorValues() {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java
Fri Dec 31 04:43:00 2004
@@ -25,6 +25,7 @@
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.transformation.AbstractTransformer;
 import org.apache.cocoon.xml.XMLUtils;
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.NOPValidity;
 import org.xml.sax.Attributes;
@@ -138,7 +139,7 @@
      * @see org.apache.cocoon.caching.CacheableProcessingComponent#getKey()
      */
     public Serializable getKey() {
-        return new Boolean[] { new Boolean(this.addMode), new Boolean(this.ignoreRootElement)};
+        return new Boolean[] { BooleanUtils.toBooleanObject(this.addMode), BooleanUtils.toBooleanObject(this.ignoreRootElement)};
     }
 
     /* (non-Javadoc)

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java
Fri Dec 31 04:43:00 2004
@@ -869,7 +869,7 @@
             outputSuperClassInheritance(handler, jClass, INTERFACE_INHERITANCE);
 
             for (int i=0; i<interfaces.length; i++) {
-                String name = interfaces[i].getValue().toString();
+                String name = interfaces[i].getValue();
                 String pckg = name.substring(0, name.lastIndexOf('.'));
                 name = name.substring(pckg.length() + 1);
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/AbstractConstrainedTransformer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/AbstractConstrainedTransformer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/AbstractConstrainedTransformer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/AbstractConstrainedTransformer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/AbstractConstrainedTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/AbstractConstrainedTransformer.java
Fri Dec 31 04:43:00 2004
@@ -28,6 +28,7 @@
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.transformation.AbstractTransformer;
 import org.apache.cocoon.xml.XMLConsumer;
+import org.apache.commons.lang.BooleanUtils;
 
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
@@ -42,7 +43,7 @@
  *
  * @author     <a href="mailto:nicolaken@apache.org">Nicola Ken Barozzi</a>
  * @author     <a href="mailto:tom.klaasen@pandora.be">Tom Klaasen</a>
- * @version CVS $Id: AbstractConstrainedTransformer.java,v 1.4 2004/03/05 10:07:26 bdelacretaz
Exp $
+ * @version CVS $Id$
  */
 public abstract class AbstractConstrainedTransformer
 		 extends AbstractTransformer {
@@ -169,7 +170,7 @@
 
 			while (constraintsIter.hasNext()) {
 				if (((XmlTreeConstraint) constraintsIter.next())
-						.isAllowed(new Boolean(isMyUri), this.myUriOpenElements,
+						.isAllowed(BooleanUtils.toBooleanObject(isMyUri), this.myUriOpenElements,
 						this.globalOpenElements)) {
 					return;
 				}
@@ -205,7 +206,7 @@
 					currentConstraint =
 							(XmlTreeConstraint) constraintsIter.next();
 					isAllowed =
-							currentConstraint.isAllowed(new Boolean(isMyUri),
+							currentConstraint.isAllowed(BooleanUtils.toBooleanObject(isMyUri),
 							this.myUriOpenElements,
 							this.globalOpenElements);
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/ElementValueEvent.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/ElementValueEvent.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/ElementValueEvent.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/ElementValueEvent.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/ElementValueEvent.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/ElementValueEvent.java
Fri Dec 31 04:43:00 2004
@@ -20,7 +20,7 @@
 /**
  *
  * @author <a href="mailto:nicolaken@apache.org">Nicola Ken Barozzi</a> 
- * @version CVS $Id: ElementValueEvent.java,v 1.3 2004/03/05 10:07:26 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class ElementValueEvent extends ContainerElementEndEvent {
 
@@ -48,6 +48,6 @@
     }
 
     public String getAttribute(String attributeName) {
-        return elementAttributes.getValue(attributeName).toString();
+        return elementAttributes.getValue(attributeName);
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/XmlTreeConstraint.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/XmlTreeConstraint.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/XmlTreeConstraint.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/XmlTreeConstraint.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/XmlTreeConstraint.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/constrained/XmlTreeConstraint.java
Fri Dec 31 04:43:00 2004
@@ -19,9 +19,11 @@
 import java.util.List;
 import java.util.ListIterator;
 
+import org.apache.commons.lang.BooleanUtils;
+
 /**
  * @author <a href="mailto:nicolaken@apache.org">Nicola Ken Barozzi</a>
- * @version CVS $Id: XmlTreeConstraint.java,v 1.4 2004/03/05 10:07:26 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class XmlTreeConstraint {
 
@@ -60,14 +62,14 @@
 
 		this.allowedMyUriStackEnd = Arrays.asList(allowedMyUriStackEnd);
 		this.allowedGlobalStackEnd = Arrays.asList(allowedGlobalStackEnd);
-		this.isMyUriRequired = new Boolean(isMyUriRequired);
+		this.isMyUriRequired = BooleanUtils.toBooleanObject(isMyUriRequired);
 	}
 
 
 	public XmlTreeConstraint(String[] allowedMyUriStackEnd,
 			boolean isMyUriRequired) {
 		this.allowedMyUriStackEnd = Arrays.asList(allowedMyUriStackEnd);
-		this.isMyUriRequired = new Boolean(isMyUriRequired);
+		this.isMyUriRequired = BooleanUtils.toBooleanObject(isMyUriRequired);
 	}
 
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/taglib/java/org/apache/cocoon/taglib/core/ForEachSupport.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/taglib/java/org/apache/cocoon/taglib/core/ForEachSupport.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/taglib/java/org/apache/cocoon/taglib/core/ForEachSupport.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/taglib/java/org/apache/cocoon/taglib/core/ForEachSupport.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/taglib/java/org/apache/cocoon/taglib/core/ForEachSupport.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/taglib/java/org/apache/cocoon/taglib/core/ForEachSupport.java
Fri Dec 31 04:43:00 2004
@@ -24,6 +24,7 @@
 import java.util.Map;
 import java.util.StringTokenizer;
 
+import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.SAXException;
 
 /**
@@ -45,7 +46,7 @@
  * @see org.apache.taglibs.standard.tag.common.core
  * 
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
- * @version CVS $Id: ForEachSupport.java,v 1.3 2004/03/05 13:02:24 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public abstract class ForEachSupport extends LoopTagSupport {
 
@@ -253,7 +254,7 @@
     protected ForEachIterator toForEachIterator(boolean[] a) {
         Boolean[] wrapped = new Boolean[a.length];
         for (int i = 0; i < a.length; i++)
-            wrapped[i] = new Boolean(a[i]);
+            wrapped[i] = BooleanUtils.toBooleanObject(a[i]);
         return new SimpleForEachIterator(Arrays.asList(wrapped).iterator());
     }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/velocity/java/org/apache/cocoon/generation/VelocityGenerator.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/velocity/java/org/apache/cocoon/generation/VelocityGenerator.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/velocity/java/org/apache/cocoon/generation/VelocityGenerator.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/velocity/java/org/apache/cocoon/generation/VelocityGenerator.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/velocity/java/org/apache/cocoon/generation/VelocityGenerator.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/velocity/java/org/apache/cocoon/generation/VelocityGenerator.java
Fri Dec 31 04:43:00 2004
@@ -152,7 +152,7 @@
  * element. The prefix '&lt;name&gt;.resource.loader.' is
  * automatically added to the property name.</dd>
  *
- * @version CVS $Id: VelocityGenerator.java,v 1.14 2004/03/06 00:09:52 joerg Exp $
+ * @version CVS $Id$
  */
 public class VelocityGenerator extends ServiceableGenerator
         implements Initializable, Configurable, LogSystem {
@@ -932,7 +932,7 @@
                             return kont;
                         }
                         if (handler != null) {
-                            return handler.getProperty(bean, key.toString());
+                            return handler.getProperty(bean, key);
                         } else {
                             for (int i = 0; i < props.length; i++) {
                                 if (props[i].getName().equals(key)) {

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java
Fri Dec 31 04:43:00 2004
@@ -41,7 +41,7 @@
  * A simple cocoon crawler.
  *
  * @author     <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
- * @version CVS $Id: SimpleCocoonCrawlerImpl.java,v 1.5 2004/03/28 14:28:04 antonio Exp $
+ * @version CVS $Id$
  */
 public class SimpleCocoonCrawlerImpl extends AbstractLogEnabled
 implements CocoonCrawler, Configurable, Disposable, Recyclable {
@@ -511,8 +511,8 @@
         if (excludeCrawlingURL == null) {
             return false;
         }
-        
-        final String s = url.toString();
+
+        final String s = url;
         Iterator i = excludeCrawlingURL.iterator();
         while (i.hasNext()) {
             RE pattern = (RE) i.next();
@@ -541,8 +541,8 @@
         if (includeCrawlingURL == null) {
             return true;
         }
-        
-        final String s = url.toString();
+
+        final String s = url;
         Iterator i = includeCrawlingURL.iterator();
         while (i.hasNext()) {
             RE pattern = (RE) i.next();
@@ -568,7 +568,7 @@
      * </p>
      *
      * @author     <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
-     * @version    $Id: SimpleCocoonCrawlerImpl.java,v 1.5 2004/03/28 14:28:04 antonio Exp
$
+     * @version    $Id$
      */
     public static class CocoonCrawlerIterator implements Iterator {
         private SimpleCocoonCrawlerImpl cocoonCrawler;

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java
Fri Dec 31 04:43:00 2004
@@ -601,7 +601,7 @@
             return false;
         }
 
-        final String s = url.toString();
+        final String s = url;
         Iterator i = excludeCrawlingURL.iterator();
         while (i.hasNext()) {
             RE pattern = (RE) i.next();
@@ -635,7 +635,7 @@
             return true;
         }
 
-        final String s = url.toString();
+        final String s = url;
         Iterator i = includeCrawlingURL.iterator();
         while (i.hasNext()) {
             RE pattern = (RE) i.next();

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
Fri Dec 31 04:43:00 2004
@@ -27,6 +27,7 @@
 import org.apache.cocoon.util.TraxErrorHandler;
 import org.apache.cocoon.xml.AbstractXMLPipe;
 import org.apache.cocoon.xml.XMLConsumer;
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.NOPValidity;
 import org.xml.sax.Attributes;
@@ -348,7 +349,7 @@
 
             getLogger().debug("Trax handler " + handler.getClass().getName() + msg);
 
-            needsNamespaceCache.put(factory.getClass().getName(), new Boolean(needsIt));
+            needsNamespaceCache.put(factory.getClass().getName(), BooleanUtils.toBooleanObject(needsIt));
 
             return needsIt;
         }

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
Fri Dec 31 04:43:00 2004
@@ -32,6 +32,7 @@
 import org.apache.cocoon.xml.XMLConsumer;
 import org.apache.cocoon.xml.XMLUtils;
 
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
@@ -276,8 +277,8 @@
             if (ignoreErrors == null || ignoreErrors.length() == 0) {
                 ignoreErrors = "false";
             }
-            this.stack.push(new Boolean(this.ignoreEmptyCharacters));
-            this.stack.push(new Boolean(this.ignoreWhitespaces));
+            this.stack.push(BooleanUtils.toBooleanObject(this.ignoreEmptyCharacters));
+            this.stack.push(BooleanUtils.toBooleanObject(this.ignoreWhitespaces));
             this.stack.push(ignoreErrors);
 
             this.ignoreEmptyCharacters = false;

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/Tokenizer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/Tokenizer.java?view=diff&rev=123788&p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/Tokenizer.java&r1=123787&p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/Tokenizer.java&r2=123788
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/Tokenizer.java	(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/Tokenizer.java	Fri Dec 31
04:43:00 2004
@@ -113,7 +113,7 @@
       || (returnTokens && delim.indexOf(str.charAt(previous)) >= 0))) {
 
       current++;
-      return new String();
+      return "";
     }
 
     if (current >= max)

Mime
View raw message