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

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

    [ https://issues.apache.org/jira/browse/CONFIGURATION-808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17366244#comment-17366244 ] 

Gary D. Gregory commented on CONFIGURATION-808:
-----------------------------------------------

Waiting on PR GitHub build in progresss...

> 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
>            Priority: Minor
>
> 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)