I'm tring to generate, using the Xtend Xbase API, a simple Java mathod. This is the Xtend code.
var jvmMethod = element.toMethod("fromSap",element.newTypeRef(element.dtoFullName))[
var jvmTypeReference= fromSap.sapType;
var param = toParameter("sapOb",jvmTypeReference)
parameters+=param
body = ['''....''')]
everything works fine except the parameter that has the final modifier. This is the generated code:
public class DTOTest {
public DTOTest fromSap(final String sapOb) {
DTOTest result = new DTOTest();
return result;
}
}
I tried to add:
param.setFinal(false);
but I got
This expression is not allowed in this context, since it doesn't cause any side effects.
at compile time
Can someone help me to remove the final modifier from the generated code?
Davide