public boolean equivTo(Object o) { if (o instanceof AbstractNewExpr) { AbstractNewExpr ae = (AbstractNewExpr) o; return type.equals(ae.type); } return false; }
public boolean equivTo(Object o) { if (o instanceof ThisRef) { return thisType.equals(((ThisRef) o).thisType); } return false; }
@Override public int compare(T o1, T o2) { RefType t1 = baseType(o1); RefType t2 = baseType(o2); if (t1.equals(t2)) { // There should never be both AnySubType(t) and // t in a ThrowableSet, but if it happens, put // AnySubType(t) first: if (o1 instanceof AnySubType) { if (o2 instanceof AnySubType) { return 0; } else { return -1; } } else if (o2 instanceof AnySubType) { return 1; } else { return 0; } } else { return t1.toString().compareTo(t2.toString()); } }
public boolean equivTo(Object o) { if (o instanceof GNewInvokeExpr) { GNewInvokeExpr ie = (GNewInvokeExpr) o; if (!(getMethod().equals(ie.getMethod()) && (argBoxes == null ? 0 : argBoxes.length) == (ie.argBoxes == null ? 0 : ie.argBoxes.length))) { return false; } if (argBoxes != null) { for (ValueBox element : argBoxes) { if (!(element.getValue().equivTo(element.getValue()))) { return false; } } } if (!type.equals(ie.type)) { return false; } return true; } return false; }
if (other.equals(UnknownType.v()) || this.equals(other)) { return this;
protected boolean isExceptionCaught(Body b, Stmt s, RefType throwType) { if (hierarchy == null) { hierarchy = new FastHierarchy(); } Iterator it = b.getTraps().iterator(); while (it.hasNext()) { Trap trap = (Trap) it.next(); if (trap.getException().getType().equals(throwType) || hierarchy.isSubclass(throwType.getSootClass(), (trap.getException().getType()).getSootClass())) { if (isThrowInStmtRange(b, (Stmt) trap.getBeginUnit(), (Stmt) trap.getEndUnit(), s)) { return true; } } } return false; }
exclusionBase.getSootClass() == objectClass); boolean isExcluded = exclusionBaseHasNoHierarchy && exclusionBase.equals(newBase); isExcluded |= !exclusionBaseHasNoHierarchy && (hierarchy.canStoreType(newBase, exclusionBase) || hierarchy.canStoreType(exclusionBase, newBase)); RefType incumbentBase = ((AnySubType) incumbent).getBase(); if (newBaseHasNoHierarchy) { if (!incumbentBase.equals(newBase)) { resultSet.add(incumbent);
if ((eHasNoHierarchy && exclusionBase.equals(e)) || (!eHasNoHierarchy && hierarchy.canStoreType(e, exclusionBase))) { throw new AlreadyHasExclusionsException("ThrowableSet.add(RefType): adding" + e.toString() + " to the set [ " + this.toString() + "] where " + exclusionBase.toString() + " is excluded.");
/** * needs accessors: when field or meth is private and in some other class when field or meth is protected and in */ protected boolean needsAccessor(polyglot.types.MemberInstance inst) { if (inst.flags().isPrivate()) { if (!Util.getSootType(inst.container()).equals(body.getMethod().getDeclaringClass().getType())) { return true; } } else if (inst.flags().isProtected()) { if (Util.getSootType(inst.container()).equals(body.getMethod().getDeclaringClass().getType())) { return false; } soot.SootClass currentClass = body.getMethod().getDeclaringClass(); if (currentClass.getSuperclass().getType().equals(Util.getSootType(inst.container()))) { return false; } while (currentClass.hasOuterClass()) { currentClass = currentClass.getOuterClass(); if (Util.getSootType(inst.container()).equals(currentClass.getType())) { return false; } else if (Util.getSootType(inst.container()).equals(currentClass.getSuperclass().getType())) { return true; } } return false; } return false; }
public boolean equivTo(Object o) { if (o instanceof AbstractNewExpr) { AbstractNewExpr ae = (AbstractNewExpr)o; return type.equals(ae.type); } return false; }
public boolean equivTo(Object o) { if (o instanceof ThisRef) { return thisType.equals(((ThisRef)o).thisType); } return false; }
public boolean equivTo(Object o) { if (o instanceof AbstractNewExpr) { AbstractNewExpr ae = (AbstractNewExpr)o; return type.equals(ae.type); } return false; }
public boolean equivTo(Object o) { if (o instanceof ThisRef) { return thisType.equals(((ThisRef)o).thisType); } return false; }
/** * Checks whether the given type is java.lang.Object, java.io.Serializable, or * java.lang.Cloneable. * * @param tp * The type to check * @return True if the given type is one of the three "object-like" types, * otherwise false */ public static boolean isObjectLikeType(Type tp) { if (!(tp instanceof RefType)) return false; RefType rt = (RefType) tp; return rt.equals(Scene.v().getObjectType()) || rt.getSootClass().getName().equals("java.io.Serializable") || rt.getSootClass().getName().equals("java.lang.Cloneable"); }
public int compare(Object o1, Object o2) { RefType t1 = baseType(o1); RefType t2 = baseType(o2); if (t1.equals(t2)) { // There should never be both AnySubType(t) and // t in a ThrowableSet, but if it happens, put // AnySubType(t) first: if (o1 instanceof AnySubType) { if (o2 instanceof AnySubType) { return 0; } else { return -1; } } else if (o2 instanceof AnySubType) { return 1; } else { return 0; } } else { return t1.toString().compareTo(t2.toString()); } }
public int compare(Object o1, Object o2) { RefType t1 = baseType(o1); RefType t2 = baseType(o2); if (t1.equals(t2)) { // There should never be both AnySubType(t) and // t in a ThrowableSet, but if it happens, put // AnySubType(t) first: if (o1 instanceof AnySubType) { if (o2 instanceof AnySubType) { return 0; } else { return -1; } } else if (o2 instanceof AnySubType) { return 1; } else { return 0; } } else { return t1.toString().compareTo(t2.toString()); } }
protected boolean isExceptionCaught(Body b, Stmt s, RefType throwType){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } Iterator it = b.getTraps().iterator(); while (it.hasNext()){ Trap trap = (Trap)it.next(); if (trap.getException().getType().equals(throwType) || hierarchy.isSubclass(throwType.getSootClass(), (trap.getException().getType()).getSootClass())){ if (isThrowInStmtRange(b, (Stmt)trap.getBeginUnit(), (Stmt)trap.getEndUnit(), s)) return true; } } return false; }
protected boolean isExceptionCaught(Body b, Stmt s, RefType throwType){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } Iterator it = b.getTraps().iterator(); while (it.hasNext()){ Trap trap = (Trap)it.next(); if (trap.getException().getType().equals(throwType) || hierarchy.isSubclass(throwType.getSootClass(), (trap.getException().getType()).getSootClass())){ if (isThrowInStmtRange(b, (Stmt)trap.getBeginUnit(), (Stmt)trap.getEndUnit(), s)) return true; } } return false; }