aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
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/core/lombok/eclipse
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/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/EclipseImportList.java10
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java4
2 files changed, 3 insertions, 11 deletions
diff --git a/src/core/lombok/eclipse/EclipseImportList.java b/src/core/lombok/eclipse/EclipseImportList.java
index 47167ec6..6d60f5aa 100644
--- a/src/core/lombok/eclipse/EclipseImportList.java
+++ b/src/core/lombok/eclipse/EclipseImportList.java
@@ -27,7 +27,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import lombok.core.ImportList;
import lombok.core.LombokInternalAliasing;
@@ -65,19 +64,10 @@ public class EclipseImportList implements ImportList {
if (isEqual(packageName, pkg)) return true;
if ("java.lang".equals(packageName)) return true;
- if (pkg != null && pkg.tokens != null && pkg.tokens.length == 0) {
- for (Map.Entry<String, Collection<String>> e : LombokInternalAliasing.IMPLIED_EXTRA_STAR_IMPORTS.entrySet()) {
- if (isEqual(e.getKey(), pkg) && e.getValue().contains(packageName)) return true;
- }
- }
-
if (imports != null) for (ImportReference imp : imports) {
if ((imp.bits & ASTNode.OnDemand) == 0) continue;
if (imp.isStatic()) continue;
if (isEqual(packageName, imp)) return true;
- for (Map.Entry<String, Collection<String>> e : LombokInternalAliasing.IMPLIED_EXTRA_STAR_IMPORTS.entrySet()) {
- if (isEqual(e.getKey(), imp) && e.getValue().contains(packageName)) return true;
- }
}
return false;
diff --git a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
index da0bf471..483431cc 100755
--- a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
+++ b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java
@@ -109,7 +109,9 @@ public class EclipseSingularsRecipes {
}
public String toQualified(String typeReference) {
- return singularizableTypes.toQualified(typeReference);
+ List<String> q = singularizableTypes.toQualifieds(typeReference);
+ if (q.isEmpty()) return null;
+ return q.get(0);
}
public EclipseSingularizer getSingularizer(String fqn) {