@Deprecated public boolean isInterned(XMethod m) { return m.isResolved(); }
/** * Create an XMethod object from a BCEL Method. * * @param javaClass * the class to which the Method belongs * @param method * the Method * @return an XMethod representing the Method */ public static XMethod createXMethod(JavaClass javaClass, Method method) { if (method == null) { throw new NullPointerException("method must not be null"); } XMethod xmethod = createXMethod(javaClass.getClassName(), method); assert xmethod.isResolved(); return xmethod; }
return false; if (!m.isPublic() && m.isResolved()) { return false; if (m.isStatic() || !m.isResolved()) { if ("compare".equals(name) && m.getClassName().startsWith("com.google.common.primitives.")) { return true; if (!m.isStatic() || !m.isResolved()) { if ("compareTo".equals(name) && "(Ljava/lang/Object;)I".equals(m.getSignature())) { return true;
private AnnotationEnum lookInOverriddenMethod(final Object originalQuery, String classToLookIn, XMethod originalMethod, boolean getMinimal) { try { AnnotationEnum n; // Look in supermethod XMethod superMethod = XFactory.createXMethod(classToLookIn, originalMethod.getName(), originalMethod.getSignature(), originalMethod.isStatic()); if (!superMethod.isResolved()) { return null; } if (DEBUG) { System.out.println("Looking for overridden method " + superMethod); } Object probe; if (originalQuery instanceof XMethod) { probe = superMethod; } else if (originalQuery instanceof XMethodParameter) { probe = new XMethodParameter(superMethod, ((XMethodParameter) originalQuery).getParameterNumber()); } else { throw new IllegalStateException("impossible"); } n = getResolvedAnnotation(probe, getMinimal); return n; } catch (RuntimeException e) { AnalysisContext.logError("Exception while looking for annotation of " + originalMethod + "in " + classToLookIn, e); return null; } }
if (calledXMethod.isResolved()) { TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(calledXMethod, typeQualifierValue);
if (invokedMethod.isResolved() && invokedMethod.getClassName().equals(getDottedClassConstantOperand()) || invokedMethod.isSynthetic()) { return; if (alternativeMethod.isResolved() && alternativeMethod.getClassName().equals(possibleTargetClass)) { String targetPackage = invokedMethod.getPackageName(); String alternativePackage = alternativeMethod.getPackageName();
@Deprecated public boolean isInterned(XMethod m) { return m.isResolved(); }
/** * Create an XMethod object from a BCEL Method. * * @param javaClass * the class to which the Method belongs * @param method * the Method * @return an XMethod representing the Method */ public static XMethod createXMethod(JavaClass javaClass, Method method) { if (method == null) { throw new NullPointerException("method must not be null"); } XMethod xmethod = createXMethod(javaClass.getClassName(), method); assert xmethod.isResolved(); return xmethod; }
return false; if (!m.isPublic() && m.isResolved()) { return false; if (m.isStatic() || !m.isResolved()) { if ("compare".equals(name) && m.getClassName().startsWith("com.google.common.primitives.")) { return true; if (!m.isStatic() || !m.isResolved()) { if ("compareTo".equals(name) && "(Ljava/lang/Object;)I".equals(m.getSignature())) { return true;
private AnnotationEnum lookInOverriddenMethod(final Object originalQuery, String classToLookIn, XMethod originalMethod, boolean getMinimal) { try { AnnotationEnum n; // Look in supermethod XMethod superMethod = XFactory.createXMethod(classToLookIn, originalMethod.getName(), originalMethod.getSignature(), originalMethod.isStatic()); if (!superMethod.isResolved()) { return null; } if (DEBUG) { System.out.println("Looking for overridden method " + superMethod); } Object probe; if (originalQuery instanceof XMethod) { probe = superMethod; } else if (originalQuery instanceof XMethodParameter) { probe = new XMethodParameter(superMethod, ((XMethodParameter) originalQuery).getParameterNumber()); } else { throw new IllegalStateException("impossible"); } n = getResolvedAnnotation(probe, getMinimal); return n; } catch (RuntimeException e) { AnalysisContext.logError("Exception while looking for annotation of " + originalMethod + "in " + classToLookIn, e); return null; } }
private void registerReturnValueSource(Location location) throws DataflowAnalysisException { // Nothing to do if called method does not return a value InvokeInstruction inv = (InvokeInstruction) location.getHandle().getInstruction(); String calledMethodSig = inv.getSignature(cpg); if (calledMethodSig.endsWith(")V")) { return; } XMethod calledXMethod = XFactory.createXMethod(inv, cpg); if (TypeQualifierDataflowAnalysis.isIdentifyFunctionForTypeQualifiers(calledXMethod)) { return; } if (calledXMethod.isResolved()) { TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(calledXMethod, typeQualifierValue); boolean interproc = false; if (TypeQualifierDatabase.USE_DATABASE && tqa == null) { // See if there's an entry in the interprocedural // type qualifier database. TypeQualifierDatabase tqdb = Global.getAnalysisCache().getDatabase(TypeQualifierDatabase.class); tqa = tqdb.getReturnValue(calledXMethod.getMethodDescriptor(), typeQualifierValue); if (tqa != null) { interproc = true; } } When when = (tqa != null) ? tqa.when : When.UNKNOWN; registerTopOfStackSource(SourceSinkType.RETURN_VALUE_OF_CALLED_METHOD, location, when, interproc, null); } }
if (invokedMethod.isResolved() && invokedMethod.getClassName().equals(getDottedClassConstantOperand()) || invokedMethod.isSynthetic()) { return; if (alternativeMethod.isResolved() && alternativeMethod.getClassName().equals(possibleTargetClass)) { String targetPackage = invokedMethod.getPackageName(); String alternativePackage = alternativeMethod.getPackageName();