diff options
-rw-r--r-- | src/delombok/lombok/delombok/PrettyPrinter.java | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index 05904815..8ce38c33 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -812,21 +812,31 @@ public class PrettyPrinter extends JCTree.Visitor { print(tree.name); } - boolean first = true; - print("("); - - JCVariableDecl recvparam = readObject(tree, "recvparam", null); - if (recvparam != null) { - printVarDefInline(recvparam); - first = false; + boolean argsLessConstructor = false; + if (isConstructor && (tree.mods.flags & COMPACT_RECORD_CONSTRUCTOR) != 0) { + argsLessConstructor = true; + for (JCVariableDecl param : tree.params) { + if ((param.mods.flags & GENERATED_MEMBER) == 0) argsLessConstructor = false; + } } - for (JCVariableDecl param : tree.params) { - if (!first) print(", "); - first = false; - printVarDefInline(param); + boolean first = true; + if (!argsLessConstructor) { + print("("); + + JCVariableDecl recvparam = readObject(tree, "recvparam", null); + if (recvparam != null) { + printVarDefInline(recvparam); + first = false; + } + + for (JCVariableDecl param : tree.params) { + if (!first) print(", "); + first = false; + printVarDefInline(param); + } + print(")"); } - print(")"); if (tree.thrown.nonEmpty()) { print(" throws "); |