[jboss-svn-commits] JBL Code SVN: r31766 - in labs/jbossrules/branches/true_modify_20100215: drools-core/src/main/java/org/drools/reteoo and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Feb 21 21:42:45 EST 2010


Author: tirelli
Date: 2010-02-21 21:42:45 -0500 (Sun, 21 Feb 2010)
New Revision: 31766

Modified:
   labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/resources/org/drools/integrationtests/test_ModifyRetractInsert.drl
   labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/ExistsNode.java
   labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/NotNode.java
Log:
JBRULES-2339: JBRULES-2340: fixing tests

Modified: labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/resources/org/drools/integrationtests/test_ModifyRetractInsert.drl
===================================================================
--- labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/resources/org/drools/integrationtests/test_ModifyRetractInsert.drl	2010-02-22 00:01:27 UTC (rev 31765)
+++ labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/resources/org/drools/integrationtests/test_ModifyRetractInsert.drl	2010-02-22 02:42:45 UTC (rev 31766)
@@ -9,7 +9,6 @@
 then
     results.add( $c );
     retract( $c );
-    modifyRetract( $p );
     $p.setStatus( "full" );
-    modifyInsert( $p );
+    update( $p );
 end
\ No newline at end of file

Modified: labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/ExistsNode.java
===================================================================
--- labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/ExistsNode.java	2010-02-22 00:01:27 UTC (rev 31765)
+++ labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/ExistsNode.java	2010-02-22 02:42:45 UTC (rev 31766)
@@ -106,7 +106,9 @@
                                                        rightTuple.getFactHandle() ) ) {
 
                 leftTuple.setBlocker( rightTuple );
-                rightTuple.addBlocked( leftTuple );
+                if ( this.tupleMemoryEnabled ) {
+                    rightTuple.addBlocked( leftTuple );
+                }
 
                 break;
             }
@@ -141,29 +143,6 @@
     public void assertObject(final InternalFactHandle factHandle,
                              final PropagationContext context,
                              final InternalWorkingMemory workingMemory) {
-        //        final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
-        //        memory.getRightTupleMemory().add( factHandle );
-        //
-        //        if ( !this.tupleMemoryEnabled ) {
-        //            // do nothing here, as we know there are no left tuples at this stage in sequential mode.
-        //            return;
-        //        }
-        //
-        //        final Iterator it = memory.getLeftTupleMemory().iterator( factHandle );
-        //        this.constraints.updateFromFactHandle( memory.getContext(),
-        //                                               workingMemory,
-        //                                               factHandle );
-        //        for ( LeftTuple tuple = (LeftTuple) it.next(); tuple != null; tuple = (LeftTuple) it.next() ) {
-        //            if ( this.constraints.isAllowedCachedRight( memory.getContext(),
-        //                                                        tuple ) && tuple.getMatch() == null ) {
-        //                tuple.setMatch( factHandle );
-        //                this.sink.propagateAssertLeftTuple( tuple,
-        //                                                    context,
-        //                                                    workingMemory );
-        //            }
-        //        }
-        //
-        //        this.constraints.resetFactHandle( memory.getContext() );
 
         final RightTuple rightTuple = new RightTuple( factHandle,
                                                       this );
@@ -434,26 +413,21 @@
         if ( firstBlocked != null ) {
             // now process existing blocks, we only process existing and not new from above loop
 
-            // determine if we are in the same bucket or not, as if we are we need to re-test the current FactHandle
-            boolean sameIndex = (leftMemory.isIndexed() && firstLeftTuple == leftMemory.getFirst( firstBlocked ));
-
             final RightTuple rootBlocker = (RightTuple) rightTuple.getNext();
 
             // iterate all the existing previous blocked LeftTuples
             for ( LeftTuple leftTuple = (LeftTuple) firstBlocked; leftTuple != null; ) {
-                if ( sameIndex && this.constraints.isAllowedCachedRight( memory.getContext(),
+                LeftTuple temp = leftTuple.getBlockedNext();
+                if ( this.constraints.isAllowedCachedRight( memory.getContext(),
                                                                          leftTuple ) ) {
-                    LeftTuple temp = leftTuple.getBlockedNext();
                     leftTuple.setBlockedPrevious( null ); // must null these as we are re-adding them to the list
                     leftTuple.setBlockedNext( null );
                     // in the same bucket and it still blocks, so add back into blocked list
                     rightTuple.addBlocked( leftTuple ); // no need to set on LeftTuple, as it already has the reference
-                    leftTuple = temp.getBlockedNext();
+                    leftTuple = temp;
                     continue;
                 }
 
-                LeftTuple temp = leftTuple.getBlockedNext();
-
                 leftTuple.setBlocker( null );
                 leftTuple.setBlockedPrevious( null );
                 leftTuple.setBlockedNext( null );

Modified: labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/NotNode.java
===================================================================
--- labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/NotNode.java	2010-02-22 00:01:27 UTC (rev 31765)
+++ labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/NotNode.java	2010-02-22 02:42:45 UTC (rev 31766)
@@ -352,9 +352,6 @@
         if ( firstBlocked != null ) {
             // now process existing blocks, we only process existing and not new from above loop
 
-            // determine if we are in the same bucket or not, as if we are we need to re-test the current FactHandle
-            //boolean sameIndex = (leftMemory.isIndexed() && firstLeftTuple == leftMemory.getFirst( firstBlocked ));
-
             final RightTuple rootBlocker = (RightTuple) rightTuple.getNext();
 
             // iterate all the existing previous blocked LeftTuples



More information about the jboss-svn-commits mailing list