Hi
my Xbase DSL is setup with Java 8 (in Eclipse projects and also in the POMs). When I run the DSL editor the XbaseCompiler generates Java lambdas from Xbase lambdas. But when I generate Java code for my DSL files using the xtext-maven-plugin the XbaseCompiler generates Java anonymous classes.
I think that's the involved code
protected void _toJavaExpression(final XClosure closure, final ITreeAppendable b) {
if (b.hasName(closure)) {
b.trace(closure, false).append(getVarName(closure, b));
} else {
LightweightTypeReference type = getLightweightType(closure);
JvmOperation operation = findImplementingOperation(type);
if (operation != null) {
GeneratorConfig config = b.getGeneratorConfig();
if (config != null && config.getJavaSourceVersion().isAtLeast(JAVA8) && canCompileToJavaLambda(closure, type, operation)) {
toLambda(closure, b.trace(closure, false), type, operation, true);
} else {
toAnonymousClass(closure, b.trace(closure, false), type, operation);
}
}
}
}
But is there a mechanism to further instruct the xtext-maven-plugin with that respect?
Thanks in advance
Lorenzo