You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2014/02/18 14:24:56 UTC
[4/4] git commit: Formatting. Generics. Remove unused constructors in
the tests.
Formatting. Generics. Remove unused constructors in the tests.
Non functional changes
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6d00d2cd
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6d00d2cd
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6d00d2cd
Branch: refs/heads/sandbox/component-queueing-2
Commit: 6d00d2cdd89f3dc781e5c53f456a0861292b81ec
Parents: 4492c12
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 15:23:55 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 15:23:55 2014 +0200
----------------------------------------------------------------------
.../java/org/apache/wicket/DequeueContext.java | 8 +++---
.../java/org/apache/wicket/MarkupContainer.java | 13 ++++++---
.../ComponentQueueingPerformanceTest.java | 28 ++++++++++----------
.../wicket/queueing/ComponentQueueingTest.java | 15 +----------
4 files changed, 28 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/6d00d2cd/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java b/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java
index c13b0f2..99c102d 100644
--- a/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java
+++ b/wicket-core/src/main/java/org/apache/wicket/DequeueContext.java
@@ -40,8 +40,8 @@ public final class DequeueContext
{
parser.index = index;
parser.next = next;
- parser.tags = new ArrayListStack<ComponentTag>(tags);
- parser.containers = new ArrayListStack<MarkupContainer>(containers);
+ parser.tags = new ArrayListStack<>(tags);
+ parser.containers = new ArrayListStack<>(containers);
}
}
@@ -87,9 +87,9 @@ public final class DequeueContext
*/
public ComponentTag popTag()
{
- ComponentTag taken=next;
+ ComponentTag taken = next;
tags.push(taken);
- next=nextTag();
+ next = nextTag();
return taken;
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/6d00d2cd/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
index 7c69ae1..3deb5ce 100644
--- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
+++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
@@ -2147,13 +2147,17 @@ public abstract class MarkupContainer extends Component implements Iterable<Comp
*
* @param tag
*/
- protected boolean canDequeueTag(ComponentTag tag) {
- if (tag instanceof WicketTag) {
+ protected boolean canDequeueTag(ComponentTag tag)
+ {
+ if (tag instanceof WicketTag)
+ {
WicketTag wicketTag=(WicketTag)tag;
if (wicketTag.getAutoComponentFactory() != null)
{
return true;
- } else {
+ }
+ else
+ {
return false;
}
}
@@ -2184,7 +2188,8 @@ public abstract class MarkupContainer extends Component implements Iterable<Comp
* @param component
* @param tag
*/
- protected void addDequeuedComponent(Component component, ComponentTag tag) {
+ protected void addDequeuedComponent(Component component, ComponentTag tag)
+ {
add(component);
}
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/6d00d2cd/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingPerformanceTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingPerformanceTest.java b/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingPerformanceTest.java
index a3ee3d6..59ed56a0 100644
--- a/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingPerformanceTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingPerformanceTest.java
@@ -48,8 +48,14 @@ public class ComponentQueueingPerformanceTest extends WicketTestCase
private void run(Class<? extends Page> pageClass)
{
WicketTester tester = new WicketTester(new MockApplication());
- tester.startPage(pageClass);
- tester.destroy();
+ try
+ {
+ tester.startPage(pageClass);
+ }
+ finally
+ {
+ tester.destroy();
+ }
}
@Test
@@ -287,9 +293,9 @@ public class ComponentQueueingPerformanceTest extends WicketTestCase
IModel<Contact> model = item.getModel();
item.add(new Label("first", new PropertyModel(model, "first")));
item.add(new Label("last", new PropertyModel(model, "first")));
- item.add(new AddAddressPanel("addr", new PropertyModel(model, "address")));
- item.add(new AddPhonePanel("work", new PropertyModel(model, "work")));
- item.add(new AddPhonePanel("cell", new PropertyModel(model, "cell")));
+ item.add(new AddAddressPanel("addr", new PropertyModel<Address>(model, "address")));
+ item.add(new AddPhonePanel("work", new PropertyModel<PhoneNumber>(model, "work")));
+ item.add(new AddPhonePanel("cell", new PropertyModel<PhoneNumber>(model, "cell")));
}
});
@@ -321,9 +327,9 @@ public class ComponentQueueingPerformanceTest extends WicketTestCase
IModel<Contact> model = item.getModel();
item.queue(new Label("first", new PropertyModel(model, "first")));
item.queue(new Label("last", new PropertyModel(model, "first")));
- item.queue(new AddAddressPanel("addr", new PropertyModel(model, "address")));
- item.queue(new AddPhonePanel("work", new PropertyModel(model, "work")));
- item.queue(new AddPhonePanel("cell", new PropertyModel(model, "cell")));
+ item.queue(new AddAddressPanel("addr", new PropertyModel<Address>(model, "address")));
+ item.queue(new AddPhonePanel("work", new PropertyModel<PhoneNumber>(model, "work")));
+ item.queue(new AddPhonePanel("cell", new PropertyModel<PhoneNumber>(model, "cell")));
}
});
@@ -372,12 +378,6 @@ public class ComponentQueueingPerformanceTest extends WicketTestCase
super(id);
}
- public TestPanel(String id, String markup)
- {
- super(id);
- this.markup = markup;
- }
-
protected void setPanelMarkup(String markup)
{
this.markup = markup;
http://git-wip-us.apache.org/repos/asf/wicket/blob/6d00d2cd/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingTest.java b/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingTest.java
index e716329..34f1317 100644
--- a/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/ComponentQueueingTest.java
@@ -42,7 +42,6 @@ import org.apache.wicket.queueing.nestedpanels.OuterPanel;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.StringResourceStream;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
public class ComponentQueueingTest extends WicketTestCase
@@ -702,7 +701,7 @@ public class ComponentQueueingTest extends WicketTestCase
public LV(int size)
{
super("lv");
- ArrayList<Integer> values = new ArrayList<Integer>();
+ ArrayList<Integer> values = new ArrayList<>();
for (int i = 0; i < size; i++)
values.add(i);
setModel(new Model<>(values));
@@ -772,12 +771,6 @@ public class ComponentQueueingTest extends WicketTestCase
super(id);
}
- public TestPanel(String id, String markup)
- {
- super(id);
- this.markup = markup;
- }
-
protected void setPanelMarkup(String markup)
{
this.markup = markup;
@@ -805,12 +798,6 @@ public class ComponentQueueingTest extends WicketTestCase
super(id);
}
- public TestBorder(String id, String markup)
- {
- super(id);
- this.markup = markup;
- }
-
protected void setBorderMarkup(String markup)
{
this.markup = markup;