You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Willis Blackburn (JIRA)" <ji...@apache.org> on 2011/01/01 20:45:45 UTC

[jira] Created: (WICKET-3295) Please use lists instead of arrays

Please use lists instead of arrays
----------------------------------

                 Key: WICKET-3295
                 URL: https://issues.apache.org/jira/browse/WICKET-3295
             Project: Wicket
          Issue Type: Improvement
          Components: wicket, wicket-extensions
    Affects Versions: 1.5-M3
            Reporter: Willis Blackburn
            Priority: Minor


I'm working with 1.5-M3.

In most places, indexed collections are lists.  But in a few places they're arrays, which creates awkward integrations for various reasons.  The ones that I've noticed are:

1.  DataTable accepts an IColumn<T>[] as a parameter, which is a pain to construct because it's impossible to create a generic array.  Instead one has to create a non-generic array (in other words an IColumn[]) or create a list of IColumn<T> and then convert it to an array.  Either approach involves suppressing some warning and is unfriendly to developers who don't grok the ins and outs of using arrays and generics together.  If DataTable just accepted List<IColumn<T>>, like DataGridView (which takes List<ICellPopulator<T>>), then the issue will go away.  If DataTable wants to use an array internally, then it can do the conversion itself.

2.  In the new AbstractMapper and several subclassses, the mount path is represented as a String[].  But this collection has to intergrate with the Url class, which represents the same concept as a List<String>.  Why not just use List<String> and make it a little easier for everyone to write AbstractMapper implementations?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-3295) Please use lists instead of arrays

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-3295:
---------------------------------------

    Assignee: Martin Grigorov

> Please use lists instead of arrays
> ----------------------------------
>
>                 Key: WICKET-3295
>                 URL: https://issues.apache.org/jira/browse/WICKET-3295
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.5-M3
>            Reporter: Willis Blackburn
>            Assignee: Martin Grigorov
>            Priority: Minor
>
> I'm working with 1.5-M3.
> In most places, indexed collections are lists.  But in a few places they're arrays, which creates awkward integrations for various reasons.  The ones that I've noticed are:
> 1.  DataTable accepts an IColumn<T>[] as a parameter, which is a pain to construct because it's impossible to create a generic array.  Instead one has to create a non-generic array (in other words an IColumn[]) or create a list of IColumn<T> and then convert it to an array.  Either approach involves suppressing some warning and is unfriendly to developers who don't grok the ins and outs of using arrays and generics together.  If DataTable just accepted List<IColumn<T>>, like DataGridView (which takes List<ICellPopulator<T>>), then the issue will go away.  If DataTable wants to use an array internally, then it can do the conversion itself.
> 2.  In the new AbstractMapper and several subclassses, the mount path is represented as a String[].  But this collection has to intergrate with the Url class, which represents the same concept as a List<String>.  Why not just use List<String> and make it a little easier for everyone to write AbstractMapper implementations?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-3295) Please use lists instead of arrays

Posted by "Willis Blackburn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980089#action_12980089 ] 

Willis Blackburn commented on WICKET-3295:
------------------------------------------

Sure about the DataTable constructor that accepts List<IColumn<T>>?  It's not in 1.5-M3 so it must have been added very recently.

DataGridView does have both types of constructors.

I don't object to having constructors that take arrays;  I just would like to have List versions so I don't have to deal with arrays of generics and all those headaches.






> Please use lists instead of arrays
> ----------------------------------
>
>                 Key: WICKET-3295
>                 URL: https://issues.apache.org/jira/browse/WICKET-3295
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.5-M3
>            Reporter: Willis Blackburn
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.5-M4
>
>
> I'm working with 1.5-M3.
> In most places, indexed collections are lists.  But in a few places they're arrays, which creates awkward integrations for various reasons.  The ones that I've noticed are:
> 1.  DataTable accepts an IColumn<T>[] as a parameter, which is a pain to construct because it's impossible to create a generic array.  Instead one has to create a non-generic array (in other words an IColumn[]) or create a list of IColumn<T> and then convert it to an array.  Either approach involves suppressing some warning and is unfriendly to developers who don't grok the ins and outs of using arrays and generics together.  If DataTable just accepted List<IColumn<T>>, like DataGridView (which takes List<ICellPopulator<T>>), then the issue will go away.  If DataTable wants to use an array internally, then it can do the conversion itself.
> 2.  In the new AbstractMapper and several subclassses, the mount path is represented as a String[].  But this collection has to intergrate with the Url class, which represents the same concept as a List<String>.  Why not just use List<String> and make it a little easier for everyone to write AbstractMapper implementations?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-3295) Please use lists instead of arrays

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980205#action_12980205 ] 

Igor Vaynberg commented on WICKET-3295:
---------------------------------------

i think if a class has both constructors (arrays and lists) we should nuke the arrays one unless its an internal object. one of the annoyances of wicket is how many damn constructors some components have :)

> Please use lists instead of arrays
> ----------------------------------
>
>                 Key: WICKET-3295
>                 URL: https://issues.apache.org/jira/browse/WICKET-3295
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.5-M3
>            Reporter: Willis Blackburn
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.5-M4
>
>
> I'm working with 1.5-M3.
> In most places, indexed collections are lists.  But in a few places they're arrays, which creates awkward integrations for various reasons.  The ones that I've noticed are:
> 1.  DataTable accepts an IColumn<T>[] as a parameter, which is a pain to construct because it's impossible to create a generic array.  Instead one has to create a non-generic array (in other words an IColumn[]) or create a list of IColumn<T> and then convert it to an array.  Either approach involves suppressing some warning and is unfriendly to developers who don't grok the ins and outs of using arrays and generics together.  If DataTable just accepted List<IColumn<T>>, like DataGridView (which takes List<ICellPopulator<T>>), then the issue will go away.  If DataTable wants to use an array internally, then it can do the conversion itself.
> 2.  In the new AbstractMapper and several subclassses, the mount path is represented as a String[].  But this collection has to intergrate with the Url class, which represents the same concept as a List<String>.  Why not just use List<String> and make it a little easier for everyone to write AbstractMapper implementations?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-3295) Please use lists instead of arrays

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-3295.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-M4

1. DataTable already had constructor that accept List. The one that accepted array is removed with r1057584.
2. I prefer to leave mountSegments as array. It is an internal structure (not part of the public API) and the user code should not deal with it anyway.

> Please use lists instead of arrays
> ----------------------------------
>
>                 Key: WICKET-3295
>                 URL: https://issues.apache.org/jira/browse/WICKET-3295
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.5-M3
>            Reporter: Willis Blackburn
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.5-M4
>
>
> I'm working with 1.5-M3.
> In most places, indexed collections are lists.  But in a few places they're arrays, which creates awkward integrations for various reasons.  The ones that I've noticed are:
> 1.  DataTable accepts an IColumn<T>[] as a parameter, which is a pain to construct because it's impossible to create a generic array.  Instead one has to create a non-generic array (in other words an IColumn[]) or create a list of IColumn<T> and then convert it to an array.  Either approach involves suppressing some warning and is unfriendly to developers who don't grok the ins and outs of using arrays and generics together.  If DataTable just accepted List<IColumn<T>>, like DataGridView (which takes List<ICellPopulator<T>>), then the issue will go away.  If DataTable wants to use an array internally, then it can do the conversion itself.
> 2.  In the new AbstractMapper and several subclassses, the mount path is represented as a String[].  But this collection has to intergrate with the Url class, which represents the same concept as a List<String>.  Why not just use List<String> and make it a little easier for everyone to write AbstractMapper implementations?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.