You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2010/11/27 21:01:14 UTC

svn commit: r1039745 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/debug/PageView.java

Author: jdonnerstag
Date: Sat Nov 27 20:01:13 2010
New Revision: 1039745

URL: http://svn.apache.org/viewvc?rev=1039745&view=rev
Log:
fixed WICKET-3201 wicket/markup/html/debug/PageView clearing and possibly sorting empty list
Issue: WICKET-3201

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/debug/PageView.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/debug/PageView.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/debug/PageView.java?rev=1039745&r1=1039744&r2=1039745&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/debug/PageView.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/debug/PageView.java Sat Nov 27 20:01:13 2010
@@ -98,25 +98,28 @@ public final class PageView extends Pane
 	{
 		super(id);
 
-		// Create an empty list. It'll be filled later
-		final List<ComponentData> data = new ArrayList<ComponentData>();
-
 		// Name of page
 		add(new Label("info", page == null ? "[Stateless Page]" : page.toString()));
 
-		// Get the components data and fill and sort the list
-		data.clear();
+		// Create an empty list. It'll be filled later
+		List<ComponentData> data = null;
+
 		if (page != null)
 		{
-			data.addAll(getComponentData(page));
+			// Get the components data and fill and sort the list
+			data = new ArrayList<ComponentData>(getComponentData(page));
+			Collections.sort(data, new Comparator<ComponentData>()
+			{
+				public int compare(ComponentData o1, ComponentData o2)
+				{
+					return (o1).path.compareTo((o2).path);
+				}
+			});
 		}
-		Collections.sort(data, new Comparator<ComponentData>()
+		else
 		{
-			public int compare(ComponentData o1, ComponentData o2)
-			{
-				return (o1).path.compareTo((o2).path);
-			}
-		});
+			data = Collections.emptyList();
+		}
 
 		// Create the table containing the list the components
 		add(new ListView<ComponentData>("components", data)