You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Christian Lipp (JIRA)" <ji...@apache.org> on 2016/03/11 09:01:41 UTC

[jira] [Created] (GROOVY-7786) removeElement on split result

Christian Lipp created GROOVY-7786:
--------------------------------------

             Summary: removeElement on split result
                 Key: GROOVY-7786
                 URL: https://issues.apache.org/jira/browse/GROOVY-7786
             Project: Groovy
          Issue Type: Bug
          Components: groovy-jdk
    Affects Versions: 2.4.6
         Environment: Windows
            Reporter: Christian Lipp
            Priority: Minor


The following code

    def input = '[ant, asciidoctorj, ceylon, crash, gaiden]'
    def list = input.split(', ')
    println list.class.canonicalName // java.lang.String[]
    list.removeElement('crash')

leads to an `MissingMethodException: No signature of method: [Ljava.lang.String;.removeElement() is applicable for argument types: (java.lang.String) values: [crash]`

But when using

    def input = '[ant, asciidoctorj, ceylon, crash, gaiden]'
    List<String> list = input.split(', ')
    println list.class.canonicalName // java.util.ArrayList
    list.removeElement('crash')

everything works. This is not intuitive, I would expect my first code to work (i used it within a fluent call chain).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)