diff options
Diffstat (limited to 'src/core/lombok/javac/JavacResolution.java')
-rw-r--r-- | src/core/lombok/javac/JavacResolution.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/lombok/javac/JavacResolution.java b/src/core/lombok/javac/JavacResolution.java index abbf6726..7f940d2a 100644 --- a/src/core/lombok/javac/JavacResolution.java +++ b/src/core/lombok/javac/JavacResolution.java @@ -336,7 +336,7 @@ public class JavacResolution { if (type instanceof ClassType) { List<Type> ifaces = ((ClassType) type).interfaces_field; Type supertype = ((ClassType) type).supertype_field; - if (ifaces != null && ifaces.length() == 1) { + if (isObject(supertype) && ifaces != null && ifaces.length() > 0) { return typeToJCTree(ifaces.get(0), ast, allowCompound, allowVoid); } if (supertype != null) return typeToJCTree(supertype, ast, allowCompound, allowVoid); @@ -402,6 +402,10 @@ public class JavacResolution { return genericsToJCTreeNodes(generics, ast, replacement); } + private static boolean isObject(Type supertype) { + return supertype.tsym.toString().equals("java.lang.Object"); + } + private static JCExpression genericsToJCTreeNodes(List<Type> generics, JavacAST ast, JCExpression rawTypeNode) throws TypeNotConvertibleException { if (generics != null && !generics.isEmpty()) { ListBuffer<JCExpression> args = new ListBuffer<JCExpression>(); |