Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-808

DefaultListDelimiterHandler.escapeList working only for List<String>

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.8.0
    • None
    • None

    Description

      When DefaultListDelimiterHandler.escapeList is invoked with list of anything except String, it is throwing exception:

      java.lang.ArrayStoreException: java.lang.Integer at org.apache.commons.configuration2.convert.DefaultListDelimiterHandler.escapeList(DefaultListDelimiterHandler.java:110)

       

      Reason: escapedValues is created as String array, but assigned to Object array

       

      final Object[] escapedValues = new String[values.size()];

       

      later Object returned from escape is attempted to store into (String) array:

      escapedValues[idx++] = escape(v, transformer);

       

      Suggested solution is to create escapedValues as Object array:

      final Object[] escapedValues = new Object[values.size()];

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            cigaly Cedomir Igaly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment