mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 04:18:44 +00:00
improved the way lambdas are printed to conform better to style standards (no parens for 1 arg).
This commit is contained in:
1 parent
65de4693eb
commit
4b1c2d1583
1 file changed
+4
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user