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/core/lombok/javac/JavacImportList.java | 7 ------- src/core/lombok/javac/handlers/JavacSingularsRecipes.java | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src/core/lombok/javac') diff --git a/src/core/lombok/javac/JavacImportList.java b/src/core/lombok/javac/JavacImportList.java index 468d8c7b..8de61afc 100644 --- a/src/core/lombok/javac/JavacImportList.java +++ b/src/core/lombok/javac/JavacImportList.java @@ -60,11 +60,6 @@ public class JavacImportList implements ImportList { if (pkgStr != null && pkgStr.equals(packageName)) return true; if ("java.lang".equals(packageName)) return true; - if (pkgStr != null) { - Collection extra = LombokInternalAliasing.IMPLIED_EXTRA_STAR_IMPORTS.get(pkgStr); - if (extra != null && extra.contains(packageName)) return true; - } - for (JCTree def : defs) { if (!(def instanceof JCImport)) continue; if (((JCImport) def).staticImport) continue; @@ -74,8 +69,6 @@ public class JavacImportList implements ImportList { if (!"*".equals(simpleName)) continue; String starImport = ((JCFieldAccess) qual).selected.toString(); if (packageName.equals(starImport)) return true; - Collection extra = LombokInternalAliasing.IMPLIED_EXTRA_STAR_IMPORTS.get(starImport); - if (extra != null && extra.contains(packageName)) return true; } return false; diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java index 341d44df..fa384df3 100644 --- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java +++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java @@ -101,7 +101,9 @@ public class JavacSingularsRecipes { } public String toQualified(String typeReference) { - return singularizableTypes.toQualified(typeReference); + java.util.List q = singularizableTypes.toQualifieds(typeReference); + if (q.isEmpty()) return null; + return q.get(0); } public JavacSingularizer getSingularizer(String fqn, JavacNode node) { -- cgit