public boolean contains(Object o) { return aug_list.contains(o); }
public boolean contains(Object o) { return body.contains(o); }
public List<AugmentedStmt> get_CatchExits() { if (catchBody == null) { return null; } if (dirty) { exitList = new LinkedList<AugmentedStmt>(); dirty = false; for (AugmentedStmt as : catchBody) { for (AugmentedStmt succ : as.bsuccs) { if (catchBody.contains(succ) == false) { exitList.add(as); break; } } } } return exitList; }
public boolean add_Child(SETNode child, IterableSet children) { if ((this == child) || (children.contains(child))) { return false; } children.add(child); child.parent = this; return true; }
public boolean add(T o) { if (o == null) { throw new IllegalArgumentException("Cannot add \"null\" to an IterableSet."); } if (contains(o)) { return false; } return super.add(o); }
public boolean remove(Object o) { if ((o == null) || (contains(o) == false)) { return false; } return super.remove(o); }
public boolean remove_Child(SETNode child, IterableSet children) { if ((this == child) || (children.contains(child) == false)) { return false; } children.remove(child); child.parent = null; return true; }
public boolean insert_ChildBefore(SETNode child, SETNode point, IterableSet children) { if ((this == child) || (this == point) || (children.contains(point) == false)) { return false; } children.insertBefore(child, point); child.parent = this; return true; }
public boolean has_IntersectionWith(SETNode other) { for (AugmentedStmt as : other.get_Body()) { if (body.contains(as)) { return true; } } return false; }
public boolean intersects(IterableSet<T> other) { if (other == null) { throw new IllegalArgumentException("Cannot set intersect an IterableSet with \"null\"."); } if (other.size() < size()) { for (T t : other) { if (contains(t)) { return true; } } } else { for (T t : this) { if (other.contains(t)) { return true; } } } return false; }
private void DFS(AugmentedStmt as, HashSet<AugmentedStmt> touchSet, HashSet<AugmentedStmt> backTargets, IterableSet<AugmentedStmt> scc) { for (AugmentedStmt sas : as.csuccs) { if (scc.contains(sas) == false) { continue; } if (touchSet.contains(sas)) { if (backTargets.contains(sas) == false) { backTargets.add(sas); } } else { touchSet.add(sas); DFS(sas, touchSet, backTargets, scc); touchSet.remove(sas); } } }
public boolean isSupersetOf(IterableSet<T> other) { if (other == null) { throw new IllegalArgumentException("Cannot set compare an IterableSet with \"null\"."); } if (size() < other.size()) { return false; } for (T t : other) { if (!contains(t)) { return false; } } return true; }
public boolean isSubsetOf(IterableSet<T> other) { if (other == null) { throw new IllegalArgumentException("Cannot set compare an IterableSet with \"null\"."); } if (size() > other.size()) { return false; } for (T t : this) { if (!other.contains(t)) { return false; } } return true; }
private void removeOtherDominatedStmts(IterableSet synchBody, AugmentedStmt sas) { ArrayList toRemove = new ArrayList(); Iterator it = synchBody.iterator(); while (it.hasNext()) { AugmentedStmt as = (AugmentedStmt) it.next(); IterableSet doms = as.get_Dominators(); if (doms.contains(sas)) { // System.out.println("\n\nstmt:"+as+" is dominated by removed stmt"+sas); toRemove.add(as); } } it = toRemove.iterator(); while (it.hasNext()) { AugmentedStmt as = (AugmentedStmt) it.next(); // System.out.println("Removed dominated stmt: "+as); synchBody.remove(as); } }
private IterableSet<AugmentedStmt> get_EntryPoint(IterableSet<AugmentedStmt> nodeList) { IterableSet<AugmentedStmt> entryPoints = new IterableSet<AugmentedStmt>(); for (AugmentedStmt as : nodeList) { for (AugmentedStmt po : as.cpreds) { if (nodeList.contains(po) == false) { entryPoints.add(as); break; } } } return entryPoints; }
public IterableSet get_NaturalExits() { IterableSet c = new IterableSet(); Iterator<IterableSet> it = subBodies.iterator(); while (it.hasNext()) { Iterator eit = ((SETNode) body2childChain.get(it.next()).getLast()).get_NaturalExits().iterator(); while (eit.hasNext()) { Object o = eit.next(); if (c.contains(o) == false) { c.add(o); } } } return c; }
public void find_Continues(SETNode SETParent, IterableSet body, IterableSet children) { if ((SETParent instanceof SETCycleNode) == false) { return; } SETCycleNode scn = (SETCycleNode) SETParent; IterableSet naturalPreds = ((SETNode) children.getLast()).get_NaturalExits(); Iterator pit = scn.get_CharacterizingStmt().bpreds.iterator(); while (pit.hasNext()) { AugmentedStmt pas = (AugmentedStmt) pit.next(); if ((body.contains(pas)) && (naturalPreds.contains(pas) == false)) { ((SETStatementSequenceNode) pas.myNode).insert_AbruptStmt(new DAbruptStmt("continue", scn.get_Label())); } } }
public void find(DavaBody body, AugmentedStmtGraph asg, SETNode SET) throws RetriggerAnalysisException { Dava.v().log("ExceptionFinder::find()"); for (ExceptionNode en : body.get_ExceptionFacts()) { if (body.get_SynchronizedBlockFacts().contains(en)) { continue; } IterableSet<AugmentedStmt> fullBody = new IterableSet<AugmentedStmt>(); for (IterableSet<AugmentedStmt> is : en.get_CatchList()) { fullBody.addAll(is); } fullBody.addAll(en.get_TryBody()); if (SET.nest(new SETTryNode(fullBody, en, asg, body)) == false) { throw new RetriggerAnalysisException(); } } }