Program: 186749
Project: 186749
Buggy source:
/** 
 * Try to inline a simple getter, wrapper or stub method. <p> If the inlined code is again an invoke, the InvokeSite does not change because the InstructionHandle of the invoker's invoke is kept.</p>
 * @param invokeSite the invoke to replace.
 * @param invokee the method to inline.
 * @param invokeMap the parameters of the invokee and the code to inline.
 * @return true if inlining has been performed.
 */
private InvokeSite performSimpleInline(InvokeSite invokeSite,MethodInfo invokee,InvokeMap invokeMap){
  MethodInfo invoker=invokeSite.getInvoker();
  MethodCode invokerCode=invoker.getCode();
  helper.prepareInlining(invoker,invokee);
  InstructionHandle invoke=invokeSite.getInstructionHandle();
  if (invokeMap.getOldPrologueLength() > 0) {
    InstructionHandle start=invoke;
    for (int i=0; i < invokeMap.getOldPrologueLength(); i++) {
      start=start.getPrev();
    }
    invokerCode.replace(start,invokeMap.getOldPrologueLength(),invokeMap.getPrologue(),false);
  }
  InstructionList il=invokee.getCode().getInstructionList();
  InstructionHandle start=invokee.getCode().getInstructionHandle(invokeMap.getInlineStart());
  int cnt=il.getLength() - invokeMap.getInlineStart();
  if (il.getEnd().getInstruction() instanceof ReturnInstruction) {
    cnt--;
  }
  InstructionHandle end=invokerCode.replace(invoke,1,invokee,il,start,cnt,false);
  invokerCode.getInstructionList().insert(end,invokeMap.getEpilogue());
  if (invokeMap.getInvokeSite() != null) {
    end=end.getPrev();
    while (end != null) {
      if (invokerCode.isInvokeSite(end)) {
        return invokerCode.getInvokeSite(end);
      }
      end=end.getPrev();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Try to inline a simple getter, wrapper or stub method. <p> If the inlined code is again an invoke, the InvokeSite does not change because the InstructionHandle of the invoker's invoke is kept.</p>
 * @param invokeSite the invoke to replace.
 * @param invokee the method to inline.
 * @param invokeMap the parameters of the invokee and the code to inline.
 * @return true if inlining has been performed.
 */
private InvokeSite performSimpleInline(InvokeSite invokeSite,MethodInfo invokee,InvokeMap invokeMap){
  MethodInfo invoker=invokeSite.getInvoker();
  MethodCode invokerCode=invoker.getCode();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + invokeSite + "String_Node_Str"+ invokee);
  }
  helper.prepareInlining(invoker,invokee);
  InstructionHandle invoke=invokeSite.getInstructionHandle();
  if (invokeMap.getOldPrologueLength() > 0) {
    InstructionHandle start=invoke;
    for (int i=0; i < invokeMap.getOldPrologueLength(); i++) {
      start=start.getPrev();
    }
    invokerCode.replace(start,invokeMap.getOldPrologueLength(),invokeMap.getPrologue(),false);
  }
 else   if (invokeMap.getPrologue().getLength() > 0) {
    InstructionList il=invokerCode.getInstructionList();
    il.insert(invoke,invokeMap.getPrologue());
  }
  InstructionList il=invokee.getCode().getInstructionList();
  InstructionHandle start=invokee.getCode().getInstructionHandle(invokeMap.getInlineStart());
  int cnt=il.getLength() - invokeMap.getInlineStart();
  if (il.getEnd().getInstruction() instanceof ReturnInstruction) {
    cnt--;
  }
  InstructionHandle end=invokerCode.replace(invoke,1,invokee,il,start,cnt,false);
  invokerCode.getInstructionList().insert(end,invokeMap.getEpilogue());
  if (invokeMap.getInvokeSite() != null) {
    end=end.getPrev();
    while (end != null) {
      if (invokerCode.isInvokeSite(end)) {
        return invokerCode.getInvokeSite(end);
      }
      end=end.getPrev();
    }
  }
  return null;
}