Program: 186717
Project: 186717
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 inlineData the parameters of the invokee and the code to inline.
 * @return true if inlining has been performed.
 */
private InvokeSite performSimpleInline(InvokeSite invokeSite,MethodInfo invokee,InlineData inlineData){
  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 (inlineData.getOldPrologueLength() > 0) {
    InstructionHandle start=invoke;
    for (int i=0; i < inlineData.getOldPrologueLength(); i++) {
      start=start.getPrev();
    }
    invokerCode.replace(start,inlineData.getOldPrologueLength(),inlineData.getPrologue(),false);
  }
 else   if (inlineData.getPrologue().getLength() > 0) {
    if (invoke.hasTargeters()) {
      invokerCode.retarget(invoke,inlineData.getPrologue().getStart());
    }
    InstructionList il=invokerCode.getInstructionList();
    il.insert(invoke,inlineData.getPrologue());
  }
  InstructionList il=invokee.getCode().getInstructionList();
  InstructionHandle start=invokee.getCode().getInstructionHandle(inlineData.getInlineStart());
  int cnt=il.getLength() - inlineData.getInlineStart();
  if (il.getEnd().getInstruction() instanceof ReturnInstruction) {
    cnt--;
  }
  InstructionHandle end=invokerCode.replace(invoke,1,invokee,il,start,cnt,false);
  invokerCode.getInstructionList().insert(end,inlineData.getEpilogue());
  if (inlineData.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 inlineData the parameters of the invokee and the code to inline.
 * @return true if inlining has been performed.
 */
private InvokeSite performSimpleInline(InvokeSite invokeSite,MethodInfo invokee,InlineData inlineData){
  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 (inlineData.getOldPrologueLength() > 0) {
    InstructionHandle start=invoke;
    for (int i=0; i < inlineData.getOldPrologueLength(); i++) {
      start=start.getPrev();
    }
    invokerCode.replace(start,inlineData.getOldPrologueLength(),inlineData.getPrologue(),false);
  }
 else   if (inlineData.getPrologue().getLength() > 0) {
    if (invoke.hasTargeters()) {
      invokerCode.retarget(invoke,inlineData.getPrologue().getStart());
    }
    InstructionList il=invokerCode.getInstructionList();
    il.insert(invoke,inlineData.getPrologue());
  }
  InstructionList il=invokee.getCode().getInstructionList();
  InstructionHandle start=invokee.getCode().getInstructionHandle(inlineData.getInlineStart());
  int cnt=il.getLength() - inlineData.getInlineStart();
  if (il.getEnd().getInstruction() instanceof ReturnInstruction) {
    cnt--;
  }
  InstructionHandle end=invokerCode.replace(invoke,1,invokee,start,cnt,false);
  invokerCode.getInstructionList().insert(end,inlineData.getEpilogue());
  if (inlineData.getInvokeSite() != null) {
    end=end.getPrev();
    while (end != null) {
      if (invokerCode.isInvokeSite(end)) {
        return invokerCode.getInvokeSite(end);
      }
      end=end.getPrev();
    }
  }
  return null;
}