I've noticed the same thing in our grails projects - I think this is caused by the "optimization" branches the groovy compiler creates.
For example - this code
def deleteSomething(params) {
def result
if(params.something && params.somethingelse)
result = "something"
else result = "something else"
}
looks like this when compiled
public Object deleteSomething(Object params)
{
CallSite[] arrayOfCallSite = $getCallSiteArray(); Object result = null; if ((!BytecodeInterface8.isOrigZ()) || (__$stMC) || (BytecodeInterface8.disabledStandardMetaClass())) {
if (((DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[2].callGetProperty(params))) && (DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[3].callGetProperty(params))) ? 1 : 0) != 0) {
String str1 = "something"; result = str1; return str1; } else {
String str2 = "something else"; result = str2; return str2;
}
}
else if (((DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[4].callGetProperty(params))) && (DefaultTypeTransformation.booleanUnbox(arrayOfCallSite[5].callGetProperty(params))) ? 1 : 0) != 0) {
String str3 = "something"; result = str3; return str3; } else {
String str4 = "something else"; result = str4; return str4; } return null;
}
More discussion here.
result
down the lane? – Anvers