Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3295

Please use lists instead of arrays

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5-M3
    • 1.5-RC1
    • wicket, wicket-extensions
    • None

    Description

      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?

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            wboyce@panix.com Willis Blackburn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: