diff --git a/src/core/lombok/core/AST.java b/src/core/lombok/core/AST.java
index 78761f46..9f3a471f 100755
--- a/src/core/lombok/core/AST.java
+++ b/src/core/lombok/core/AST.java
@@ -60,6 +60,7 @@ public abstract class AST, L extends LombokNode,
private final String fileName;
private final String packageDeclaration;
private final ImportList imports;
+ private TypeResolver importsAsResolver;
Map identityDetector = new IdentityHashMap();
private Map nodeMap = new IdentityHashMap();
private boolean changed = false;
@@ -112,13 +113,19 @@ public abstract class AST, L extends LombokNode,
/**
* Return the contents of each non-static import statement on this AST's top (Compilation Unit) node.
- *
- * Example: "java.util.IOException".
*/
public final ImportList getImportList() {
return imports;
}
+ /**
+ * Return the contents of each non-static import statement on this AST's top (Compilation Unit) node, packed into a (cached) TypeResolver.
+ */
+ public final TypeResolver getImportListAsTypeResolver() {
+ if (importsAsResolver != null) return importsAsResolver;
+ return importsAsResolver = new TypeResolver(getImportList());
+ }
+
/**
* Puts the given node in the map so that javac/Eclipse's own internal AST object can be translated to
* an AST.Node object. Also registers the object as visited to avoid endless loops.
diff --git a/src/core/lombok/core/LombokNode.java b/src/core/lombok/core/LombokNode.java
index ae8fd325..843a78f0 100644
--- a/src/core/lombok/core/LombokNode.java
+++ b/src/core/lombok/core/LombokNode.java
@@ -96,6 +96,15 @@ public abstract class LombokNode, L extends LombokNode