//calculate the current class
while(current!=root && current.getNodeType()!=CLASS_DECL){
if(current.getNodeType()==METHOD_DECL){
MethodDeclaration methDecl = (MethodDeclaration) current;
LocalVariableCollector collector = new LocalVariableCollector();
methDecl.accept(collector);
locals.addAll(collector.getLocalVariables());
}
current = current.getParent();
}