[
https://issues.apache.org/jira/browse/WICKET-4535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jesse Long updated WICKET-4535:
-------------------------------
Attachment: WICKET-4535-2.patch
WICKET-4535-2.patch
New patch, may have some improvements on the first patch.
Also contains changes to SortableDataProvider and friends to take type
parameter for sort property. This requires changes to DataTable TableTree etc,
which I have implemented (Adding type parameter for sort property). Also
touched IColumn.
I have left the DefaultDataTable, and the tree equivalent as having the sort
property type of String (default implementation does not have so many API
changes and type params).
I have updated wicket-devutils and wicket-examples for the changes.
I have tried to add @Override to all methods needing it in all files I have
touched. (That's why there are so many changes just adding @Override).
In wicket-examples, I added generics where they were missing for that parts of
the code I touched, and the classes those parts used.
I removed Removed SortableTreeProvider#setSortState() see
https://issues.apache.org/jira/browse/WICKET-3580 basically, it does not make
sense to modify the sort state itself, because the data/tree provider is coded
to use just one type of ISortState it knows about. In fact, that implementation
failed is the ISortState was not SingleSortState, and SingleSortState is
mutable, so there is no need to set it.
This is obviously not a small patch, and it introduces a lot of API changes.
I'm sure a lot of people will complain about the introduction of second type
parameters for many of the types. That's why I left the DefaultDataTable etc as
DataTable<T, String>.
I dont think we can go middle road on this one. We must either implement the
generics correctly (as I hope I have done with this patch), or remove the type
parameter from ISortState, and just use String.
ISortState is either parameterizable, or it isn't. We must make that decision.
If it is to be parameterizable, then I think this patch is needed. If not, then
we must remove the half implemented parameterization for ISortState and all its
uses.
> Inconsistent use of generics in sorting APIs
> --------------------------------------------
>
> Key: WICKET-4535
> URL: https://issues.apache.org/jira/browse/WICKET-4535
> Project: Wicket
> Issue Type: Bug
> Components: wicket-extensions
> Affects Versions: 6.0.0-beta1
> Reporter: Jesse Long
> Priority: Minor
> Attachments: WICKET-4535-1.patch, WICKET-4535-2.patch
>
>
> The Sort APIs use very generics inconsistently. Classes like
> SortableDataProvider, ISortState, SortParam etc do not all uniformly cater
> for sort properties other than string. There is a lot of unchecked casting,
> which is not really required, if generics were used across the board.
> Fixing this will probably cause API changes for 6.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira