Mail Archive Home | fractal-commits List | Febuary 2007 Index
| <-- Date Index --> | <-- Thread Index --> |
fractalbpc: bugfix of incorrect state signatures within alternative nodes.
--- trunk/fractalbpc/src/org/objectweb/fractal/bpc/checker/state/DenotedState.java 2007-02-21 21:05:43 UTC (rev 1300)
+++ trunk/fractalbpc/src/org/objectweb/fractal/bpc/checker/state/DenotedState.java 2007-02-22 09:28:53 UTC (rev 1301)
@@ -37,7 +37,9 @@
package org.objectweb.fractal.bpc.checker.state;
+import org.objectweb.fractal.bpc.checker.DFSR.CheckingException;
import org.objectweb.fractal.bpc.checker.node.AlternativeNode;
+import org.objectweb.fractal.bpc.checker.node.InvalidParameterException;
/**
* This class is to be used by an alternative node.
@@ -75,7 +77,9 @@
for (int i = 0; i < children; ++i)
signature.set(i, true); // the signature has a slot for -1 = 11..11
- else if (acc)
+
+
+ else if (acc && !this.hasAncestors())
for (int i = 0; i < children; ++i)
signature.set(i, false); // the signature has a slot for 0 = 00..00
// note here that it is safe and cannot colide with
@@ -107,7 +111,23 @@
another.getSignature();
return this.getSignature().equals(dstate.getSignature());
- }
+ }
+
+ /**
+ * Checks the current state for ancestors.
+ * @return true iff there is at least one ancestor of this state or in strange cases (of Exceptions).
+ */
+ private boolean hasAncestors() {
+ try {
+ return root.getTransitions(this).transitions.length > 0;
+ }
+ catch (InvalidParameterException e) {
+ return true;
+ }
+ catch (CheckingException e) {
+ return true;
+ }
+ }
/**
* Index of the subtree to which the state is related
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.