if (isDup) { newStatements. addStatement(Utils. makeForLoop(new JExpressionStatement(null, new SIRPopExpression(sj. getInputType()), null), rep.splitter));
if (isDup && rep.splitter > 0) { newStatements.addStatement( new JExpressionStatement( new SIRPopExpression(sj.getInputType(),rep.splitter)));
    private static JMethodDeclaration makeWorkFunction(SIRSplitJoin sj,                                                       List children,                                                       SRepInfo 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);        FindVarDecls findVarDecls = new FindVarDecls();        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();                //replace variable accesses with numbered variables                if (KjcOptions.rename1) {                    statements = (JBlock)findVarDecls.findAndReplace(statements);                }                // 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));        }        //add variable declarations calculated by FindVarDecls        if (KjcOptions.rename1) {            findVarDecls.addVariableDeclarations(newStatements);        }        // 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;    }