wicket-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcompag...@apache.org
Subject svn commit: r722106 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java
Date Mon, 01 Dec 2008 15:58:18 GMT
Author: jcompagner
Date: Mon Dec  1 07:58:18 2008
New Revision: 722106

URL: http://svn.apache.org/viewvc?rev=722106&view=rev
Log:
class cast fix

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java?rev=722106&r1=722105&r2=722106&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java Mon Dec  1 07:58:18
2008
@@ -18,7 +18,6 @@
 
 import java.util.AbstractList;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
@@ -466,7 +465,6 @@
 	 *            The comparator
 	 * @return Iterator that iterates over children in the order specified by comparator
 	 */
-	@SuppressWarnings("unchecked")
 	public final Iterator<Component> iterator(Comparator<Component> comparator)
 	{
 		final List<Component> sorted;
@@ -481,13 +479,15 @@
 				sorted = new ArrayList<Component>(1);
 				sorted.add((Component)children);
 			}
-			else if (children instanceof ChildList)
-			{
-				sorted = new ArrayList((ChildList)children);
-			}
 			else
 			{
-				sorted = Arrays.asList((Component[])children);
+				int size = children_size();
+				sorted = new ArrayList<Component>(size);
+				for (int i = 0; i < size; i++)
+				{
+					sorted.add(children_get(i));
+				}
+
 			}
 		}
 		Collections.sort(sorted, comparator);
@@ -647,7 +647,7 @@
 			associatedMarkupStream.next();
 
 			String className = null;
-			
+
 			if (getApplication().getDebugSettings().isOutputMarkupContainerClassName())
 			{
 				Class<?> klass = getClass();



Mime
View raw message