Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.0-JSR-5
-
Windows XP/SP2 + jdk1.5.0_06
Description
Here is a script returning a Caught: java.lang.ClassFormatError: Illegal field name "class$Person_]" in class PersonServiceImpl
class Person {
@Property String firstName
@Property int id
String toString() {"${firstName} has id ${id}"}
}
class PersonServiceImpl {
private List persons = new ArrayList()
PersonServiceImpl()
{ persons = [ new Person(firstName:"Guillaume", id:1), new Person(firstName:"Jochen", id:2), new Person(firstName:"Dierk", id:3), new Person(firstName:"Graeme", id:4)] }Person[] getPersons()
{ return persons.toArray(new Person[persons.size()]) }Person findPerson(int id)
{ return persons[id] }}
def ps = new PersonServiceImpl()
println ps.findPerson(0)
NOTA1: Removung the Person[] getPersons() {} blocks makes the script working
NOTA2: Replacing the Person[] type by a native type (int for example) makes things going smooth.