aboutsummaryrefslogtreecommitdiff
path: root/src/delombok/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-09-12 23:17:05 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-09-12 23:17:05 +0200
commit538d2bd690b6288728cc8516bcb3c8093bf2acc6 (patch)
tree5e84527bd8b248307a39573ae5b0efde37f0e1b4 /src/delombok/lombok
parent5cceda7de97d1c761bb979433a5ae793668d1110 (diff)
downloadlombok-538d2bd690b6288728cc8516bcb3c8093bf2acc6.tar.gz
lombok-538d2bd690b6288728cc8516bcb3c8093bf2acc6.tar.bz2
lombok-538d2bd690b6288728cc8516bcb3c8093bf2acc6.zip
Refactored how the type resolver deals with aliases; fixes star import issues.
Diffstat (limited to 'src/delombok/lombok')
-rw-r--r--src/delombok/lombok/delombok/PrettyPrinter.java13
1 files changed, 13 insertions, 0 deletions
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);