@Override public boolean equals(Object o) { if (o == null) { return false; } else if (o instanceof TypeKey) { TypeKey other = (TypeKey) o; return this.type.equals(other.type); } else if (o instanceof WeaklyNamedKey) { WeaklyNamedKey other = (WeaklyNamedKey) o; return this.type.equals(other.type); } else { return false; } } @Override
@Override public boolean equals(Object o) { if (o == null) { return false; } else if (o instanceof TypeKey) { TypeKey other = (TypeKey) o; return this.type.equals(other.type); } else if (o instanceof WeaklyNamedKey) { WeaklyNamedKey other = (WeaklyNamedKey) o; return this.type.equals(other.type); } else { return false; } } @Override
@Override public boolean equals(Object o) { if (o == null) { return false; } else if (o instanceof NamedKey) { NamedKey other = (NamedKey) o; return (this.type.equals(other.type) && this.name.equals(other.name)); } else { return false; } } @Override
@Override public boolean equals(Object o) { if (o == null) { return false; } else if (o instanceof NamedKey) { NamedKey other = (NamedKey) o; return (this.type.equals(other.type) && this.name.equals(other.name)); } else if (o instanceof TypeKey) { TypeKey other = (TypeKey) o; return (this.type.equals(other.type)); } else { return false; } } @Override
@Override public boolean equals(Object o) { if (o == null) { return false; } else if (o instanceof NamedKey) { NamedKey other = (NamedKey) o; return (this.type.equals(other.type) && this.name.equals(other.name)); } else if (o instanceof TypeKey) { TypeKey other = (TypeKey) o; return (this.type.equals(other.type)); } else { return false; } } @Override
@Override public boolean equals(Object o) { if (o == null) { return false; } else if (o instanceof NamedKey) { NamedKey other = (NamedKey) o; return (this.type.equals(other.type) && this.name.equals(other.name)); } else { return false; } } @Override
@Override public final boolean equals(Object other) { assert other != null && other instanceof Key; Key that = (Key) other; return (name.equals(that.name) && classloader.equals(that.classloader)); } }
@Override public final boolean equals(Object other) { assert other != null && other instanceof Key; Key that = (Key) other; return (name.equals(that.name) && classloader.equals(that.classloader)); } }
/** * Returns the Element the type matches exactly the given type. * * @return The Element if found or AndroidComponent.UNKNOWN if not */ public static AndroidComponent explicit(final TypeName type) { for (AndroidComponent test: AndroidComponent.values()) { if (type.equals(test.type)) { return test; } } return UNKNOWN; }
/** * Returns the Element the type matches exactly the given type. * * @return The Element if found or AndroidComponent.UNKNOWN if not */ public static AndroidComponent explicit(final TypeName type) { for (AndroidComponent test: AndroidComponent.values()) { if (type.equals(test.type)) { return test; } } return UNKNOWN; }
@Override public boolean understands(CGNode node) { return node.getMethod().getDeclaringClass().getName().equals(APPLY_TYPE_NAME); }
/** * Get the first paramNo of a given type. * * @see com.ibm.wala.util.ssa.ParameterAccessor */ private static int firstOf(TypeName type, IMethod inCallTo) { for (int i = 0; i < inCallTo.getNumberOfParameters(); ++i) { if (inCallTo.getParameterType(i).getName().equals(type)) { return i; } } throw new IllegalArgumentException(type.toString() + " is not a parameter to " + inCallTo); }
/** * Get the first paramNo of a given type. * * @see com.ibm.wala.util.ssa.ParameterAccessor */ private static int firstOf(TypeName type, IMethod inCallTo) { for (int i = 0; i < inCallTo.getNumberOfParameters(); ++i) { if (inCallTo.getParameterType(i).getName().equals(type)) { return i; } } throw new IllegalArgumentException(type.toString() + " is not a parameter to " + inCallTo); }
@Override public boolean understands(CGNode node) { return node.getMethod().getDeclaringClass().getName().equals(APPLY_TYPE_NAME); }
public static boolean hasAnnotation(IField field, TypeName type) { if (field instanceof FieldImpl) { FieldImpl f = (FieldImpl) field; Collection<Annotation> annotations = f.getAnnotations(); if (annotations != null) { for (Annotation a : annotations) { if (a.getType().getName().equals(type)) { return true; } } } } return false; } }
public static boolean hasAnnotation(IField field, TypeName type) { if (field instanceof FieldImpl) { FieldImpl f = (FieldImpl) field; Collection<Annotation> annotations = f.getAnnotations(); if (annotations != null) { for (Annotation a : annotations) { if (a.getType().getName().equals(type)) { return true; } } } } return false; } }
private static boolean isInvokeExact(MethodReference target) { return target.getDeclaringClass().getName().equals(TypeReference.JavaLangInvokeMethodHandle.getName()) && target.getName().toString().equals("invokeExact"); }
private static boolean isInvokeExact(MethodReference target) { return target.getDeclaringClass().getName().equals(TypeReference.JavaLangInvokeMethodHandle.getName()) && target.getName().toString().equals("invokeExact"); }
@Override public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { IMethod method = receiver.getMethod(AstMethodReference.fnSelector); if (method != null) { TypeName tn = method.getReference().getDeclaringClass().getName(); if (tn.equals(APPLY_TYPE_NAME)) { if (applyMethod == null) { applyMethod = createApplyDummyMethod(receiver); } return applyMethod; } } return base.getCalleeTarget(caller, site, receiver); }
@Override public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { IMethod method = receiver.getMethod(AstMethodReference.fnSelector); if (method != null) { TypeName tn = method.getReference().getDeclaringClass().getName(); if (tn.equals(APPLY_TYPE_NAME)) { if (applyMethod == null) { applyMethod = createApplyDummyMethod(receiver); } return applyMethod; } } return base.getCalleeTarget(caller, site, receiver); }