result = Manager.v().registerSetIfNew(resultSet, this.exceptionsExcluded); } else { result = this;
final String EXCEPTION = "Exception"; Collection<RefLikeType> vmErrorThrowables = ThrowableSet.Manager.v().VM_ERRORS.exceptionsIncluded; boolean containsAllVmErrors = s.containsAll(vmErrorThrowables); StringBuffer buf = new StringBuffer();
/** * Returns the set of types that might be thrown as a result of calling the specified method. * * @param sm * method whose exceptions are to be returned. * * @return a representation of the set of {@link java.lang.Throwable Throwable} types that <code>m</code> might throw. */ protected ThrowableSet mightThrow(SootMethod sm) { if (!isInterproc) { return ThrowableSet.Manager.v().ALL_THROWABLES; } return methodToThrowSet.getUnchecked(sm); }
/** * Returns the set of all <code>Throwable</code>s as the set * of types that the specified unit might throw, regardless of the * unit's identity. * * @param u {@link Unit} whose exceptions are to be returned. * * @return the set of all <code>Throwable</code>s. */ public ThrowableSet mightThrow(Unit u) { return ThrowableSet.Manager.v().ALL_THROWABLES; }
/** * A package-private method to provide unit tests with access * to the collection of ThrowableSets. */ Map<Integer, List> getSizeToSets() { return Manager.v().sizeToSets; } }
/** * Returns the set of all <code>Throwable</code>s as the set * of types that the specified unit might throw, regardless of the * unit's identity. * * @param u {@link Unit} whose exceptions are to be returned. * * @return the set of all <code>Throwable</code>s. */ public ThrowableSet mightThrow(Unit u) { return ThrowableSet.Manager.v().ALL_THROWABLES; }
result = Manager.v().registerSetIfNew(resultSet, this.exceptionsExcluded); } else { result = this;
return new Pair(ThrowableSet.Manager.v().EMPTY, this); return new Pair(ThrowableSet.Manager.v().EMPTY, this); } else if (h.canStoreType(exclusionBase, catcher)) { ThrowableSet caughtSet = Manager.v().registerSetIfNew(caughtIncluded, caughtExcluded); ThrowableSet uncaughtSet = Manager.v().registerSetIfNew(uncaughtIncluded, uncaughtExcluded); return new Pair(caughtSet, uncaughtSet);
result = Manager.v().registerSetIfNew(resultSet, this.exceptionsExcluded); addToMemoizedAdds(e, result); return result;
Unit blockTail = block.getTail(); ArrayList<ExceptionDest> blocksDests = null; ThrowableSet escapingThrowables = ThrowableSet.Manager.v().EMPTY; escapingThrowables = escapingThrowables.add(unitDest.getThrowables()); } catch (ThrowableSet.AlreadyHasExclusionsException e) { if (escapingThrowables != ThrowableSet.Manager.v().EMPTY) { if (escapingThrowables != ThrowableSet.Manager.v().EMPTY) { ExceptionDest escapingDest = new ExceptionDest(null, escapingThrowables, null); blocksDests.add(escapingDest);
result = Manager.v().registerSetIfNew(resultSet, this.exceptionsExcluded); } else { result = this;
if (!catchableAs.getCaught().equals(ThrowableSet.Manager.v().EMPTY)) { result = addDestToMap(result, unit, trap, catchableAs.getCaught()); unitToUncaughtThrowables.put(unit, catchableAs.getUncaught()); Unit unit = entry.getKey(); ThrowableSet escaping = entry.getValue(); if (escaping != ThrowableSet.Manager.v().EMPTY) { result = addDestToMap(result, unit, null, escaping);
public ThrowableSet mightThrowExplicitly(ThrowStmt t) { Value thrownExpression = t.getOp(); Type thrownType = thrownExpression.getType(); if (thrownType == null || thrownType instanceof UnknownType) { // We can't identify the type of thrownExpression, so... return ThrowableSet.Manager.v().ALL_THROWABLES; } else if (thrownType instanceof NullType) { ThrowableSet result = ThrowableSet.Manager.v().EMPTY; result = result.add(ThrowableSet.Manager.v().NULL_POINTER_EXCEPTION); return result; } else if (!(thrownType instanceof RefType)) { throw new IllegalStateException("UnitThrowAnalysis StmtSwitch: type of throw argument is not a RefType!"); } else { ThrowableSet result = ThrowableSet.Manager.v().EMPTY; if (thrownExpression instanceof NewInvokeExpr) { // In this case, we know the exact type of the // argument exception. result = result.add((RefType) thrownType); } else { result = result.add(AnySubType.v((RefType) thrownType)); } return result; } }
/** * Returns the set of all <code>Throwable</code>s as the set of types that a <code>throw</code> statement may throw * implicitly, that is, the possible types of errors which might arise in the course of executing the <code>throw</code> * statement, rather than the type of the <code>throw</code>'s operand. * * @param t * the {@link ThrowStmt} whose exceptions are to be returned. * * @return the set of all <code>Throwable</code>s. */ public ThrowableSet mightThrowImplicitly(ThrowStmt t) { return ThrowableSet.Manager.v().ALL_THROWABLES; } }
/** * Returns the set of all <code>Throwable</code>s as the set of types that a <code>throw</code> instruction may throw * implicitly, that is, the possible types of errors which might arise in the course of executing the <code>throw</code> * instruction, rather than the type of the <code>throw</code>'s operand. * * @param t * the {@link ThrowInst} whose exceptions are to be returned. * * @return the set of all <code>Throwable</code>s. */ public ThrowableSet mightThrowImplicitly(ThrowInst t) { return ThrowableSet.Manager.v().ALL_THROWABLES; }
public ThrowableSet mightThrowExplicitly(ThrowInst t) { // Deducing the type at the top of the Baf stack is beyond me, so... return ThrowableSet.Manager.v().ALL_THROWABLES; }
@Override public void caseDynamicInvokeInst(DynamicInvokeInst i) { result = result.add(mgr.RESOLVE_METHOD_ERRORS); result = result.add(mgr.NULL_POINTER_EXCEPTION); result = result.add(mgr.INITIALIZATION_ERRORS); // might throw anything result = result.add(ThrowableSet.Manager.v().ALL_THROWABLES); }
@Override public ThrowableSet getThrowables() { if (null == throwables) { throwables = ThrowableSet.Manager.v().EMPTY; for (Unit unit : b) { throwables = throwables.add(throwAnalysis.mightThrow(unit)); } } return throwables; } };
/** * Returns the set of all <code>Throwable</code>s as the set of types that the specified unit might throw, regardless of * the unit's identity. * * @param u * {@link Unit} whose exceptions are to be returned. * * @return the set of all <code>Throwable</code>s. */ public ThrowableSet mightThrow(Unit u) { return ThrowableSet.Manager.v().ALL_THROWABLES; }