From 538d2bd690b6288728cc8516bcb3c8093bf2acc6 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 12 Sep 2019 23:17:05 +0200 Subject: Refactored how the type resolver deals with aliases; fixes star import issues. --- src/delombok/lombok/delombok/PrettyPrinter.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/delombok') diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index 1532319f..55210fbb 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -488,6 +488,19 @@ public class PrettyPrinter extends JCTree.Visitor { } @Override public void visitImport(JCImport tree) { + if (tree.qualid instanceof JCFieldAccess) { + JCFieldAccess fa = ((JCFieldAccess) tree.qualid); + if (fa.name.length() == 1 && fa.name.contentEquals("*")) { + if (fa.selected instanceof JCFieldAccess) { + JCFieldAccess lombokExperimental = (JCFieldAccess) fa.selected; + if (lombokExperimental.name.contentEquals("experimental") && lombokExperimental.selected instanceof JCIdent && ((JCIdent) lombokExperimental.selected).name.contentEquals("lombok")) { + // do not ever print lombok.experimental.*. + return; + } + } + } + } + aPrint("import "); if (tree.staticImport) print("static "); print(tree.qualid); -- cgit