aboutsummaryrefslogtreecommitdiff
path: root/src/delombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-03-26 01:24:16 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-03-26 01:26:37 +0100
commit320fbfee4dbf17b0e2c467311e0fd062448321c4 (patch)
tree0f9bea34a9dae4fa478df91df753e0262222b9ec /src/delombok
parent33281d857891b24cb1c40233807620769a158bbf (diff)
downloadlombok-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-xsrc/delombok/lombok/delombok/Delombok.java1
-rw-r--r--src/delombok/lombok/delombok/PrettyPrinter.java6
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;
}