Program: 62146
Project: 62146
Buggy source:
private int renameAS2Identifiers(RenameType renameType,Map<String,String> selected){
  actionsMap=new HashMap<>();
  allFunctions=new ArrayList<>();
  allVariableNames=new HashMap<>();
  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 (  DirectValueTreeItem ti : allVariableNames.keySet()) {
    String name=ti.toStringNoH(allVariableNames.get(ti));
    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(deobfuscated,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(deobfuscated,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(deobfuscated,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(deobfuscated,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(deobfuscated,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(deobfuscated,f.functionName,false,"String_Node_Str",renameType,selected);
      if (changed != null) {
        f.replacedFunctionName=changed;
      }
    }
  }
  HashSet<String> stringsNoVarH=new HashSet<>();
  for (  DirectValueTreeItem ti : allStrings.keySet()) {
    if (!allVariableNames.containsKey(ti)) {
      stringsNoVarH.add(System.identityHashCode(allStrings.get(ti)) + "String_Node_Str" + ti.toStringNoH(allStrings.get(ti)));
    }
  }
  int vc=0;
  for (  DirectValueTreeItem ti : allVariableNames.keySet()) {
    vc++;
    informListeners("String_Node_Str","String_Node_Str" + vc + "String_Node_Str"+ allVariableNames.size());
    String name=ti.toStringNoH(allVariableNames.get(ti));
    String changed=deobfuscateName(deobfuscated,name,false,usageTypes.get(ti),renameType,selected);
    if (changed != null) {
      boolean addNew=false;
      String h=System.identityHashCode(allVariableNames.get(ti)) + "String_Node_Str" + name;
      if (stringsNoVarH.contains(h)) {
        addNew=true;
      }
      ActionPush pu=(ActionPush)ti.src;
      if (pu.replacement == null) {
        pu.replacement=new ArrayList<>();
        pu.replacement.addAll(pu.values);
      }
      if (pu.replacement.get(ti.pos) instanceof ConstantIndex) {
        ConstantIndex ci=(ConstantIndex)pu.replacement.get(ti.pos);
        ConstantPool pool=allVariableNames.get(ti);
        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(ti.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);
  }
  return ret;
}

Fixed version (ground truth):
private int renameAS2Identifiers(RenameType renameType,Map<String,String> selected){
  actionsMap=new HashMap<>();
  allFunctions=new ArrayList<>();
  allVariableNames=new HashMap<>();
  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 (  DirectValueTreeItem ti : allVariableNames.keySet()) {
    String name=ti.toStringNoH(allVariableNames.get(ti));
    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<>();
  for (  DirectValueTreeItem ti : allStrings.keySet()) {
    if (!allVariableNames.containsKey(ti)) {
      stringsNoVarH.add(System.identityHashCode(allStrings.get(ti)) + "String_Node_Str" + ti.toStringNoH(allStrings.get(ti)));
    }
  }
  int vc=0;
  for (  DirectValueTreeItem ti : allVariableNames.keySet()) {
    vc++;
    String name=ti.toStringNoH(allVariableNames.get(ti));
    String changed=deobfuscateName(name,false,usageTypes.get(ti),renameType,selected);
    if (changed != null) {
      boolean addNew=false;
      String h=System.identityHashCode(allVariableNames.get(ti)) + "String_Node_Str" + name;
      if (stringsNoVarH.contains(h)) {
        addNew=true;
      }
      ActionPush pu=(ActionPush)ti.src;
      if (pu.replacement == null) {
        pu.replacement=new ArrayList<>();
        pu.replacement.addAll(pu.values);
      }
      if (pu.replacement.get(ti.pos) instanceof ConstantIndex) {
        ConstantIndex ci=(ConstantIndex)pu.replacement.get(ti.pos);
        ConstantPool pool=allVariableNames.get(ti);
        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(ti.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);
  }
  return ret;
}