public boolean isOverridden(MethodDefinition md) { if(md.isStatic() || md.isFinal() || md.getDeclaringType().isFinal()) return false; IMetadataResolver resolver = md.getDeclaringType().getResolver(); MemberInfo mi = new MemberInfo(md); TypeHierarchy th = get(md.getDeclaringType()); return th != null && th.isOverridden(resolver, mi); }
@Override protected void visitType(TypeDefinition td) { for (MethodDefinition md : td.getDeclaredMethods()) { MethodData mdata = getMethodData(md); if (md.isFinal() || td.isFinal() || md.isStatic() || md.isPrivate()) { mdata.flags |= METHOD_FINAL; } visitMethod(mdata, md); for (MethodDefinition superMethod : Methods.findSuperMethods(md)) { getMethodData(superMethod).addSubMethod(mdata); } } }
mc.report("NotCloneableHasClone", priority, body); if(isCloneable && !md.isFinal() && !td.isFinal() && !onlyThrows) { boolean invokesSuperClone = Nodes.find(body, n -> { if(Nodes.isOp(n, AstCode.InvokeSpecial)) {
} else if(expr.getCode() == AstCode.InvokeVirtual) { MethodDefinition md = mr.resolve(); if(md != null && !md.isFinal() && !md.getDeclaringType().isFinal()) { priority = AccessLevel.of(md).select(25, 15, 0, 0);
public static boolean isOverride(final MethodDefinition method, final MethodReference ancestorMethod) { final MethodDefinition resolvedAncestor = ancestorMethod.resolve(); if (resolvedAncestor == null || resolvedAncestor.isFinal() || resolvedAncestor.isPrivate() || resolvedAncestor.isStatic()) { return false;
public static boolean isOverride(final MethodDefinition method, final MethodReference ancestorMethod) { final MethodDefinition resolvedAncestor = ancestorMethod.resolve(); if (resolvedAncestor == null || resolvedAncestor.isFinal() || resolvedAncestor.isPrivate() || resolvedAncestor.isStatic()) { return false;
public static boolean isOverride(final MethodDefinition method, final MethodReference ancestorMethod) { final MethodDefinition resolvedAncestor = ancestorMethod.resolve(); if (resolvedAncestor == null || resolvedAncestor.isFinal() || resolvedAncestor.isPrivate() || resolvedAncestor.isStatic()) { return false;
if (superEquals == null || Types.isObject(superEquals.getDeclaringType())) { cc.report("HashCodeObjectEquals", basePriority, Roles.METHOD.create(hashCode)); } else if (!superEquals.isFinal()) { cc.report("HashCodeNoEquals", basePriority, Roles.METHOD.create(hashCode), Roles.SUPER_METHOD .create(superEquals));