Program: 17385
Project: 17385
Buggy source:
private ICompletionProposal[] getValueProposals(Parameter activeParam,String extraInfo,int offset,int paramCount){
  String suffix="String_Node_Str";
  Set values=activeParam.getValues();
  ICompletionProposal[] tmpResult=new ICompletionProposal[values.size()];
  if (this.paramsSoFar == paramCount - 1) {
    suffix="String_Node_Str";
  }
  Iterator i=values.iterator();
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(paramText);
  String cleanParamText="String_Node_Str";
  if (matcher.find()) {
    cleanParamText=matcher.group(2);
    if (cleanParamText.equals("String_Node_Str") || cleanParamText.equals("String_Node_Str")) {
      cleanParamText="String_Node_Str";
    }
  }
  int x=0;
  while (i.hasNext()) {
    Object o=i.next();
    if (o instanceof Value) {
      Value val=(Value)o;
      if (cleanParamText.length() == 0 || val.toString().toLowerCase().startsWith(cleanParamText.toLowerCase())) {
        String insertion=val.toString().substring(cleanParamText.length(),val.toString().length());
        int cursorOffset=insertion.length() + suffix.length();
        if (!paramText.endsWith("String_Node_Str") && paramText.startsWith("String_Node_Str")) {
          insertion+="String_Node_Str";
          cursorOffset++;
        }
 else         if (paramText.startsWith("String_Node_Str")) {
          cursorOffset++;
        }
        if (!paramText.endsWith("String_Node_Str") && paramText.startsWith("String_Node_Str")) {
          insertion+="String_Node_Str";
          ;
          cursorOffset++;
        }
 else         if (paramText.startsWith("String_Node_Str")) {
          cursorOffset++;
        }
        CompletionProposal proposal=new CompletionProposal(insertion + suffix,offset,0,cursorOffset,CFPluginImages.get(CFPluginImages.ICON_PARAM),activeParam.toString() + "String_Node_Str" + val.toString(),null,extraInfo);
        tmpResult[x]=proposal;
        x++;
      }
    }
  }
  ICompletionProposal[] result=new ICompletionProposal[x];
  for (int y=0; y < x; y++) {
    result[y]=tmpResult[y];
  }
  return result;
}

Fixed version (ground truth):
private ICompletionProposal[] getValueProposals(Parameter activeParam,String extraInfo,int offset,int paramCount){
  String docText=fState.getDataSoFar();
  char strDelim=(docText.lastIndexOf("String_Node_Str") > docText.lastIndexOf("String_Node_Str")) ? '\'' : '\"';
  String suffix="String_Node_Str";
  Set values=activeParam.getValues();
  ICompletionProposal[] tmpResult=new ICompletionProposal[values.size()];
  if (this.paramsSoFar == paramCount - 1) {
    suffix="String_Node_Str";
  }
  Iterator i=values.iterator();
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(paramText);
  String cleanParamText="String_Node_Str";
  if (matcher.find()) {
    cleanParamText=matcher.group(2);
    if (cleanParamText.equals("String_Node_Str") || cleanParamText.equals("String_Node_Str")) {
      cleanParamText="String_Node_Str";
    }
  }
  int x=0;
  while (i.hasNext()) {
    Object o=i.next();
    if (o instanceof Value) {
      Value val=(Value)o;
      boolean wee=val.toString().matches("String_Node_Str");
      if (cleanParamText.length() == 0 || val.toString().toLowerCase().startsWith(cleanParamText.toLowerCase())) {
        String insertion=val.toString().substring(cleanParamText.length(),val.toString().length());
        if (activeParam.getType().equalsIgnoreCase("String_Node_Str") && !insertion.matches("String_Node_Str")) {
          insertion=strDelim + insertion + strDelim;
        }
        int cursorOffset=insertion.length() + suffix.length();
        if (!paramText.endsWith("String_Node_Str") && paramText.startsWith("String_Node_Str")) {
          insertion+="String_Node_Str";
          cursorOffset++;
        }
 else         if (paramText.startsWith("String_Node_Str")) {
          cursorOffset++;
        }
        if (!paramText.endsWith("String_Node_Str") && paramText.startsWith("String_Node_Str")) {
          insertion+="String_Node_Str";
          ;
          cursorOffset++;
        }
 else         if (paramText.startsWith("String_Node_Str")) {
          cursorOffset++;
        }
        CompletionProposal proposal=new CompletionProposal(insertion + suffix,offset,0,cursorOffset,CFPluginImages.get(CFPluginImages.ICON_PARAM),activeParam.toString() + "String_Node_Str" + insertion,null,extraInfo);
        tmpResult[x]=proposal;
        x++;
      }
    }
  }
  ICompletionProposal[] result=new ICompletionProposal[x];
  for (int y=0; y < x; y++) {
    result[y]=tmpResult[y];
  }
  return result;
}