Modifiers modifiers = md.astModifiers();
if (modifiers == null) return;
if (!modifiers.isAbstract()) return;
TypeDeclaration parent = md.upUpToTypeDeclaration();
if (parent != null) {
Modifiers modifiersOfParent = parent.astModifiers();
if (modifiersOfParent != null && modifiersOfParent.isAbstract()) return;
md.addMessage(error(MODIFIERS_ABSTRACT_NOT_ALLOWED, "Abstract methods are only allowed in interfaces and abstract classes"));
}
}