if (hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.RuntimeException")) || hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.Error"))) { return true; while (it.hasNext()) { SootClass nextEx = it.next(); if (hierarchy.isSubclass(throwClass, nextEx)) { return true;
/** Returns the target for the given SpecialInvokeExpr. */ public SootMethod resolveSpecialDispatch(SpecialInvokeExpr ie, SootMethod container) { SootMethod target = ie.getMethod(); /* * This is a bizarre condition! Hopefully the implementation is correct. See VM Spec, 2nd Edition, Chapter 6, in the * definition of invokespecial. */ if (target.getName().equals("<init>") || target.isPrivate()) { return target; } else if (isSubclass(target.getDeclaringClass(), container.getDeclaringClass())) { return resolveConcreteDispatch(container.getDeclaringClass(), target); } else { return target; } }
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 isThrowDeclared(Body b, SootClass throwClass){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } // handles case when exception is RuntimeException or Error if (throwClass.equals(Scene.v().getSootClass("java.lang.RuntimeException")) || throwClass.equals(Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exception is a subclass of RuntimeException or Error if (hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.RuntimeException")) || hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exact exception is thrown if (b.getMethod().throwsException(throwClass)) return true; // handles case when a super type of the exception is thrown Iterator<SootClass> it = b.getMethod().getExceptions().iterator(); while (it.hasNext()){ SootClass nextEx = it.next(); if (hierarchy.isSubclass(throwClass, nextEx)) return true; } return false; }
protected boolean isThrowDeclared(Body b, SootClass throwClass){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } // handles case when exception is RuntimeException or Error if (throwClass.equals(Scene.v().getSootClass("java.lang.RuntimeException")) || throwClass.equals(Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exception is a subclass of RuntimeException or Error if (hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.RuntimeException")) || hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exact exception is thrown if (b.getMethod().throwsException(throwClass)) return true; // handles case when a super type of the exception is thrown Iterator<SootClass> it = b.getMethod().getExceptions().iterator(); while (it.hasNext()){ SootClass nextEx = it.next(); if (hierarchy.isSubclass(throwClass, nextEx)) return true; } return false; }
/** Returns the target for the given SpecialInvokeExpr. */ public SootMethod resolveSpecialDispatch(SpecialInvokeExpr ie, SootMethod container) { SootMethod target = ie.getMethod(); /* This is a bizarre condition! Hopefully the implementation is correct. See VM Spec, 2nd Edition, Chapter 6, in the definition of invokespecial. */ if (target.getName().equals("<init>") || target.isPrivate()) return target; else if (isSubclass(target.getDeclaringClass(), container.getDeclaringClass())) return resolveConcreteDispatch(container.getDeclaringClass(), target ); else return target; }
/** Returns the target for the given SpecialInvokeExpr. */ public SootMethod resolveSpecialDispatch(SpecialInvokeExpr ie, SootMethod container) { SootMethod target = ie.getMethod(); /* This is a bizarre condition! Hopefully the implementation is correct. See VM Spec, 2nd Edition, Chapter 6, in the definition of invokespecial. */ if (target.getName().equals("<init>") || target.isPrivate()) return target; else if (isSubclass(target.getDeclaringClass(), container.getDeclaringClass())) return resolveConcreteDispatch(container.getDeclaringClass(), target ); else return target; }
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; }
if (Scene.v().getOrMakeFastHierarchy().isSubclass(sc, clazz)) { SootMethod sm = clazz.getMethodUnsafe(subSig); if (sm != null) {
if (Scene.v().getFastHierarchy().isSubclass(originalComponent, calleeClass)) { SootClass targetClass = e.getTgt().method().getDeclaringClass(); return targetClass == originalComponent || Scene.v().getFastHierarchy().isSubclass(targetClass, originalComponent);