I don't know if this is a bug or I'm doing something wrong, but I can't find examples for lambdas so this is it:
JMethod method = definedClass.method(...);
JLambdaMethodRef methodLambda = new JLambdaMethodRef(...);
JLambda lambda = new JLambda();
lambda.body().lambdaExpr(
JExpr._this().invoke("getValueProvider").invoke("andThen").arg(methodLambda)
);
method.body()._return(lambda);
This produces:
public default StringFilter<T> description() {
return () -> this.getValueProvider().andThen(Category::getDescription);
; // <- Unreachable code error!
}
with the extra ; resulting in an "Unreachable code" error in Eclipse. How can I avoid the extra semicolon?
I don't know if this is a bug or I'm doing something wrong, but I can't find examples for lambdas so this is it:
This produces:
with the extra
;resulting in an "Unreachable code" error in Eclipse. How can I avoid the extra semicolon?