Skip to content

Instantly share code, notes, and snippets.

@dashorst
Created June 22, 2015 11:39
Show Gist options
  • Save dashorst/4ee7ab1696321f290a24 to your computer and use it in GitHub Desktop.
Save dashorst/4ee7ab1696321f290a24 to your computer and use it in GitHub Desktop.
Made wildcards internally consistent in ListView
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
index 57f9d84..d1bdd39 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
@@ -442,7 +442,7 @@ public abstract class ListView<T> extends AbstractRepeater
* The list item index
* @return The ListItemModel created
*/
- protected IModel<T> getListItemModel(final IModel<? extends List<T>> listViewModel,
+ protected IModel<? extends T> getListItemModel(final IModel<? extends List<? extends T>> listViewModel,
final int index)
{
return new ListItemModel<>(this, index);
@@ -456,7 +456,7 @@ public abstract class ListView<T> extends AbstractRepeater
* object in the list that the item represents
* @return ListItem
*/
- protected ListItem<T> newItem(final int index, IModel<T> itemModel)
+ protected ListItem<? extends T> newItem(final int index, IModel<? extends T> itemModel)
{
return new ListItem<>(index, itemModel);
}
@@ -504,7 +504,7 @@ public abstract class ListView<T> extends AbstractRepeater
// Get index
final int index = firstIndex + i;
- ListItem<T> item = null;
+ ListItem<? extends T> item = null;
if (hasChildren)
{
// If this component does not already exist, populate it
@@ -538,7 +538,7 @@ public abstract class ListView<T> extends AbstractRepeater
*
* @param item
*/
- protected void onBeginPopulateItem(final ListItem<T> item)
+ protected void onBeginPopulateItem(final ListItem<? extends T> item)
{
}
@@ -562,7 +562,7 @@ public abstract class ListView<T> extends AbstractRepeater
* @param item
* The item to populate
*/
- protected abstract void populateItem(final ListItem<T> item);
+ protected abstract void populateItem(final ListItem<? extends T> item);
/**
* @see org.apache.wicket.markup.repeater.AbstractRepeater#renderChild(org.apache.wicket.Component)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment