From 3b968fe57c3f816a27e5d57f1bf6060d6e4c4b4e Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Tue, 21 Mar 2023 22:36:50 +0100 Subject: Fix binding patterns in delombok in Java 14+15 --- src/delombok/lombok/delombok/PrettyPrinter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index b8b38da9..35dd9d76 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -1434,7 +1434,13 @@ public class PrettyPrinter extends JCTree.Visitor { void printBindingPattern(JCTree tree) { JCTree var = readObject(tree, "var", tree); - printVarDef0((JCVariableDecl) var); + if (var instanceof JCVariableDecl) { + printVarDef0((JCVariableDecl) var); + } else { + print((JCExpression) readObject(var, "vartype", null)); + print(" "); + print((Name) readObject(var, "name", null)); + } } void printDefaultCase(JCTree tree) { -- cgit