JMethodDeclaration[] methods = getSteadyMethods(filter); for (int i=0; i<methods.length; i++) methods[i].accept(new SLIREmptyVisitor() {
List<JMethodDeclaration> methods = GetSteadyMethods.getSteadyMethods(filter); for (JMethodDeclaration method : methods) method.accept(new SLIREmptyVisitor() {
    public static boolean hasMutableState(final SIRFilter filter) {        // whether or not we are on the LHS of an assignment        final boolean[] inAssignment = { false };        // whether or not we have found any mutable state        final boolean[] foundMutable = { false };        // visit all methods except <init>        JMethodDeclaration[] methods = getSteadyMethods(filter);        for (int i=0; i<methods.length; i++)            methods[i].accept(new SLIREmptyVisitor() {                    // wrap visit to <left> with some book-keeping                    // to indicate that it is on the LHS of an assignment                    private void wrapVisit(JExpression left) {                        // in case of nested assignment                        // expressions, remember the old value of <inAssignment>                        boolean old = inAssignment[0];                        inAssignment[0] = true;                        left.accept(this);                        inAssignment[0] = old;                    }                    public void visitCompoundAssignmentExpression(JCompoundAssignmentExpression self,                                                                  int oper,                                                                  JExpression left,                                                                  JExpression right) {                        wrapVisit(left);                        right.accept(this);                    }                    public void visitAssignmentExpression(JAssignmentExpression self,                                                          JExpression left,                                                          JExpression right) {                        wrapVisit(left);                        right.accept(this);                    }                    // need to count i++ as mutated state if i is a field                    public void visitPostfixExpression(JPostfixExpression self,                                                       int oper,                                                       JExpression expr) {                        wrapVisit(expr);                    }                    // need to count ++i as mutated state if i is a field                    public void visitPrefixExpression(JPrefixExpression self,                                                      int oper,                                                      JExpression expr) {                        wrapVisit(expr);                    }                    public void visitFieldExpression(JFieldAccessExpression self,                                                     JExpression left,                                                     String ident) {                        // if we are in assignment, mark that there is mutable state                        if (inAssignment[0]) {                            foundMutable[0] = true;                        }                        super.visitFieldExpression(self, left, ident);                    }                                        });        return foundMutable[0];    }