You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Brill Pappin (JIRA)" <ji...@apache.org> on 2009/03/02 21:10:56 UTC
[jira] Created: (WICKET-2137) Remove ? extends from constructor of
DropDownChoice
Remove ? extends from constructor of DropDownChoice
---------------------------------------------------
Key: WICKET-2137
URL: https://issues.apache.org/jira/browse/WICKET-2137
Project: Wicket
Issue Type: Improvement
Components: wicket
Affects Versions: 1.4-RC3
Environment: 1.4-SNAPSHOT as of 2009-01-28
Reporter: Brill Pappin
DropDownChoice has a generics definition of List<? extends T> in its constructor.
This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremy Thomerson reassigned WICKET-2137:
----------------------------------------
Assignee: (was: Jeremy Thomerson)
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java, WICKET-2137.patch
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678929#action_12678929 ]
James Carman commented on WICKET-2137:
--------------------------------------
So, the API for the IModel versions of the constructor(s) needs to be "widened" even farther. The parameters should be of type:
IModel<? extends List<? extends T>>
That will allow what Oliver is talking about. ListView should be changed to match.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679072#action_12679072 ]
Brill Pappin commented on WICKET-2137:
--------------------------------------
Not that I'm an expert in Generics but it seems to me that *when dealing wit the contents of the list*:
__<? extends List<? extends T>> == <List<T>>__
because by definition every T extends T and you have really only just moved T up the hierarchy.
the <? extends T> seem only useful when generalizing the generics and not he actual content of the list.
Whatever we do, as long as it is all consistent and allows the simplest format during development (read code maintainability) I'll go along with it.
I won't be happy if I have to type my lists with a whildcard, however based on what Oliver is demonstrating that doesn't look like it will be a problem and everything will work as before with the rest of the list elements.
As I said, All I wanted was a Pepsi :)
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678781#action_12678781 ]
Brill Pappin commented on WICKET-2137:
--------------------------------------
I think Olivier has done a bang up job of describing the problem.
I'm still pushing for the more concrete version of <List<Foo>>.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-2137.
-----------------------------------
Resolution: Fixed
Fix Version/s: 1.4-RC3
Assignee: Igor Vaynberg
fixed by applying WICKET-2165
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Assignee: Igor Vaynberg
> Fix For: 1.4-RC3
>
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679230#action_12679230 ]
Brill Pappin commented on WICKET-2137:
--------------------------------------
<chuckle>
Let's not close it, lets get the work done!
I'll change the subject so the developers can take a look at the discussion and do something about the weirdness that is the current SNAPSHOT.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (WICKET-2137) Remove ? extends from
constructor of DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678929#action_12678929 ]
jwcarman edited comment on WICKET-2137 at 3/4/09 1:32 PM:
--------------------------------------------------------------
So, the API for the IModel versions of the constructor(s) needs to be "widened" even farther. The parameters should be of type:
IModel<? extends List<? extends T>>
You don't have to declare your models with wildcards in them at all with this approach. You can have an IModel<List<Integer>> variable and you can pass it in for this parameter type.
That will allow what Oliver is talking about. ListView should be changed to match.
was (Author: jwcarman):
So, the API for the IModel versions of the constructor(s) needs to be "widened" even farther. The parameters should be of type:
IModel<? extends List<? extends T>>
That will allow what Oliver is talking about. ListView should be changed to match.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681604#action_12681604 ]
Brill Pappin commented on WICKET-2137:
--------------------------------------
I have to say that if its easier to regress the generics to the List<T> version, then I think we should do that before 1.4 release... if as is thought there the longer form is better and doesn't break code that uses the short form, then we can add it after the 1.4 release.
That doesn't me we should choose one or the other now, I'm just interested in the least possible change to make it right as the committers roll around to releasing 1.4 (i think its essential that this get into the release).
As someone pointed out, we're in rc3 or rc4 now, so even the simplest change of this sort is going to force people to do some fixing (better now than later though).
So, whoever has to handle this issue, please make a choice for what ever is the least hassle and bring the two components into sync.
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679225#action_12679225 ]
James Carman commented on WICKET-2137:
--------------------------------------
Brill, if I buy you a Pepsi, will you close this JIRA? :)
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679020#action_12679020 ]
James Carman commented on WICKET-2137:
--------------------------------------
Brill, I am for the wildcard (and my "extended wildcard") API for both ListView and DDC. It allows the most flexibility for the calling code. The calling code does not need to contain all of those wildcards at all.
I don't know about the usecase of needing to remove stuff from the DDC or ListView's model. It doesn't seem that common to me. I suppose folks could do it, but as Johannes Schneider pointed out, they could simply cast it to do so (since they know the actual type).
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678087#action_12678087 ]
James Carman commented on WICKET-2137:
--------------------------------------
We don't want to go the other way and allow List<? extends T> in ListView? If it makes it more flexible, then I don't see why we don't do it. I'd be -0.99 to changing DropDownChoice to be less flexible.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-2137) Synchronize generics between ListView
and DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Carman updated WICKET-2137:
---------------------------------
Attachment: WICKET-2137.patch
Here's a patch that changes the API as I proposed. Notice that I didn't have to change any of the test code and the API still supported it.
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java, WICKET-2137.patch
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-2137) Remove ? extends from constructor of
DropDownChoice
Posted by "Olivier Michallat (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Michallat updated WICKET-2137:
--------------------------------------
Attachment: TestGenerics.java
Illustrates issues about the current API of DropDownChoice.
N.B: this class doesn't compile, since its purpose is to demonstrate issues that arise at compile-time.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679233#action_12679233 ]
James Carman commented on WICKET-2137:
--------------------------------------
That sounds like a better approach. Good idea!
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678092#action_12678092 ]
Brill Pappin commented on WICKET-2137:
--------------------------------------
One thing to keep in mind is that once you use List<? extends T>, then your list could actually have more than one type in it, which is generally thought of as bad practice.
However, I don't actually care which one it uses as long as its consistent and doesn't try to make a decision for me about how I'm going to use it.
As long as I can use one model on both types of components (components which are not really different in both a semantic and concrete way), then I don't really mind at this point which format is used.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (WICKET-2137) Remove ? extends from
constructor of DropDownChoice
Posted by "Olivier Michallat (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679018#action_12679018 ]
omichallat edited comment on WICKET-2137 at 3/4/09 4:55 PM:
-------------------------------------------------------------------
Brill, James is right, the new signature will accept an IModel<List<Integer>>. This takes care of not pushing the wildcard onto the caller.
As for the "read-only" problem, it can easily be solved with a private helper method that captures the wildcard.
Here is another example:
// Simulates the DropDownChoice with the change suggested by James
static class DropDownChoiceWidened<T> {
// Just an artifact to simulate getModelObject
private IModel<? extends List<? extends T>> model;
// The new constructor with widened type
public DropDownChoiceWidened(String id, IModel<? extends List<? extends T>> model) {
this.model = model;
}
// The getModelObject inherited from FormComponent would have this signature:
public List<? extends T> getModelObject() { return this.model.getObject(); }
}
// intModel is the same as in my previous example (an IModel<List<Integer>>)
// Now the constructor invocation compiles:
new DropDownChoiceWidened<Number>("id", intModel) {
// Should the component need to mutate the list:
public void someMethodThatNeedsToRemoveElements() {
safeRemove(this.getModelObject(), 1);
}
// Private helper that captures the wildcard
private <T extends Number> void safeRemove(List<T> list, int index) {
// List<T> is not read-only
list.remove(index);
}
};
Thanks to James' suggestion, I now agree with a wildcard type.
was (Author: omichallat):
Brill, James is right, the new signature will accept an IModel<List<Integer>>. This takes care of not pushing the wildcard onto the caller.
As for the "read-only" problem, it can easily be solved with a private helper method that captures the wildcard.
Here is another example:
// Simulates the DropDownChoice with the change suggested by James
static class DropDownChoiceWidened<T> {
// Just an artifact to simulate getModelObject
private IModel<? extends List<? extends T>> model;
// The new constructor with widened type
public DropDownChoiceWidened(String id, IModel<? extends List<? extends T>> model) {
this.model = model;
}
// The getModelObject inherited from FormComponent would have this signature:
public List<? extends T> getModelObject() { return this.model.getObject(); }
}
// intModel is the same as in my previous example (an IModel<List<Integer>>)
// Now the constructor invocation compiles:
new DropDownChoiceWidened<Number>("id", intModel) {
// Should the component need to mutate the list:
public void someMethodThatNeedsToRemoveElements() {
safeRemove(this.getModelObject(), 1);
}
// Private helper that captures the wildcard
private <T extends Number> void safeRemove(List<T> list, int index) {
// List<T> is not read-only
list.remove(index);
}
};
Thanks to James' suggestion, I now agree with a wildcard type.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679004#action_12679004 ]
Brill Pappin commented on WICKET-2137:
--------------------------------------
I'm confused, are you saying that you want List<Foo> and not List<? extends Foo>??
I think Olivers comment pretty much sum's up the issue and I think he's right about the reasons for one over the other.
https://issues.apache.org/jira/browse/WICKET-2137?focusedCommentId=12678768#action_12678768
Be explicit about what the content of the list *is* which <? extends T> doesn't do (note that now it cascades throughout my model) however List<T> is explicit and can be widened as much as you like using real types (as in an interface or abstract if you need to bend the unwritten rules).
There is no case I can think of where <<? extends List<? extends T>> is better. You have exactly the same use-case resolving ability with List<T> but with a significantly simpler syntax and a more solid coding practice (which is evident in everyones use of ListView<T> right now).
IMO - I look at the "IModel<? extends List<? extends T>>" syntax, and think to myself *All I wanted was a Pepsi!".
I recommend a few of us try actually working with that *double* whildcard syntax before we make a final choice, because I'm cringing already on the hoops I'll have to jump through, when the simplest thing actually already works well -- not to mention the hoops the Wicket developers are going to have to jump through to accommodate it.
My vote stays on this issue, *which is to remove the wildcard and make it so it is like ListView*.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681464#action_12681464 ]
Jeremy Thomerson commented on WICKET-2137:
------------------------------------------
I reviewed the attached patch and supplied these comments on the mailing list:
Unless I'm seeing double - this patch has two problems:
1 - It is the opposite of what was voted on. The vote was to make IModel<List<? extends E>> into IModel<List<E>>. Your patch makes it IModel<? extends List<? extends E>>.
2 - The patch causes compile errors that were not fixed.
I have unassigned myself from the task until those issues are addressed or I have time to create my own patch. The best solution would be for someone to submit a proper patch that fixes the two problems above or explain to me what I missed.
Thanks!
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java, WICKET-2137.patch
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681619#action_12681619 ]
Brill Pappin commented on WICKET-2137:
--------------------------------------
Oh i agree, I want it is fixed one way or another.
Funny your not seeing all those error that were mentioned, but then patching is actually a pain unless everyone doing it is in sync :)
Lets give them a bit of time to review and do their dev thing.
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-2137) Synchronize generics between ListView
and DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Carman updated WICKET-2137:
---------------------------------
Attachment: (was: WICKET-2137.patch)
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678932#action_12678932 ]
James Carman commented on WICKET-2137:
--------------------------------------
Brill, a List<T> can have just as many types of things in it as List<? extends T>:
List<Serializable> serializables = Arrays.<Serializable>asList("Hello", new Date(), 1, 0.0f, 0.0, true);
List<? extends Serializable> withWildcard = serializables;
This compiles. However, you can't add things to the withWildcard list, because you don't know what that wildcard *is*.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Olivier Michallat (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678768#action_12678768 ]
Olivier Michallat commented on WICKET-2137:
-------------------------------------------
Hi, I'm new to the mailing list where I followed the debate about this issue.
IMO, using a wildcard generic type doesn't "widen" the API, it only locks the caller code into using the wildcard type (I'm attaching a Java class illustrating what I'll describe below).
Let's say I want to construct a DropDownChoice<Number>. The current API tells me that I must pass an IModel<List<? extends Number>>.
Since Integer extends Number, it should be OK to pass a model that returns a list of Integers: IModel<List<Integer>>.
But it's not.
For the generic type system, an IModel<List<Integer>> is NOT an IModel<List<? extends Number>>
Nor is an IModel<List<Number>> for that matter (as illustrated by Brill's initial post).
My only workaround is to declare my model as an instance of the wildcard type. I can return my list of Integers as a covariant return:
IModel<List<? extends Number>> model = new LoadableDetachableModel<List<? extends Number>>() {
protected List<Integer> load() { return Arrays.asList(1, 2, 3); }
};
new DropDownChoice<Number>("ddc", model);
I have two issues with that:
* "if the user of a class has to think about wildcard types, there is probably something wrong with the class's API" (the Gospel according to St Joshua, second edition, item 28)
* since I'm passing a wildcard type to DropDownChoice, I'm not actually telling anything about the fact that my list contains Integers.
So +1 for changing DropDownChoice to match ListView.
In the example above, it means using either an IModel<List<Number>> or a DropDownChoice<Integer>
On a side note:
There would be a way to make the constructor of DropDownChoice<Number> accept an IModel<List<Integer>>: generifying the constructor itself
<U extends T> DropDownChoice(String id, IModel<List<U>> model)
But that only moves the problem further down, as type param U is local to the constructor and cannot be used elsewhere in the class. I've also thought of passing Class<U> as a type token, but that's runtime information: it can't be used by generics (and we certainly don't want to go into reflection).
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-2137) Synchronize generics between ListView
and DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brill Pappin updated WICKET-2137:
---------------------------------
Summary: Synchronize generics between ListView and DropDownChoice (was: Remove ? extends from constructor of DropDownChoice)
I've updated the subject to reflect the point of the issue.
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681600#action_12681600 ]
James Carman commented on WICKET-2137:
--------------------------------------
I've deleted my patch. I guess I didn't have all the necessary files in my "change list" in IDEA for this issue. Sorry for the mix-up. However, I'm working on a more pervasive change to the API that changes *all* instances where we have these issues to adhere to my proposal (the more I kept pulling, the more I had to change!). I'm going to create another issue and attach my patch there. If the core devs don't like my API change ideas, they can scrap it. I will also send an email to the users list asking for feedback on the proposed changes. I understand that my proposal doesn't exactly match what folks voted on, but I don't think all of the options were on the table at the time and the most vocal folks seemed to agree with my idea. Again, Jeremy, sorry for giving you a bad patch and wasting your time. That was totally my bad.
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (WICKET-2137) Remove ? extends from
constructor of DropDownChoice
Posted by "Olivier Michallat (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679018#action_12679018 ]
omichallat edited comment on WICKET-2137 at 3/4/09 5:02 PM:
-------------------------------------------------------------------
Brill, James is right, the new signature will accept an IModel<List<Integer>>. This takes care of not pushing the wildcard onto the caller.
As for the "read-only" problem, it can easily be solved with a private helper method that captures the wildcard.
Here is another example:
// Simulates the DropDownChoice with the change suggested by James
static class DropDownChoiceWidened<T> {
// Just an artifact to simulate getModelObject
private IModel<? extends List<? extends T>> model;
// The new constructor with widened type
public DropDownChoiceWidened(String id, IModel<? extends List<? extends T>> model) {
this.model = model;
}
// The getModelObject inherited from FormComponent would have this signature:
public List<? extends T> getModelObject() { return this.model.getObject(); }
}
// intModel is the same as in my previous example (an IModel<List<Integer>>)
// Now the constructor invocation compiles:
new DropDownChoiceWidened<Number>("id", intModel) {
// Should the component need to mutate the list:
public void someMethodThatNeedsToRemoveElements() {
safeRemove(this.getModelObject(), 1);
}
// Private helper that captures the wildcard
private <T extends Number> void safeRemove(List<T> list, int index) {
// List<T> is not read-only
list.remove(index);
}
};
My vote changes in favor of James' widened wildcard.
was (Author: omichallat):
Brill, James is right, the new signature will accept an IModel<List<Integer>>. This takes care of not pushing the wildcard onto the caller.
As for the "read-only" problem, it can easily be solved with a private helper method that captures the wildcard.
Here is another example:
// Simulates the DropDownChoice with the change suggested by James
static class DropDownChoiceWidened<T> {
// Just an artifact to simulate getModelObject
private IModel<? extends List<? extends T>> model;
// The new constructor with widened type
public DropDownChoiceWidened(String id, IModel<? extends List<? extends T>> model) {
this.model = model;
}
// The getModelObject inherited from FormComponent would have this signature:
public List<? extends T> getModelObject() { return this.model.getObject(); }
}
// intModel is the same as in my previous example (an IModel<List<Integer>>)
// Now the constructor invocation compiles:
new DropDownChoiceWidened<Number>("id", intModel) {
// Should the component need to mutate the list:
public void someMethodThatNeedsToRemoveElements() {
safeRemove(this.getModelObject(), 1);
}
// Private helper that captures the wildcard
private <T extends Number> void safeRemove(List<T> list, int index) {
// List<T> is not read-only
list.remove(index);
}
};
Thanks to James' suggestion, I now agree with a wildcard type.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (WICKET-2137) Remove ? extends from
constructor of DropDownChoice
Posted by "Brill Pappin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679004#action_12679004 ]
brill edited comment on WICKET-2137 at 3/4/09 4:05 PM:
--------------------------------------------------------------
I'm confused, are you saying that you want List<Foo> and not List<? extends Foo>??
I think Olivers comment pretty much sum's up the issue and I think he's right about the reasons for one over the other.
https://issues.apache.org/jira/browse/WICKET-2137?focusedCommentId=12678768#action_12678768
Be explicit about what the content of the list *is* which <? extends T> doesn't do (note that now it cascades throughout my model) however List<T> is explicit and can be widened as much as you like using real types (as in an interface or abstract if you need to bend the unwritten rules).
There is no case I can think of where <<? extends List<? extends T>> is better. You have exactly the same use-case resolving ability with List<T> but with a significantly simpler syntax and a more solid coding practice (which is evident in everyones use of ListView<T> right now).
IMO - I look at the "IModel<? extends List<? extends T>>" syntax, and think to myself *All I wanted was a Pepsi!*.
I recommend a few of us try actually working with that *double* whildcard syntax before we make a final choice, because I'm cringing already on the hoops I'll have to jump through, when the simplest thing actually already works well -- not to mention the hoops the Wicket developers are going to have to jump through to accommodate it.
My vote stays on this issue, *which is to remove the wildcard and make it so it is like ListView*.
was (Author: brill):
I'm confused, are you saying that you want List<Foo> and not List<? extends Foo>??
I think Olivers comment pretty much sum's up the issue and I think he's right about the reasons for one over the other.
https://issues.apache.org/jira/browse/WICKET-2137?focusedCommentId=12678768#action_12678768
Be explicit about what the content of the list *is* which <? extends T> doesn't do (note that now it cascades throughout my model) however List<T> is explicit and can be widened as much as you like using real types (as in an interface or abstract if you need to bend the unwritten rules).
There is no case I can think of where <<? extends List<? extends T>> is better. You have exactly the same use-case resolving ability with List<T> but with a significantly simpler syntax and a more solid coding practice (which is evident in everyones use of ListView<T> right now).
IMO - I look at the "IModel<? extends List<? extends T>>" syntax, and think to myself *All I wanted was a Pepsi!".
I recommend a few of us try actually working with that *double* whildcard syntax before we make a final choice, because I'm cringing already on the hoops I'll have to jump through, when the simplest thing actually already works well -- not to mention the hoops the Wicket developers are going to have to jump through to accommodate it.
My vote stays on this issue, *which is to remove the wildcard and make it so it is like ListView*.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Olivier Michallat (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679018#action_12679018 ]
Olivier Michallat commented on WICKET-2137:
-------------------------------------------
Brill, James is right, the new signature will accept an IModel<List<Integer>>. This takes care of not pushing the wildcard onto the caller.
As for the "read-only" problem, it can easily be solved with a private helper method that captures the wildcard.
Here is another example:
// Simulates the DropDownChoice with the change suggested by James
static class DropDownChoiceWidened<T> {
// Just an artifact to simulate getModelObject
private IModel<? extends List<? extends T>> model;
// The new constructor with widened type
public DropDownChoiceWidened(String id, IModel<? extends List<? extends T>> model) {
this.model = model;
}
// The getModelObject inherited from FormComponent would have this signature:
public List<? extends T> getModelObject() { return this.model.getObject(); }
}
// intModel is the same as in my previous example (an IModel<List<Integer>>)
// Now the constructor invocation compiles:
new DropDownChoiceWidened<Number>("id", intModel) {
// Should the component need to mutate the list:
public void someMethodThatNeedsToRemoveElements() {
safeRemove(this.getModelObject(), 1);
}
// Private helper that captures the wildcard
private <T extends Number> void safeRemove(List<T> list, int index) {
// List<T> is not read-only
list.remove(index);
}
};
Thanks to James' suggestion, I now agree with a wildcard type.
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681605#action_12681605 ]
James Carman commented on WICKET-2137:
--------------------------------------
Well, Brill, that's just the thing. In my IDE right now (I'm working on my patch), I haven't changed one test class at all. The existing test code works with the new API with no changes. All I've done is change some variable/parameter types here and there (there's a weird cast in ListView's .
I don't think you want to release the "genericized wicket" version (which is what 1.4 is supposed to be) without getting the generics "right."
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremy Thomerson reassigned WICKET-2137:
----------------------------------------
Assignee: Jeremy Thomerson
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Assignee: Jeremy Thomerson
> Attachments: TestGenerics.java, WICKET-2137.patch
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Remove ? extends from constructor
of DropDownChoice
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678089#action_12678089 ]
Igor Vaynberg commented on WICKET-2137:
---------------------------------------
see WICKET-2126
> Remove ? extends from constructor of DropDownChoice
> ---------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2137) Synchronize generics between
ListView and DropDownChoice
Posted by "James Carman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681622#action_12681622 ]
James Carman commented on WICKET-2137:
--------------------------------------
The problem was that some of the classes that I had changed (that would have fixed the errors) didn't get included in the patch because I created my patch from a specific "change list" in IDEA. I was working on patches for multiple issues today and I just got a bit confused (blame it on the bronchitis). I'm developing against trunk, so I hope I'm in sync.
> Synchronize generics between ListView and DropDownChoice
> --------------------------------------------------------
>
> Key: WICKET-2137
> URL: https://issues.apache.org/jira/browse/WICKET-2137
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC3
> Environment: 1.4-SNAPSHOT as of 2009-01-28
> Reporter: Brill Pappin
> Attachments: TestGenerics.java
>
>
> DropDownChoice has a generics definition of List<? extends T> in its constructor.
> This causes trouble with existing models that may be used in a DropDownChoice and is not consistant with ListView which uses <List<T>>.
> Change DropDownChoice to match the other list type components so that their models can be used across components.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.