cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r124700 - in cocoon/branches/BRANCH_2_1_X/src: blocks/forms/java/org/apache/cocoon/forms/util blocks/proxy/java/org/apache/cocoon/util java/org/apache/cocoon/components/xpointer
Date Sun, 09 Jan 2005 02:17:20 GMT
Author: antonio
Date: Sat Jan  8 18:17:17 2005
New Revision: 124700

URL: http://svn.apache.org/viewcvs?view=rev&rev=124700
Log:
Create Arrays of equal size
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/DomHelper.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/util/RequestForwardingHttpMethod.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/xpointer/ElementPathPart.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/DomHelper.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/DomHelper.java?view=diff&rev=124700&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/DomHelper.java&r1=124699&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/DomHelper.java&r2=124700
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/DomHelper.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/DomHelper.java
Sat Jan  8 18:17:17 2005
@@ -127,8 +127,7 @@
      * Returns all Element children of an Element that belong to the given
      * namespace.
      */
-    public static Element[] getChildElements(Element element,
-            String namespace) {
+    public static Element[] getChildElements(Element element, String namespace) {
         ArrayList elements = new ArrayList();
         NodeList nodeList = element.getChildNodes();
         for (int i = 0; i < nodeList.getLength(); i++) {
@@ -137,7 +136,7 @@
                     && namespace.equals(node.getNamespaceURI()))
                 elements.add(node);
         }
-        return (Element[])elements.toArray(new Element[0]);
+        return (Element[])elements.toArray(new Element[elements.size()]);
     }
 
     /**
@@ -156,7 +155,7 @@
                 elements.add(node);
             }
         }
-        return (Element[])elements.toArray(new Element[0]);
+        return (Element[])elements.toArray(new Element[elements.size()]);
     }
 
     /**

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/util/RequestForwardingHttpMethod.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/util/RequestForwardingHttpMethod.java?view=diff&rev=124700&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/util/RequestForwardingHttpMethod.java&r1=124699&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/util/RequestForwardingHttpMethod.java&r2=124700
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/util/RequestForwardingHttpMethod.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/util/RequestForwardingHttpMethod.java
Sat Jan  8 18:17:17 2005
@@ -32,7 +32,7 @@
  * to a server.
  * 
  * @author <a href="mailto:gianugo@apache.org">Gianugo Rabellino</a>
- * @version $Id: RequestForwardingHttpMethod.java,v 1.3 2004/03/05 13:02:20 bdelacretaz Exp
$
+ * @version $Id$
  */
 public class RequestForwardingHttpMethod extends EntityEnclosingMethod {
     
@@ -93,10 +93,10 @@
                 cookie.setName(name);
                 newCookiesList.add(cookie);
             }
-        
+
             CookieSpecBase cookieFormatter = new CookieSpecBase();
             Header cookieHeader = 
-                cookieFormatter.formatCookieHeader((Cookie[])newCookiesList.toArray(new Cookie[0]));
+                cookieFormatter.formatCookieHeader((Cookie[])newCookiesList.toArray(new Cookie[newCookiesList.size()]));
             this.addRequestHeader(cookieHeader);
         }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/xpointer/ElementPathPart.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/xpointer/ElementPathPart.java?view=diff&rev=124700&p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/xpointer/ElementPathPart.java&r1=124699&p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/xpointer/ElementPathPart.java&r2=124700
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/xpointer/ElementPathPart.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/xpointer/ElementPathPart.java
Sat Jan  8 18:17:17 2005
@@ -88,7 +88,7 @@
             if (path.size() < 1)
                 throw new SAXException("Invalid element path xpointer expression \"" + expression
+ "\".");
 
-            this.elementPath = (QName[])path.toArray(new QName[0]);
+            this.elementPath = (QName[])path.toArray(new QName[path.size()]);
             this.level = -1;
             this.include = false;
             this.levelToMatch = 0;

Mime
View raw message