for( int i=0; i<b.length; i++ ) {
final boolean[] hasChildFieldItem = new boolean[1];
// compute the multiplicity of the all child JavaItems and
// also compute whether this branch has FieldItem in it.
Multiplicity m = Multiplicity.calc( b[i],
new MultiplicityCounter(){
protected Multiplicity isChild( Expression exp ) {
if(exp instanceof FieldItem) hasChildFieldItem[0] = true;
if(exp instanceof PrimitiveItem) bBranchWithPrimitive[0] = true;
if(exp instanceof IgnoreItem) return Multiplicity.zero;
if(exp instanceof JavaItem) return Multiplicity.one;
else return null;
}
});
if(debug!=null) {
debug.println( " Branch: " + ExpressionPrinter.printContentModel(b[i]) );
debug.println( " multiplicity:"+m+" hasChildFieldItem:"+hasChildFieldItem[0] );
}
if(m.isZero())
continue; // do nothing for this branch.
numLiveBranch++;
if(!m.isAtMostOnce()) {
// memorize that this branch is complex.
complexBranch[i] = true;
continue;
}