Program: 88542
Project: 88542
Buggy source:
private void handleFinalLocals(polyglot.ast.ClassMember member){
  MethodFinalsChecker mfc=new MethodFinalsChecker();
  member.visit(mfc);
  AnonLocalClassInfo alci=new AnonLocalClassInfo();
  if (member instanceof polyglot.ast.ProcedureDecl) {
    polyglot.ast.ProcedureDecl procedure=(polyglot.ast.ProcedureDecl)member;
    alci.finalLocalsAvail(mfc.finalLocals());
    if (procedure.flags().isStatic()) {
      alci.inStaticMethod(true);
    }
  }
 else   if (member instanceof polyglot.ast.FieldDecl) {
    alci.finalLocalsAvail(new ArrayList());
    if (((polyglot.ast.FieldDecl)member).flags().isStatic()) {
      alci.inStaticMethod(true);
    }
  }
 else   if (member instanceof polyglot.ast.Initializer) {
    alci.finalLocalsAvail(mfc.finalLocals());
    if (((polyglot.ast.Initializer)member).flags().isStatic()) {
      alci.inStaticMethod(true);
    }
  }
  if (finalLocalInfo == null) {
    finalLocalInfo=new HashMap();
  }
  Iterator it=mfc.inners().iterator();
  while (it.hasNext()) {
    polyglot.types.ClassType cType=(polyglot.types.ClassType)((polyglot.util.IdentityKey)it.next()).object();
    HashMap typeToLocalUsed=mfc.typeToLocalsUsed();
    ArrayList localsUsed=new ArrayList();
    if (typeToLocalUsed.containsKey(new polyglot.util.IdentityKey(cType))) {
      ArrayList localsNeeded=(ArrayList)typeToLocalUsed.get(new polyglot.util.IdentityKey(cType));
      Iterator usesIt=localsNeeded.iterator();
      while (usesIt.hasNext()) {
        polyglot.types.LocalInstance li=(polyglot.types.LocalInstance)((polyglot.util.IdentityKey)usesIt.next()).object();
        if (alci.finalLocalsAvail().contains(new polyglot.util.IdentityKey(li))) {
          localsUsed.add(new polyglot.util.IdentityKey(li));
        }
      }
    }
    AnonLocalClassInfo info=new AnonLocalClassInfo();
    info.inStaticMethod(alci.inStaticMethod());
    info.finalLocalsAvail(localsUsed);
    if (!finalLocalInfo.containsKey(new polyglot.util.IdentityKey(cType))) {
      finalLocalInfo.put(new polyglot.util.IdentityKey(cType),info);
    }
  }
}

Fixed version (ground truth):
private void handleFinalLocals(polyglot.ast.ClassMember member){
  MethodFinalsChecker mfc=new MethodFinalsChecker();
  member.visit(mfc);
  if (cCallList == null) {
    cCallList=new ArrayList();
  }
  cCallList.addAll(mfc.ccallList());
  AnonLocalClassInfo alci=new AnonLocalClassInfo();
  if (member instanceof polyglot.ast.ProcedureDecl) {
    polyglot.ast.ProcedureDecl procedure=(polyglot.ast.ProcedureDecl)member;
    alci.finalLocalsAvail(mfc.finalLocals());
    if (procedure.flags().isStatic()) {
      alci.inStaticMethod(true);
    }
  }
 else   if (member instanceof polyglot.ast.FieldDecl) {
    alci.finalLocalsAvail(new ArrayList());
    if (((polyglot.ast.FieldDecl)member).flags().isStatic()) {
      alci.inStaticMethod(true);
    }
  }
 else   if (member instanceof polyglot.ast.Initializer) {
    alci.finalLocalsAvail(mfc.finalLocals());
    if (((polyglot.ast.Initializer)member).flags().isStatic()) {
      alci.inStaticMethod(true);
    }
  }
  if (finalLocalInfo == null) {
    finalLocalInfo=new HashMap();
  }
  Iterator it=mfc.inners().iterator();
  while (it.hasNext()) {
    polyglot.types.ClassType cType=(polyglot.types.ClassType)((polyglot.util.IdentityKey)it.next()).object();
    HashMap typeToLocalUsed=mfc.typeToLocalsUsed();
    ArrayList localsUsed=new ArrayList();
    if (typeToLocalUsed.containsKey(new polyglot.util.IdentityKey(cType))) {
      ArrayList localsNeeded=(ArrayList)typeToLocalUsed.get(new polyglot.util.IdentityKey(cType));
      Iterator usesIt=localsNeeded.iterator();
      while (usesIt.hasNext()) {
        polyglot.types.LocalInstance li=(polyglot.types.LocalInstance)((polyglot.util.IdentityKey)usesIt.next()).object();
        if (alci.finalLocalsAvail().contains(new polyglot.util.IdentityKey(li))) {
          localsUsed.add(new polyglot.util.IdentityKey(li));
        }
      }
    }
    AnonLocalClassInfo info=new AnonLocalClassInfo();
    info.inStaticMethod(alci.inStaticMethod());
    info.finalLocalsAvail(localsUsed);
    if (!finalLocalInfo.containsKey(new polyglot.util.IdentityKey(cType))) {
      finalLocalInfo.put(new polyglot.util.IdentityKey(cType),info);
    }
  }
}