diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-01-09 19:53:30 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-01-09 19:53:30 +0100 |
commit | 2ea928229c0c7d362f6f3ef37dbf1f54c28cfbb4 (patch) | |
tree | a3f47a486e445ed807a74bc650b5f8a923b52093 /src/core/lombok | |
parent | f6e663c8b982cbc0d1946a6dc1825c2426f0c6f9 (diff) | |
download | lombok-2ea928229c0c7d362f6f3ef37dbf1f54c28cfbb4.tar.gz lombok-2ea928229c0c7d362f6f3ef37dbf1f54c28cfbb4.tar.bz2 lombok-2ea928229c0c7d362f6f3ef37dbf1f54c28cfbb4.zip |
trivial refactor
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleDelegate.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/lombok/javac/handlers/HandleDelegate.java b/src/core/lombok/javac/handlers/HandleDelegate.java index ffc1f391..f6a81474 100644 --- a/src/core/lombok/javac/handlers/HandleDelegate.java +++ b/src/core/lombok/javac/handlers/HandleDelegate.java @@ -146,7 +146,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { for (Type t : toExclude) { if (t instanceof ClassType) { ClassType ct = (ClassType) t; - addMethodBindings(signaturesToExclude, ct, annotationNode, banList); + addMethodBindings(signaturesToExclude, ct, annotationNode.getTypesUtil(), banList); } else { annotationNode.addError("@Delegate can only use concrete class types, not wildcards, arrays, type variables, or primitives."); return; @@ -160,7 +160,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { for (Type t : toDelegate) { if (t instanceof ClassType) { ClassType ct = (ClassType) t; - addMethodBindings(signaturesToDelegate, ct, annotationNode, banList); + addMethodBindings(signaturesToDelegate, ct, annotationNode.getTypesUtil(), banList); } else { annotationNode.addError("@Delegate can only use concrete class types, not wildcards, arrays, type variables, or primitives."); return; @@ -301,25 +301,26 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { return collection == null ? com.sun.tools.javac.util.List.<T>nil() : collection.toList(); } - private void addMethodBindings(List<MethodSig> signatures, ClassType ct, JavacNode node, Set<String> banList) { + private void addMethodBindings(List<MethodSig> signatures, ClassType ct, JavacTypes types, Set<String> banList) { TypeSymbol tsym = ct.asElement(); if (tsym == null) return; + for (Symbol member : tsym.getEnclosedElements()) { if (member.getKind() != ElementKind.METHOD) continue; if (member.isStatic()) continue; if (member.isConstructor()) continue; ExecutableElement exElem = (ExecutableElement)member; if (!exElem.getModifiers().contains(Modifier.PUBLIC)) continue; - ExecutableType methodType = (ExecutableType) node.getTypesUtil().asMemberOf(ct, member); - String sig = printSig(methodType, member.name, node.getTypesUtil()); + ExecutableType methodType = (ExecutableType) types.asMemberOf(ct, member); + String sig = printSig(methodType, member.name, types); if (!banList.add(sig)) continue; //If add returns false, it was already in there boolean isDeprecated = exElem.getAnnotation(Deprecated.class) != null; signatures.add(new MethodSig(member.name, methodType, isDeprecated, exElem)); } - if (ct.supertype_field instanceof ClassType) addMethodBindings(signatures, (ClassType) ct.supertype_field, node, banList); + if (ct.supertype_field instanceof ClassType) addMethodBindings(signatures, (ClassType) ct.supertype_field, types, banList); if (ct.interfaces_field != null) for (Type iface : ct.interfaces_field) { - if (iface instanceof ClassType) addMethodBindings(signatures, (ClassType) iface, node, banList); + if (iface instanceof ClassType) addMethodBindings(signatures, (ClassType) iface, types, banList); } } |