diff options
Diffstat (limited to 'src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 340e233c..2dce285c 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -1854,4 +1854,12 @@ public class EclipseHandlerUtil { private static long[] copy(long[] array) { return array == null ? null : array.clone(); } + + public static boolean isDirectDescendantOfObject(EclipseNode typeNode) { + if (!(typeNode.get() instanceof TypeDeclaration)) throw new IllegalArgumentException("not a type node"); + TypeDeclaration typeDecl = (TypeDeclaration) typeNode.get(); + if (typeDecl.superclass == null) return true; + String p = typeDecl.superclass.toString(); + return p.equals("Object") || p.equals("java.lang.Object"); + } } |