diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-08 22:37:34 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-08 22:37:34 +0100 |
commit | 4b1c2d1583d172949a574c2342b1dc43380aa378 (patch) | |
tree | 1b788ff50e9ab86fd39a5f4fdcb5a6121bcb8360 /src/delombok | |
parent | 65de4693eb19a60e472b6e04aec0b9e083a648f4 (diff) | |
download | lombok-4b1c2d1583d172949a574c2342b1dc43380aa378.tar.gz lombok-4b1c2d1583d172949a574c2342b1dc43380aa378.tar.bz2 lombok-4b1c2d1583d172949a574c2342b1dc43380aa378.zip |
improved the way lambdas are printed to conform better to style standards (no parens for 1 arg).
Diffstat (limited to 'src/delombok')
-rw-r--r-- | src/delombok/lombok/delombok/PrettyCommentsPrinter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java index 72a8ff59..e9115dd0 100644 --- a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java +++ b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java @@ -1629,6 +1629,8 @@ public class PrettyCommentsPrinter extends JCTree.Visitor { @SuppressWarnings("unchecked") List<JCVariableDecl> params = (List<JCVariableDecl>) readTreeList(tree, "params"); boolean explicit = true; + int paramLength = params.size(); + if (paramLength != 1) print("("); try { explicit = readObject(tree, "paramKind").toString().equals("EXPLICIT"); } catch (Exception e) {} @@ -1642,7 +1644,8 @@ public class PrettyCommentsPrinter extends JCTree.Visitor { sep = ", "; } } - print(") -> "); + if (paramLength != 1) print(")"); + print(" -> "); printExpr(readTree(tree, "body")); } catch (IOException e) { throw new UncheckedIOException(e); |