Search code examples
listgroovyruntime-errorgroovyshell

groovy.lang.MissingPropertyException for empty list


Why an empty list from Groovy Tutorial throws a runtime error MissingPropertyException?

The code is simple:

groovy:000> emptylist = []
groovy:000> print emptyList

The groovy shell error message is below:

ERROR groovy.lang.MissingPropertyException:
No such property: emptyList for class: groovysh_evaluate
        at groovysh_evaluate.run (groovysh_evaluate:2)

Update:

Groovy Version: 1.8.6 JVM: 1.6.0_45 Vendor: Sun Microsystems Inc. OS: Linux


Solution

  • It's a spelling mistake (l vs. L).