return allStates;
}
Path p = (Path) t.getPaths().get(0); // all paths have same upseg
//the easy part
allStates.addAll(p.getUpwardSegment());
TransitionTarget source = t.getParent();
for (Iterator act = currentStates.iterator(); act.hasNext();) {
TransitionTarget a = (TransitionTarget) act.next();
if (isDescendant(a, source)) {
boolean added = false;
added = allStates.add(a);
while (added && a != source) {
a = a.getParent();
added = allStates.add(a);
}
}
}
if (p.isCrossRegion()) {
for (Iterator regions = p.getRegionsExited().iterator();
regions.hasNext();) {
Parallel par = ((Parallel) ((State) regions.next()).
getParent());
//let's find affected states in sibling regions
for (Iterator siblings = par.getChildren().iterator();
siblings.hasNext();) {
State s = (State) siblings.next();
for (Iterator act = currentStates.iterator();
act.hasNext();) {
TransitionTarget a = (TransitionTarget) act.next();
if (isDescendant(a, s)) {
//a is affected
boolean added = false;
added = allStates.add(a);
while (added && a != s) {
a = a.getParent();
added = allStates.add(a);
}
}
}
}