aboutsummaryrefslogtreecommitdiff
path: root/src/delombok/lombok
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2017-12-04 21:41:03 +0100
committerRoel Spilker <r.spilker@gmail.com>2017-12-04 22:28:21 +0100
commit003832670e5115fc0cd93f46f4f48482048ee078 (patch)
tree584a9a93ba3cb67aa0fa9b40c8c132bf20bc8192 /src/delombok/lombok
parent602877e6942fd12852a7b03cd3e30e76d5440df6 (diff)
downloadlombok-003832670e5115fc0cd93f46f4f48482048ee078.tar.gz
lombok-003832670e5115fc0cd93f46f4f48482048ee078.tar.bz2
lombok-003832670e5115fc0cd93f46f4f48482048ee078.zip
delombok no longer prints generated outer-instance constructor parameters, fixes #1521
Diffstat (limited to 'src/delombok/lombok')
-rw-r--r--src/delombok/lombok/delombok/PrettyPrinter.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java
index 611055e0..4261a558 100644
--- a/src/delombok/lombok/delombok/PrettyPrinter.java
+++ b/src/delombok/lombok/delombok/PrettyPrinter.java
@@ -813,6 +813,11 @@ public class PrettyPrinter extends JCTree.Visitor {
print(tree.encl);
print(".");
}
+ boolean moveFirstParameter = tree.args.nonEmpty() && tree.args.head instanceof JCUnary && tree.args.head.toString().startsWith("<*nullchk*>");
+ if (moveFirstParameter) {
+ print(((JCUnary) tree.args.head).arg);
+ print(".");
+ }
print("new ");
if (!tree.typeargs.isEmpty()) {
@@ -822,12 +827,10 @@ public class PrettyPrinter extends JCTree.Visitor {
}
print(tree.clazz);
print("(");
- if (tree.args.nonEmpty()) {
- if (tree.args.head instanceof JCIdent) {
- print(tree.args, ", ");
- } else {
- print(tree.args.tail, ", ");
- }
+ if (moveFirstParameter) {
+ print(tree.args.tail, ", ");
+ } else {
+ print(tree.args, ", ");
}
print(")");
if (tree.def != null) {