rep.splitter * sj.getSplitter().getSumOfWeights()));
rep.splitter));
    private static JMethodDeclaration makeWorkFunction(SIRSplitJoin sj,						       List children,						       RepInfo rep) {	// see whether or not we have a duplicate	boolean isDup = sj.getSplitter().getType()==SIRSplitType.DUPLICATE;        // Build the new work function; add the list of statements        // from each of the component filters.        JBlock newStatements = new JBlock(null, new LinkedList(), null);        Iterator childIter = children.iterator();	int i=0;         while (childIter.hasNext())        {            SIRFilter filter = (SIRFilter)childIter.next();            // Get the statements of the old work function            JBlock statements = filter.getWork().getBody();            // Make a for loop that repeats these statements according	    // to reps	    JStatement loop = Utils.makeForLoop(statements, rep.child[i]);	    // if we have a duplicating splitter, we need to make	    // pops into peeks	    if (isDup) {		loop = popToPeek(loop);	    }	    // add the loop to the new work function            newStatements.addStatement(loop);	    i++;        }	// add a pop loop to statements that pops the right number of	// times for the splitjoin	if (isDup) {	    newStatements.		addStatement(Utils.			     makeForLoop(new JExpressionStatement(null,								  new SIRPopExpression(sj.										       getInputType()),								  null),					 rep.splitter * sj.getSplitter().getSumOfWeights()));	}        // Now make a new work function based on this.        JMethodDeclaration newWork =            new JMethodDeclaration(null,                                   at.dms.kjc.Constants.ACC_PUBLIC,                                   CStdType.Void,                                   "work",                                   JFormalParameter.EMPTY,                                   CClassType.EMPTY,                                   newStatements,                                   null,                                   null);        return newWork;    }