From: <jbo...@li...> - 2006-04-20 03:43:17
|
Author: mar...@jb... Date: 2006-04-19 23:42:56 -0400 (Wed, 19 Apr 2006) New Revision: 3826 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/GroupElement.java Log: -comment out some transformation code, make it work in 3.1 Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/GroupElement.java =================================================================== --- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/GroupElement.java 2006-04-20 03:30:44 UTC (rev 3825) +++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/rule/GroupElement.java 2006-04-20 03:42:56 UTC (rev 3826) @@ -53,39 +53,42 @@ // } // } - if ( child instanceof GroupElement && ( child instanceof And || child instanceof Or ) ) { - GroupElement group = ( GroupElement ) child; - - // Removal single branch group elements - // If the child is a GroupElement iterate down until we either - // find a GroupElement that has more than one children, or its not a GroupElement - if ( group.getChildren().size() == 1 ) { - child = group.getChildren().get( 0 ); - } - } + //@todo make this work for 3.1 +// if ( child instanceof GroupElement && ( child instanceof And || child instanceof Or ) ) { +// GroupElement group = ( GroupElement ) child; +// +// // Removal single branch group elements +// // If the child is a GroupElement iterate down until we either +// // find a GroupElement that has more than one children, or its not a GroupElement +// if ( group.getChildren().size() == 1 ) { +// child = group.getChildren().get( 0 ); +// } +// } +// +// if ( child instanceof GroupElement && ( child instanceof And || child instanceof Or ) ) { +// GroupElement group = ( GroupElement ) child; +// +// // Remove nested Ands/Ors +// if ( group.getClass() == this.getClass() ) { +// +// GroupElement newGroup = null; +// if ( group instanceof And) { +// newGroup = new And(); +// } else { +// newGroup = new Or(); +// } +// +// for ( Iterator it = group.getChildren().iterator(); it.hasNext(); ) { +// this.children.add( it.next() ); +// } +// } else { +// this.children.add( child ); +// } +// } else { +// this.children.add( child ); +// } - if ( child instanceof GroupElement && ( child instanceof And || child instanceof Or ) ) { - GroupElement group = ( GroupElement ) child; - - // Remove nested Ands/Ors - if ( group.getClass() == this.getClass() ) { - - GroupElement newGroup = null; - if ( group instanceof And) { - newGroup = new And(); - } else { - newGroup = new Or(); - } - - for ( Iterator it = group.getChildren().iterator(); it.hasNext(); ) { - this.children.add( it.next() ); - } - } else { - this.children.add( child ); - } - } else { - this.children.add( child ); - } + this.children.add( child ); } |