diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-03-26 01:24:16 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-03-26 01:26:37 +0100 |
commit | 320fbfee4dbf17b0e2c467311e0fd062448321c4 (patch) | |
tree | 0f9bea34a9dae4fa478df91df753e0262222b9ec /src/delombok | |
parent | 33281d857891b24cb1c40233807620769a158bbf (diff) | |
download | lombok-320fbfee4dbf17b0e2c467311e0fd062448321c4.tar.gz lombok-320fbfee4dbf17b0e2c467311e0fd062448321c4.tar.bz2 lombok-320fbfee4dbf17b0e2c467311e0fd062448321c4.zip |
[fixes #2049] Delombok now figures out usages of ‘var’ and delomboks them as just ‘var’ instead of their actual type.
Diffstat (limited to 'src/delombok')
-rwxr-xr-x | src/delombok/lombok/delombok/Delombok.java | 1 | ||||
-rw-r--r-- | src/delombok/lombok/delombok/PrettyPrinter.java | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/delombok/lombok/delombok/Delombok.java b/src/delombok/lombok/delombok/Delombok.java index 9582c3b8..8f4f99e5 100755 --- a/src/delombok/lombok/delombok/Delombok.java +++ b/src/delombok/lombok/delombok/Delombok.java @@ -753,6 +753,7 @@ public class Delombok { Object care = callAttributeMethodOnJavaCompiler(delegate, delegate.todo); callFlowMethodOnJavaCompiler(delegate, care); + FormatPreferences fps = new FormatPreferences(formatPrefs); for (JCCompilationUnit unit : roots) { DelombokResult result = new DelombokResult(catcher.getComments(unit), unit, force || options.isChanged(unit), fps); diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index 353bd753..832dbe0a 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -648,7 +648,11 @@ public class PrettyPrinter extends JCTree.Visitor { */ try { innermostArrayBracketsAreVarargs = varargs; - print(tree.vartype); + if (tree.vartype == null || tree.vartype.pos == -1) { + print("var"); + } else { + print(tree.vartype); + } } finally { innermostArrayBracketsAreVarargs = false; } |