Program: 62096
Project: 62096
Buggy source:
private int renameAS2Identifiers(RenameType renameType,Map<String,String> selected){
  actionsMap=new HashMap<>();
  allFunctions=new ArrayList<>();
  allVariableNames=new ArrayList<>();
  allStrings=new HashMap<>();
  List<Object> objs=new ArrayList<>();
  int ret=0;
  objs.addAll(tags);
  getVariables(objs,"String_Node_Str");
  informListeners("String_Node_Str","String_Node_Str");
  int fc=0;
  for (  KeyValue<DirectValueTreeItem,ConstantPool> it : allVariableNames) {
    String name=it.key.toStringNoH(it.value);
    allVariableNamesStr.add(name);
  }
  informListeners("String_Node_Str","String_Node_Str");
  int classCount=0;
  for (  Tag t : tags) {
    if (t instanceof DoInitActionTag) {
      classCount++;
    }
  }
  int cnt=0;
  for (  Tag t : tags) {
    if (t instanceof DoInitActionTag) {
      cnt++;
      informListeners("String_Node_Str","String_Node_Str" + cnt + "String_Node_Str"+ classCount);
      DoInitActionTag dia=(DoInitActionTag)t;
      String exportName=dia.getExportName();
      final String pkgPrefix="String_Node_Str";
      String classNameParts[]=null;
      if ((exportName != null) && exportName.startsWith(pkgPrefix)) {
        String className=exportName.substring(pkgPrefix.length());
        if (className.contains("String_Node_Str")) {
          classNameParts=className.split("String_Node_Str");
        }
 else {
          classNameParts=new String[]{className};
        }
      }
      List<GraphTargetItem> dec=Action.actionsToTree(dia.getActions(version),version);
      GraphTargetItem name=null;
      for (      GraphTargetItem it : dec) {
        if (it instanceof ClassTreeItem) {
          ClassTreeItem cti=(ClassTreeItem)it;
          List<GraphTargetItem> methods=new ArrayList<>();
          methods.addAll(cti.functions);
          methods.addAll(cti.staticFunctions);
          for (          GraphTargetItem gti : methods) {
            if (gti instanceof FunctionTreeItem) {
              FunctionTreeItem fun=(FunctionTreeItem)gti;
              if (fun.calculatedFunctionName instanceof DirectValueTreeItem) {
                DirectValueTreeItem dvf=(DirectValueTreeItem)fun.calculatedFunctionName;
                String fname=dvf.toStringNoH(null);
                String changed=deobfuscateName(fname,false,"String_Node_Str",renameType,selected);
                if (changed != null) {
                  deobfuscated.put(fname,changed);
                }
              }
            }
          }
          List<GraphTargetItem> vars=new ArrayList<>();
          vars.addAll(cti.vars.keySet());
          vars.addAll(cti.staticVars.keySet());
          for (          GraphTargetItem gti : vars) {
            if (gti instanceof DirectValueTreeItem) {
              DirectValueTreeItem dvf=(DirectValueTreeItem)gti;
              String vname=dvf.toStringNoH(null);
              String changed=deobfuscateName(vname,false,"String_Node_Str",renameType,selected);
              if (changed != null) {
                deobfuscated.put(vname,changed);
              }
            }
          }
          name=cti.className;
          break;
        }
        if (it instanceof InterfaceTreeItem) {
          InterfaceTreeItem ift=(InterfaceTreeItem)it;
          name=ift.name;
        }
      }
      if (name != null) {
        int pos=0;
        while (name instanceof GetMemberTreeItem) {
          GetMemberTreeItem mem=(GetMemberTreeItem)name;
          GraphTargetItem memberName=mem.memberName;
          if (memberName instanceof DirectValueTreeItem) {
            DirectValueTreeItem dvt=(DirectValueTreeItem)memberName;
            String nameStr=dvt.toStringNoH(null);
            if (classNameParts != null) {
              if (classNameParts.length - 1 - pos < 0) {
                break;
              }
            }
            String changedNameStr=nameStr;
            if (classNameParts != null) {
              changedNameStr=classNameParts[classNameParts.length - 1 - pos];
            }
            String changedNameStr2=deobfuscateName(changedNameStr,pos == 0,pos == 0 ? "String_Node_Str" : "String_Node_Str",renameType,selected);
            if (changedNameStr2 != null) {
              changedNameStr=changedNameStr2;
            }
            deobfuscated.put(nameStr,changedNameStr);
            pos++;
          }
          name=mem.object;
        }
        if (name instanceof GetVariableTreeItem) {
          GetVariableTreeItem var=(GetVariableTreeItem)name;
          if (var.name instanceof DirectValueTreeItem) {
            DirectValueTreeItem dvt=(DirectValueTreeItem)var.name;
            String nameStr=dvt.toStringNoH(null);
            if (classNameParts != null) {
              if (classNameParts.length - 1 - pos < 0) {
                break;
              }
            }
            String changedNameStr=nameStr;
            if (classNameParts != null) {
              changedNameStr=classNameParts[classNameParts.length - 1 - pos];
            }
            String changedNameStr2=deobfuscateName(changedNameStr,pos == 0,pos == 0 ? "String_Node_Str" : "String_Node_Str",renameType,selected);
            if (changedNameStr2 != null) {
              changedNameStr=changedNameStr2;
            }
            deobfuscated.put(nameStr,changedNameStr);
            pos++;
          }
        }
      }
    }
  }
  for (  GraphSourceItem fun : allFunctions) {
    fc++;
    informListeners("String_Node_Str","String_Node_Str" + fc + "String_Node_Str"+ allFunctions.size());
    if (fun instanceof ActionDefineFunction) {
      ActionDefineFunction f=(ActionDefineFunction)fun;
      String changed=deobfuscateName(f.functionName,false,"String_Node_Str",renameType,selected);
      if (changed != null) {
        f.replacedFunctionName=changed;
      }
    }
    if (fun instanceof ActionDefineFunction2) {
      ActionDefineFunction2 f=(ActionDefineFunction2)fun;
      String changed=deobfuscateName(f.functionName,false,"String_Node_Str",renameType,selected);
      if (changed != null) {
        f.replacedFunctionName=changed;
      }
    }
  }
  HashSet<String> stringsNoVarH=new HashSet<>();
  List<DirectValueTreeItem> allVariableNamesDv=new ArrayList<>();
  for (  KeyValue<DirectValueTreeItem,ConstantPool> it : allVariableNames) {
    allVariableNamesDv.add(it.key);
  }
  for (  DirectValueTreeItem ti : allStrings.keySet()) {
    if (!allVariableNamesDv.contains(ti)) {
      stringsNoVarH.add(System.identityHashCode(allStrings.get(ti)) + "String_Node_Str" + ti.toStringNoH(allStrings.get(ti)));
    }
  }
  int vc=0;
  for (  KeyValue<DirectValueTreeItem,ConstantPool> it : allVariableNames) {
    vc++;
    String name=it.key.toStringNoH(it.value);
    String changed=deobfuscateName(name,false,usageTypes.get(it.key),renameType,selected);
    if (changed != null) {
      boolean addNew=false;
      String h=System.identityHashCode(it.key) + "String_Node_Str" + name;
      if (stringsNoVarH.contains(h)) {
        addNew=true;
      }
      ActionPush pu=(ActionPush)it.key.src;
      if (pu.replacement == null) {
        pu.replacement=new ArrayList<>();
        pu.replacement.addAll(pu.values);
      }
      if (pu.replacement.get(it.key.pos) instanceof ConstantIndex) {
        ConstantIndex ci=(ConstantIndex)pu.replacement.get(it.key.pos);
        ConstantPool pool=it.value;
        if (pool == null) {
          continue;
        }
        if (pool.constants == null) {
          continue;
        }
        if (addNew) {
          pool.constants.add(changed);
          ci.index=pool.constants.size() - 1;
        }
 else {
          pool.constants.set(ci.index,changed);
        }
      }
 else {
        pu.replacement.set(it.key.pos,changed);
      }
      ret++;
    }
  }
  for (  ASMSource src : actionsMap.keySet()) {
    actionsMap.put(src,Action.removeNops(0,actionsMap.get(src),version,0));
    src.setActions(actionsMap.get(src),version);
  }
  deobfuscateInstanceNames(renameType,tags,selected);
  return ret;
}

Fixed version (ground truth):
private int renameAS2Identifiers(RenameType renameType,Map<String,String> selected){
  actionsMap=new HashMap<>();
  allFunctions=new ArrayList<>();
  allVariableNames=new ArrayList<>();
  allStrings=new HashMap<>();
  List<Object> objs=new ArrayList<>();
  int ret=0;
  objs.addAll(tags);
  getVariables(objs,"String_Node_Str");
  informListeners("String_Node_Str","String_Node_Str");
  int fc=0;
  for (  KeyValue<DirectValueTreeItem,ConstantPool> it : allVariableNames) {
    String name=it.key.toStringNoH(it.value);
    allVariableNamesStr.add(name);
  }
  informListeners("String_Node_Str","String_Node_Str");
  int classCount=0;
  for (  Tag t : tags) {
    if (t instanceof DoInitActionTag) {
      classCount++;
    }
  }
  int cnt=0;
  for (  Tag t : tags) {
    if (t instanceof DoInitActionTag) {
      cnt++;
      informListeners("String_Node_Str","String_Node_Str" + cnt + "String_Node_Str"+ classCount);
      DoInitActionTag dia=(DoInitActionTag)t;
      String exportName=dia.getExportName();
      final String pkgPrefix="String_Node_Str";
      String classNameParts[]=null;
      if ((exportName != null) && exportName.startsWith(pkgPrefix)) {
        String className=exportName.substring(pkgPrefix.length());
        if (className.contains("String_Node_Str")) {
          classNameParts=className.split("String_Node_Str");
        }
 else {
          classNameParts=new String[]{className};
        }
      }
      List<GraphTargetItem> dec=Action.actionsToTree(dia.getActions(version),version);
      GraphTargetItem name=null;
      for (      GraphTargetItem it : dec) {
        if (it instanceof ClassTreeItem) {
          ClassTreeItem cti=(ClassTreeItem)it;
          List<GraphTargetItem> methods=new ArrayList<>();
          methods.addAll(cti.functions);
          methods.addAll(cti.staticFunctions);
          for (          GraphTargetItem gti : methods) {
            if (gti instanceof FunctionTreeItem) {
              FunctionTreeItem fun=(FunctionTreeItem)gti;
              if (fun.calculatedFunctionName instanceof DirectValueTreeItem) {
                DirectValueTreeItem dvf=(DirectValueTreeItem)fun.calculatedFunctionName;
                String fname=dvf.toStringNoH(null);
                String changed=deobfuscateName(fname,false,"String_Node_Str",renameType,selected);
                if (changed != null) {
                  deobfuscated.put(fname,changed);
                }
              }
            }
          }
          List<GraphTargetItem> vars=new ArrayList<>();
          for (          KeyValue<GraphTargetItem,GraphTargetItem> item : cti.vars) {
            vars.add(item.key);
          }
          for (          KeyValue<GraphTargetItem,GraphTargetItem> item : cti.staticVars) {
            vars.add(item.key);
          }
          for (          GraphTargetItem gti : vars) {
            if (gti instanceof DirectValueTreeItem) {
              DirectValueTreeItem dvf=(DirectValueTreeItem)gti;
              String vname=dvf.toStringNoH(null);
              String changed=deobfuscateName(vname,false,"String_Node_Str",renameType,selected);
              if (changed != null) {
                deobfuscated.put(vname,changed);
              }
            }
          }
          name=cti.className;
          break;
        }
        if (it instanceof InterfaceTreeItem) {
          InterfaceTreeItem ift=(InterfaceTreeItem)it;
          name=ift.name;
        }
      }
      if (name != null) {
        int pos=0;
        while (name instanceof GetMemberTreeItem) {
          GetMemberTreeItem mem=(GetMemberTreeItem)name;
          GraphTargetItem memberName=mem.memberName;
          if (memberName instanceof DirectValueTreeItem) {
            DirectValueTreeItem dvt=(DirectValueTreeItem)memberName;
            String nameStr=dvt.toStringNoH(null);
            if (classNameParts != null) {
              if (classNameParts.length - 1 - pos < 0) {
                break;
              }
            }
            String changedNameStr=nameStr;
            if (classNameParts != null) {
              changedNameStr=classNameParts[classNameParts.length - 1 - pos];
            }
            String changedNameStr2=deobfuscateName(changedNameStr,pos == 0,pos == 0 ? "String_Node_Str" : "String_Node_Str",renameType,selected);
            if (changedNameStr2 != null) {
              changedNameStr=changedNameStr2;
            }
            deobfuscated.put(nameStr,changedNameStr);
            pos++;
          }
          name=mem.object;
        }
        if (name instanceof GetVariableTreeItem) {
          GetVariableTreeItem var=(GetVariableTreeItem)name;
          if (var.name instanceof DirectValueTreeItem) {
            DirectValueTreeItem dvt=(DirectValueTreeItem)var.name;
            String nameStr=dvt.toStringNoH(null);
            if (classNameParts != null) {
              if (classNameParts.length - 1 - pos < 0) {
                break;
              }
            }
            String changedNameStr=nameStr;
            if (classNameParts != null) {
              changedNameStr=classNameParts[classNameParts.length - 1 - pos];
            }
            String changedNameStr2=deobfuscateName(changedNameStr,pos == 0,pos == 0 ? "String_Node_Str" : "String_Node_Str",renameType,selected);
            if (changedNameStr2 != null) {
              changedNameStr=changedNameStr2;
            }
            deobfuscated.put(nameStr,changedNameStr);
            pos++;
          }
        }
      }
    }
  }
  for (  GraphSourceItem fun : allFunctions) {
    fc++;
    informListeners("String_Node_Str","String_Node_Str" + fc + "String_Node_Str"+ allFunctions.size());
    if (fun instanceof ActionDefineFunction) {
      ActionDefineFunction f=(ActionDefineFunction)fun;
      String changed=deobfuscateName(f.functionName,false,"String_Node_Str",renameType,selected);
      if (changed != null) {
        f.replacedFunctionName=changed;
      }
    }
    if (fun instanceof ActionDefineFunction2) {
      ActionDefineFunction2 f=(ActionDefineFunction2)fun;
      String changed=deobfuscateName(f.functionName,false,"String_Node_Str",renameType,selected);
      if (changed != null) {
        f.replacedFunctionName=changed;
      }
    }
  }
  HashSet<String> stringsNoVarH=new HashSet<>();
  List<DirectValueTreeItem> allVariableNamesDv=new ArrayList<>();
  for (  KeyValue<DirectValueTreeItem,ConstantPool> it : allVariableNames) {
    allVariableNamesDv.add(it.key);
  }
  for (  DirectValueTreeItem ti : allStrings.keySet()) {
    if (!allVariableNamesDv.contains(ti)) {
      stringsNoVarH.add(System.identityHashCode(allStrings.get(ti)) + "String_Node_Str" + ti.toStringNoH(allStrings.get(ti)));
    }
  }
  int vc=0;
  for (  KeyValue<DirectValueTreeItem,ConstantPool> it : allVariableNames) {
    vc++;
    String name=it.key.toStringNoH(it.value);
    String changed=deobfuscateName(name,false,usageTypes.get(it.key),renameType,selected);
    if (changed != null) {
      boolean addNew=false;
      String h=System.identityHashCode(it.key) + "String_Node_Str" + name;
      if (stringsNoVarH.contains(h)) {
        addNew=true;
      }
      ActionPush pu=(ActionPush)it.key.src;
      if (pu.replacement == null) {
        pu.replacement=new ArrayList<>();
        pu.replacement.addAll(pu.values);
      }
      if (pu.replacement.get(it.key.pos) instanceof ConstantIndex) {
        ConstantIndex ci=(ConstantIndex)pu.replacement.get(it.key.pos);
        ConstantPool pool=it.value;
        if (pool == null) {
          continue;
        }
        if (pool.constants == null) {
          continue;
        }
        if (addNew) {
          pool.constants.add(changed);
          ci.index=pool.constants.size() - 1;
        }
 else {
          pool.constants.set(ci.index,changed);
        }
      }
 else {
        pu.replacement.set(it.key.pos,changed);
      }
      ret++;
    }
  }
  for (  ASMSource src : actionsMap.keySet()) {
    actionsMap.put(src,Action.removeNops(0,actionsMap.get(src),version,0));
    src.setActions(actionsMap.get(src),version);
  }
  deobfuscateInstanceNames(renameType,tags,selected);
  return ret;
}