public void visitVariableDefinition(JVariableDefinition self, int modifiers, CType type, String ident, JExpression expr) { super.visitVariableDefinition(self,modifiers,type,ident,expr); if (expr != null) { if(no.contains(self)) return; if (expr instanceof JLiteral) { yes.put(self,expr); } } }
    private Hashtable findLocals(JMethodDeclaration meth)    {        final Hashtable yes = new Hashtable();                // This looks a lot like the thing we had for fields, except        // that it looks for local variables.        meth.accept(new SLIREmptyVisitor() {                private HashSet no = new HashSet();                		public void visitVariableDefinition(JVariableDefinition self,						    int modifiers,						      CType type,						    String ident,						    JExpression expr) {		    super.visitVariableDefinition(self,modifiers,type,ident,expr);		    if (expr != null) {			if(no.contains(self)) return;			if (expr instanceof JLiteral) {			    yes.put(self,expr);			}		    }		}		                public void visitAssignmentExpression                    (JAssignmentExpression self,                     JExpression left,                     JExpression right)                {                        super.visitAssignmentExpression(self, left, right);                        if (left instanceof JLocalVariableExpression)                        {                            JLocalVariableExpression lve =                                (JLocalVariableExpression)left;                            JLocalVariable lv = lve.getVariable();                            if (no.contains(lv)) return;                            if (yes.containsKey(lv))                            {                                yes.remove(lv);                                no.add(lv);                                return;                            }                            if (right instanceof JLiteral)                                yes.put(lv, right);                            else                                no.add(lv);                        }                }                public void visitCompoundAssignmentExpression                    (JCompoundAssignmentExpression self,                     int oper,                     JExpression left,                     JExpression right)                {                    super.visitCompoundAssignmentExpression                        (self, oper, left, right);                    // Instant death.                    if (left instanceof JLocalVariableExpression)                    {                        JLocalVariable lv =                            ((JLocalVariableExpression)left).getVariable();                        yes.remove(lv);                        no.add(lv);                    }                }                public void visitPrefixExpression                    (JPrefixExpression self,                     int oper,                     JExpression expr)                {                    super.visitPrefixExpression(self, oper, expr);                    // Again, instant death.                    if (expr instanceof JLocalVariableExpression)			{			    JLocalVariable lv =                            ((JLocalVariableExpression)expr).getVariable();			    yes.remove(lv);			    no.add(lv);			}		}                public void visitPostfixExpression                    (JPostfixExpression self,                     int oper,                     JExpression expr)                {                    super.visitPostfixExpression(self, oper, expr);                    // Again, instant death.                    if (expr instanceof JLocalVariableExpression)                    {                        JLocalVariable lv =                            ((JLocalVariableExpression)expr).getVariable();                        yes.remove(lv);                        no.add(lv);                    }                }            });        return yes;    }