Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-3336

Add support for very common private type collections in ConverterManager

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 17.5.0-rc-1
    • 17.4.0-rc-1
    • Properties
    • None
    • Unit
    • Unknown

    Description

      Right now, something like the following won't work:

      converterManager.convert(mylist, Collections.emptyList().getClass()}}
      

      The reason is that the class here is the private Collections.EmptyList, so impossible to use it in the usual Converter component declaration.

      But it does not make much sense to not support such common types so we need to find a hack. This is especially important for tools like ConfigurationSource implementation, where it's very natural to do things like

      configuration.getProperty("mykey", List.of())
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: