OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | fractal-commits List | Febuary 2007 Index

<--  Date Index  --> <--  Thread Index  -->

[1301] trunk/fractalbpc/src/org/objectweb/fractal/bpc/checker/state/DenotedState.java: fractalbpc: bugfix of incorrect state signatures within alternative nodes.


Title: [1301] trunk/fractalbpc/src/org/objectweb/fractal/bpc/checker/state/DenotedState.java: fractalbpc: bugfix of incorrect state signatures within alternative nodes.
Revision
1301
Author
kofron
Date
2007-02-22 10:28:53 +0100 (Thu, 22 Feb 2007)

Log Message

fractalbpc: bugfix of incorrect state signatures within alternative nodes.

Modified Paths

Diff

Modified: trunk/fractalbpc/src/org/objectweb/fractal/bpc/checker/state/DenotedState.java (1300 => 1301)


--- 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  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.