You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2015/10/29 01:09:27 UTC

[jira] [Updated] (GROOVY-7650) CLONE - collectEntries throws cryptic error when used with split(delimiter, limit)

     [ https://issues.apache.org/jira/browse/GROOVY-7650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King updated GROOVY-7650:
------------------------------
    Description: 
Here is my code

{code}
def cityList = '''\
1 San Francisco
2 Cupertino
'''
def cityMap = cityList.split('\n').
    collectEntries{ it.split(' ', 2).toList() }
    
def cityMap2 = cityList.split('\n').
    collectEntries{ it.split(' ', 2) }
{code}

I initially only tried the second approach, and got an exception that was rather hard to debug:

{code}
Exception thrown

java.lang.ClassFormatError: Illegal class name "String;4_groovyProxy" in class file String;4_groovyProxy
	at ConsoleScript6.run(ConsoleScript6:8)
{code}

Gold would be if Groovy deals with this out of the box.
Silver would be if the error message told me what was wrong.

The link to the discussion is here - http://groovy.329449.n5.nabble.com/Illegal-class-name-String-1-groovyProxy-tp5728011.html

{note}
Issue split - this part is to handle the incorrect naming for arrays with ProxyGeneratorAdapter
{note}

  was:
Here is my code

{code}
def cityList = '''\
1 San Francisco
2 Cupertino
'''
def cityMap = cityList.split('\n').
    collectEntries{ it.split(' ', 2).toList() }
    
def cityMap2 = cityList.split('\n').
    collectEntries{ it.split(' ', 2) }
{code}

I initially only tried the second approach, and got an exception that was rather hard to debug:

{code}
Exception thrown

java.lang.ClassFormatError: Illegal class name "String;4_groovyProxy" in class file String;4_groovyProxy
	at ConsoleScript6.run(ConsoleScript6:8)
{code}

Gold would be if Groovy deals with this out of the box.
Silver would be if the error message told me what was wrong.

The link to the discussion is here - http://groovy.329449.n5.nabble.com/Illegal-class-name-String-1-groovyProxy-tp5728011.html


> CLONE - collectEntries throws cryptic error when used with split(delimiter, limit)
> ----------------------------------------------------------------------------------
>
>                 Key: GROOVY-7650
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7650
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.5
>         Environment: Java 7, 8 - all versions
> MacOS
>            Reporter: Rahul Somasunderam
>
> Here is my code
> {code}
> def cityList = '''\
> 1 San Francisco
> 2 Cupertino
> '''
> def cityMap = cityList.split('\n').
>     collectEntries{ it.split(' ', 2).toList() }
>     
> def cityMap2 = cityList.split('\n').
>     collectEntries{ it.split(' ', 2) }
> {code}
> I initially only tried the second approach, and got an exception that was rather hard to debug:
> {code}
> Exception thrown
> java.lang.ClassFormatError: Illegal class name "String;4_groovyProxy" in class file String;4_groovyProxy
> 	at ConsoleScript6.run(ConsoleScript6:8)
> {code}
> Gold would be if Groovy deals with this out of the box.
> Silver would be if the error message told me what was wrong.
> The link to the discussion is here - http://groovy.329449.n5.nabble.com/Illegal-class-name-String-1-groovyProxy-tp5728011.html
> {note}
> Issue split - this part is to handle the incorrect naming for arrays with ProxyGeneratorAdapter
> {note}



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