aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-12-19 20:10:39 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-12-19 20:10:39 +0100
commitb25a644f50e10540b7cb69189430d932a8750aec (patch)
tree386981e8c868e828e41f1ae384403778c7ddf6b9 /src/core/lombok/eclipse
parent232d5edc355043a8616f869da670ac2c4376032e (diff)
parentae87a26456245f19d97f8852ea21556cd78e97ef (diff)
downloadlombok-b25a644f50e10540b7cb69189430d932a8750aec.tar.gz
lombok-b25a644f50e10540b7cb69189430d932a8750aec.tar.bz2
lombok-b25a644f50e10540b7cb69189430d932a8750aec.zip
Merge branch 'typeLibrary'
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/HandlerLibrary.java4
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java13
2 files changed, 4 insertions, 13 deletions
diff --git a/src/core/lombok/eclipse/HandlerLibrary.java b/src/core/lombok/eclipse/HandlerLibrary.java
index 197d7a7e..5c75c071 100644
--- a/src/core/lombok/eclipse/HandlerLibrary.java
+++ b/src/core/lombok/eclipse/HandlerLibrary.java
@@ -173,11 +173,11 @@ public class HandlerLibrary {
String pkgName = annotationNode.getPackageDeclaration();
Collection<String> imports = annotationNode.getImportStatements();
- TypeResolver resolver = new TypeResolver(typeLibrary, pkgName, imports);
+ TypeResolver resolver = new TypeResolver(pkgName, imports);
TypeReference rawType = annotation.type;
if (rawType == null) return;
- for (String fqn : resolver.findTypeMatches(annotationNode, toQualifiedName(annotation.type.getTypeName()))) {
+ for (String fqn : resolver.findTypeMatches(annotationNode, typeLibrary, toQualifiedName(annotation.type.getTypeName()))) {
boolean isPrintAST = fqn.equals(PrintAST.class.getName());
if (isPrintAST == skipPrintAst) continue;
AnnotationHandlerContainer<?> container = annotationHandlers.get(fqn);
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index 5130c7de..c6d7eb41 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -30,7 +30,6 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -46,7 +45,6 @@ import lombok.core.AnnotationValues.AnnotationValue;
import lombok.eclipse.EclipseAST;
import lombok.eclipse.EclipseNode;
import lombok.core.TransformationsUtil;
-import lombok.core.TypeLibrary;
import lombok.core.TypeResolver;
import org.eclipse.core.runtime.ILog;
@@ -260,16 +258,9 @@ public class EclipseHandlerUtil {
if (!lastPartA.equals(lastPartB)) return false;
String typeName = toQualifiedName(typeRef.getTypeName());
- TypeLibrary library = new TypeLibrary();
- library.addType(type.getName());
- TypeResolver resolver = new TypeResolver(library, node.getPackageDeclaration(), node.getImportStatements());
- Collection<String> typeMatches = resolver.findTypeMatches(node, typeName);
+ TypeResolver resolver = new TypeResolver(node.getPackageDeclaration(), node.getImportStatements());
+ return resolver.typeMatches(node, type.getName(), typeName);
- for (String match : typeMatches) {
- if (match.equals(type.getName())) return true;
- }
-
- return false;
}
public static Annotation copyAnnotation(Annotation annotation, ASTNode source) {