Program: 85205
Project: 85205
Buggy source:
private MethodImplementation toMethodImplementation(SootMethod m){
  if (m.isAbstract() || m.isNative()) {
    return null;
  }
  Body activeBody=m.retrieveActiveBody();
  if (m.getName().contains("String_Node_Str") || m.getName().equals("String_Node_Str"))   if (!m.getName().equals("String_Node_Str") && !m.getName().equals("String_Node_Str"))   throw new RuntimeException("String_Node_Str" + m.getName());
  EmptySwitchEliminator.v().transform(activeBody);
  SynchronizedMethodTransformer.v().transform(activeBody);
  FastDexTrapTightener.v().transform(activeBody);
  DexArrayInitDetector initDetector=new DexArrayInitDetector();
  initDetector.constructArrayInitializations(activeBody);
  initDetector.fixTraps(activeBody);
  TrapSplitter.v().transform(activeBody);
  int inWords=SootToDexUtils.getDexWords(m.getParameterTypes());
  if (!m.isStatic()) {
    inWords++;
  }
  Collection<Unit> units=activeBody.getUnits();
  StmtVisitor stmtV=new StmtVisitor(m,initDetector);
  toInstructions(units,stmtV);
  int registerCount=stmtV.getRegisterCount();
  if (inWords > registerCount) {
    registerCount=inWords;
  }
  MethodImplementationBuilder builder=new MethodImplementationBuilder(registerCount);
  LabelAssigner labelAssinger=new LabelAssigner(builder);
  List<BuilderInstruction> instructions=stmtV.getRealInsns(labelAssinger);
  fixLongJumps(instructions,labelAssinger,stmtV);
  Map<Local,Integer> seenRegisters=new HashMap<Local,Integer>();
  Map<Instruction,LocalRegisterAssignmentInformation> instructionRegisterMap=stmtV.getInstructionRegisterMap();
  if (Options.v().write_local_annotations()) {
    for (    LocalRegisterAssignmentInformation assignment : stmtV.getParameterInstructionsList()) {
      if (assignment.getLocal().getName().equals("String_Node_Str"))       continue;
      addRegisterAssignmentDebugInfo(assignment,seenRegisters,builder);
    }
  }
  for (  BuilderInstruction ins : instructions) {
    Stmt origStmt=stmtV.getStmtForInstruction(ins);
    if (stmtV.getInstructionPayloadMap().containsKey(ins))     builder.addLabel(labelAssinger.getLabelName(stmtV.getInstructionPayloadMap().get(ins)));
    if (origStmt != null) {
      for (      Trap t : m.getActiveBody().getTraps()) {
        if (t.getBeginUnit() == origStmt || t.getEndUnit() == origStmt || t.getHandlerUnit() == origStmt) {
          labelAssinger.getOrCreateLabel(origStmt);
          break;
        }
      }
      String labelName=labelAssinger.getLabelName(origStmt);
      if (labelName != null && !builder.getLabel(labelName).isPlaced())       builder.addLabel(labelName);
      if (stmtV.getStmtForInstruction(ins) != null) {
        List<Tag> tags=origStmt.getTags();
        for (        Tag t : tags) {
          if (t instanceof LineNumberTag) {
            LineNumberTag lnt=(LineNumberTag)t;
            builder.addLineNumber(lnt.getLineNumber());
          }
 else           if (t instanceof SourceFileTag) {
            SourceFileTag sft=(SourceFileTag)t;
            builder.addSetSourceFile(new ImmutableStringReference(sft.getSourceFile()));
          }
        }
      }
    }
    builder.addInstruction(ins);
    LocalRegisterAssignmentInformation registerAssignmentTag=instructionRegisterMap.get(ins);
    if (registerAssignmentTag != null) {
      addRegisterAssignmentDebugInfo(registerAssignmentTag,seenRegisters,builder);
    }
  }
  for (  int registersLeft : seenRegisters.values())   builder.addEndLocal(registersLeft);
  toTries(activeBody.getTraps(),stmtV,builder,labelAssinger);
  for (  Label lbl : labelAssinger.getAllLabels())   if (!lbl.isPlaced())   throw new RuntimeException("String_Node_Str" + lbl);
  return builder.getMethodImplementation();
}

Fixed version (ground truth):
private MethodImplementation toMethodImplementation(SootMethod m){
  if (m.isAbstract() || m.isNative()) {
    return null;
  }
  Body activeBody=m.retrieveActiveBody();
  if (m.getName().contains("String_Node_Str") || m.getName().equals("String_Node_Str"))   if (!m.getName().equals("String_Node_Str") && !m.getName().equals("String_Node_Str"))   throw new RuntimeException("String_Node_Str" + m.getName());
  EmptySwitchEliminator.v().transform(activeBody);
  SynchronizedMethodTransformer.v().transform(activeBody);
  FastDexTrapTightener.v().transform(activeBody);
  DexArrayInitDetector initDetector=new DexArrayInitDetector();
  initDetector.constructArrayInitializations(activeBody);
  initDetector.fixTraps(activeBody);
  TrapSplitter.v().transform(activeBody);
  int inWords=SootToDexUtils.getDexWords(m.getParameterTypes());
  if (!m.isStatic()) {
    inWords++;
  }
  Collection<Unit> units=activeBody.getUnits();
  StmtVisitor stmtV=new StmtVisitor(m,initDetector);
  Chain<Trap> traps=activeBody.getTraps();
  Set<Unit> trapReferences=new HashSet<Unit>(traps.size() * 3);
  for (  Trap t : activeBody.getTraps()) {
    trapReferences.add(t.getBeginUnit());
    trapReferences.add(t.getEndUnit());
    trapReferences.add(t.getHandlerUnit());
  }
  toInstructions(units,stmtV,trapReferences);
  int registerCount=stmtV.getRegisterCount();
  if (inWords > registerCount) {
    registerCount=inWords;
  }
  MethodImplementationBuilder builder=new MethodImplementationBuilder(registerCount);
  LabelAssigner labelAssinger=new LabelAssigner(builder);
  List<BuilderInstruction> instructions=stmtV.getRealInsns(labelAssinger);
  fixLongJumps(instructions,labelAssinger,stmtV);
  Map<Local,Integer> seenRegisters=new HashMap<Local,Integer>();
  Map<Instruction,LocalRegisterAssignmentInformation> instructionRegisterMap=stmtV.getInstructionRegisterMap();
  if (Options.v().write_local_annotations()) {
    for (    LocalRegisterAssignmentInformation assignment : stmtV.getParameterInstructionsList()) {
      if (assignment.getLocal().getName().equals("String_Node_Str"))       continue;
      addRegisterAssignmentDebugInfo(assignment,seenRegisters,builder);
    }
  }
  for (  BuilderInstruction ins : instructions) {
    Stmt origStmt=stmtV.getStmtForInstruction(ins);
    if (stmtV.getInstructionPayloadMap().containsKey(ins))     builder.addLabel(labelAssinger.getLabelName(stmtV.getInstructionPayloadMap().get(ins)));
    if (origStmt != null) {
      if (trapReferences.contains(origStmt))       labelAssinger.getOrCreateLabel(origStmt);
      String labelName=labelAssinger.getLabelName(origStmt);
      if (labelName != null && !builder.getLabel(labelName).isPlaced())       builder.addLabel(labelName);
      if (stmtV.getStmtForInstruction(ins) != null) {
        List<Tag> tags=origStmt.getTags();
        for (        Tag t : tags) {
          if (t instanceof LineNumberTag) {
            LineNumberTag lnt=(LineNumberTag)t;
            builder.addLineNumber(lnt.getLineNumber());
          }
 else           if (t instanceof SourceFileTag) {
            SourceFileTag sft=(SourceFileTag)t;
            builder.addSetSourceFile(new ImmutableStringReference(sft.getSourceFile()));
          }
        }
      }
    }
    builder.addInstruction(ins);
    LocalRegisterAssignmentInformation registerAssignmentTag=instructionRegisterMap.get(ins);
    if (registerAssignmentTag != null) {
      addRegisterAssignmentDebugInfo(registerAssignmentTag,seenRegisters,builder);
    }
  }
  for (  int registersLeft : seenRegisters.values())   builder.addEndLocal(registersLeft);
  toTries(activeBody.getTraps(),stmtV,builder,labelAssinger);
  for (  Label lbl : labelAssinger.getAllLabels())   if (!lbl.isPlaced())   throw new RuntimeException("String_Node_Str" + lbl);
  return builder.getMethodImplementation();
}