You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Cedomir Igaly (Jira)" <ji...@apache.org> on 2021/06/20 06:24:00 UTC

[jira] [Created] (CONFIGURATION-808) DefaultListDelimiterHandler.escapeList working only for List

Cedomir Igaly created CONFIGURATION-808:
-------------------------------------------

             Summary: DefaultListDelimiterHandler.escapeList working only for List<String>
                 Key: CONFIGURATION-808
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-808
             Project: Commons Configuration
          Issue Type: Bug
            Reporter: Cedomir Igaly


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: {color:#000000}escapedValues{color} is created as String array, but assigned to Object array

 

{color:#0033b3}final {color}{color:#000000}Object{color}[] {color:#000000}escapedValues {color}= {color:#0033b3}new {color}String[values.size()];

 

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



{color:#000000}escapedValues{color}[idx++] = escape({color:#000000}v{color}, transformer);

 

Suggested solution is to create escapedValues as Object array:

{color:#0033b3}final {color}{color:#000000}Object{color}[] {color:#000000}escapedValues {color}= {color:#0033b3}new {color}Object[values.size()];



--
This message was sent by Atlassian Jira
(v8.3.4#803005)