Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-beta-4
-
None
-
xp
Description
class Bean {
String propA
boolean propB
}
Bean a = new Bean(propA:"Montag", propB:false)
The above script won't run with
java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
...
The problem was caused by a missing branch to deal with boolean type in the following method in the BytecodeHelper class.
public String getObjectTypeForPrimitive(String type) {
if (type.equals("byte"))
else if (type.equals("char"))
{ return Character.class.getName(); }else if (type.equals("short"))
{ return Short.class.getName(); }else if (type.equals("int"))
{ return Integer.class.getName(); }else if (type.equals("long"))
{ return Long.class.getName(); }else if (type.equals("float"))
{ return Float.class.getName(); }else if (type.equals("double"))
{ return Double.class.getName(); }else if (type.equals("boolean"))
{ // this branch was missing return Boolean.class.getName(); }else
{ return null; }}