public static @CheckForNull JavaClass findImplementor(JavaClass[] clazz, String name, String signature) { for (JavaClass aClazz : clazz) { Method m = findImplementation(aClazz, name, signature); if (m != null && !m.isAbstract()) { return aClazz; } } return null; }
public static @CheckForNull JavaClass findSuperImplementor(JavaClass clazz, String name, String signature, BugReporter bugReporter) { try { JavaClass c = clazz; while (true) { c = c.getSuperClass(); if (c == null) { return null; } Method m = findImplementation(c, name, signature); if (m != null && !m.isAbstract()) { return c; } } } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); return null; } }
return true; if (obj.isAbstract()) { return true;
public static @CheckForNull XMethod findSuperImplementorAsXMethod(JavaClass clazz, String name, String signature, BugReporter bugReporter) { try { JavaClass c = clazz; while (true) { c = c.getSuperClass(); if (c == null) { return null; } Method m = findImplementation(c, name, signature); if (m != null && !m.isAbstract()) { return XFactory.createXMethod(c, m); } } } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); return null; } }
@Override public void visitClassContext(ClassContext classContext) { for(Method method : classContext.getMethodsInCallOrder()) { if(method.isAbstract() || method.isNative()) { continue; } try { analyzeMethod(classContext, method); } catch (CheckedAnalysisException e) { reporter.logError("Error analyzing "+method+" (class: "+classContext.getJavaClass().getClassName()+")", e); } } }
@Override public void visit(Method obj) { if (obj.isAbstract() || BCELUtil.isSynthetic(obj)) { return; } if (!obj.isPublic()) { return; } if (!"clone".equals(getMethodName())) { return; } if (!getMethodSig().startsWith("()")) { return; } hasCloneMethod = true; cloneIsDeprecated = getXMethod().isDeprecated(); cloneMethodAnnotation = MethodAnnotation.fromVisitedMethod(this); cloneOnlyThrowsException = PruneUnconditionalExceptionThrowerEdges.doesMethodUnconditionallyThrowException(XFactory .createXMethod(this)); // ExceptionTable tbl = obj.getExceptionTable(); // throwsExceptions = tbl != null && tbl.getNumberOfExceptions() > 0; }
if (method.isAbstract() || method.isNative()) { continue;
for (Method method : methodList) { try { if (method.isAbstract() || method.isNative() || method.getCode() == null) { continue;
if (method.isAbstract() || method.isNative()) { continue;
for (Method method : methodsInCallOrder) { try { if (method.isAbstract() || method.isNative() || method.getCode() == null) { continue;
Method[] methodList = jclass.getMethods(); for (Method method : methodList) { if (method.isAbstract() || method.isNative()) { continue;
if ("hashCode".equals(name) && "()I".equals(sig)) { hasHashCode = true; if (obj.isAbstract()) { hashCodeIsAbstract = true; equalsMethod = MethodAnnotation.fromVisitedMethod(this); hasEqualsObject = true; if (obj.isAbstract()) { equalsObjectIsAbstract = true; } else if (!obj.isNative()) {
if (method.isAbstract() || method.isInterface()) { if (!sawImplementation || getClassName().endsWith("Visitor") || getClassName().endsWith("Listener") if ((status == SideEffectStatus.SIDE_EFFECT || status == SideEffectStatus.OBJECT_ONLY) || method.isAbstract() || method.isInterface() || method.isNative()) { handleStatus();
if (obj.isAbstract()) { return;
public static @CheckForNull JavaClass findImplementor(JavaClass[] clazz, String name, String signature) { for (JavaClass aClazz : clazz) { Method m = findImplementation(aClazz, name, signature); if (m != null && !m.isAbstract()) { return aClazz; } } return null; }
public static @CheckForNull JavaClass findSuperImplementor(JavaClass clazz, String name, String signature, BugReporter bugReporter) { try { JavaClass c = clazz; while (true) { c = c.getSuperClass(); if (c == null) { return null; } Method m = findImplementation(c, name, signature); if (m != null && !m.isAbstract()) { return c; } } } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); return null; } }
public static @CheckForNull XMethod findSuperImplementorAsXMethod(JavaClass clazz, String name, String signature, BugReporter bugReporter) { try { JavaClass c = clazz; while (true) { c = c.getSuperClass(); if (c == null) { return null; } Method m = findImplementation(c, name, signature); if (m != null && !m.isAbstract()) { return XFactory.createXMethod(c, m); } } } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); return null; } }
@Override public void visitClassContext(ClassContext classContext) { for(Method method : classContext.getMethodsInCallOrder()) { if(method.isAbstract() || method.isNative()) { continue; } try { analyzeMethod(classContext, method); } catch (CheckedAnalysisException e) { reporter.logError("Error analyzing "+method+" (class: "+classContext.getJavaClass().getClassName()+")", e); } } }
@Override public void visit(Method obj) { if (obj.isAbstract() || BCELUtil.isSynthetic(obj)) { return; } if (!obj.isPublic()) { return; } if (!"clone".equals(getMethodName())) { return; } if (!getMethodSig().startsWith("()")) { return; } hasCloneMethod = true; cloneIsDeprecated = getXMethod().isDeprecated(); cloneMethodAnnotation = MethodAnnotation.fromVisitedMethod(this); cloneOnlyThrowsException = PruneUnconditionalExceptionThrowerEdges.doesMethodUnconditionallyThrowException(XFactory .createXMethod(this)); // ExceptionTable tbl = obj.getExceptionTable(); // throwsExceptions = tbl != null && tbl.getNumberOfExceptions() > 0; }
private byte[] getBytesFromClass(final String className) throws ClassNotFoundException, IOException { final JavaClass clazz = getTestClass(className); final ConstantPoolGen cp = new ConstantPoolGen(clazz.getConstantPool()); final Method[] methods = clazz.getMethods(); for (int i = 0; i < methods.length; i++) { final Method method = methods[i]; if (!method.isNative() && !method.isAbstract()) { methods[i] = injection(clazz, method, cp, findFirstStringLocalVariableOffset(method)); } } clazz.setConstantPool(cp.getFinalConstantPool()); return clazz.getBytes(); }