System.err.println("access to " + self + " in " + filter);
    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 = filter.getMethods();        JMethodDeclaration init = filter.getInit();        for(int i=0;i<methods.length;i++)            if(methods[i]!=init)                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);                        }                        public void visitFieldExpression(JFieldAccessExpression self,                                                         JExpression left,                                                         String ident) {                            // if we are in assignment, mark that there is mutable state                            if (inAssignment[0]) {                                System.err.println("access to " + self + " in " + filter);                                foundMutable[0] = true;                            }                            super.visitFieldExpression(self, left, ident);                        }                                            });        return foundMutable[0];    }