private void checkAbstractDeclaration(MethodNode methodNode) {
   if (!methodNode.isAbstract()) return;
   if (isAbstract(currentClass.getModifiers())) return;
   addError(
       "Can't have an abstract method in a non-abstract class."
           + " The "
           + getDescription(currentClass)
           + " must be declared abstract or the method '"
           + methodNode.getTypeDescriptor()
           + "' must not be abstract.",
       methodNode);
 }
Esempio n. 2
0
 /**
  * Tests whether the ClasNode implements the specified method name.
  *
  * @param classNode The ClassNode
  * @param methodName The method name
  * @return True if it does implement the method
  */
 public static boolean implementsZeroArgMethod(ClassNode classNode, String methodName) {
   MethodNode method = classNode.getDeclaredMethod(methodName, Parameter.EMPTY_ARRAY);
   return method != null && (method.isPublic() || method.isProtected()) && !method.isAbstract();
 }