Program: 17492
Project: 17492
Buggy source:
/** 
 * Gets the proposal ready. Sets up the image, the text to insert into the text, and finally returns the completed proposal.
 * @param offset - offset in the document
 * @param type - type of thing we're making a proposal for
 * @param currentlen - length that we'd need to insert if the user selected the proposal
 * @param name - name of the proposal
 * @param display - string to display
 * @param help - the help associated with this proposal
 * @return - the completed, indented, image'd proposal
 * @see org.eclipse.jface.text.contentassist.ICompletionProposal
 */
public static CompletionProposal finaliseProposal(int offset,short type,int currentlen,String name,String display,String help){
  Assert.isNotNull(name);
  Assert.isNotNull(display);
  Assert.isNotNull(help);
  Assert.isTrue(currentlen <= name.length());
  String replacementString=name.substring(currentlen,name.length());
  int insertlen=replacementString.length();
  org.eclipse.swt.graphics.Image img=null;
switch (type) {
case ATTRTYPE:
    replacementString+="String_Node_Str";
  insertlen+="String_Node_Str".length();
img=CFPluginImages.get(CFPluginImages.ICON_ATTR);
break;
case TAGTYPE:
img=CFPluginImages.get(CFPluginImages.ICON_TAG);
break;
case VALUETYPE:
img=CFPluginImages.get(CFPluginImages.ICON_VALUE);
break;
case SCOPETYPE:
img=CFPluginImages.get(CFPluginImages.ICON_VALUE);
break;
case PARAMETERTYPE:
insertlen=name.length();
img=CFPluginImages.get(CFPluginImages.ICON_VALUE);
break;
}
CompletionProposal prop=new CompletionProposal(replacementString,offset,0,insertlen,img,display,null,help);
return prop;
}

Fixed version (ground truth):
/** 
 * Gets the proposal ready. Sets up the image, the text to insert into the text, and finally returns the completed proposal.
 * @param offset - offset in the document
 * @param type - type of thing we're making a proposal for
 * @param currentlen - length that we'd need to insert if the user selected the proposal
 * @param name - name of the proposal
 * @param display - string to display
 * @param help - the help associated with this proposal
 * @return - the completed, indented, image'd proposal
 * @see org.eclipse.jface.text.contentassist.ICompletionProposal
 */
public static CompletionProposal finaliseProposal(int offset,short type,int currentlen,String name,String display,String help){
  Assert.isNotNull(name,"String_Node_Str");
  Assert.isNotNull(display,"String_Node_Str");
  Assert.isNotNull(help,"String_Node_Str");
  Assert.isTrue(currentlen <= name.length(),"String_Node_Str");
  String replacementString=name.substring(currentlen,name.length());
  int insertlen=replacementString.length();
  org.eclipse.swt.graphics.Image img=null;
switch (type) {
case ATTRTYPE:
    replacementString+="String_Node_Str";
  insertlen+="String_Node_Str".length();
img=CFPluginImages.get(CFPluginImages.ICON_ATTR);
break;
case TAGTYPE:
img=CFPluginImages.get(CFPluginImages.ICON_TAG);
break;
case VALUETYPE:
img=CFPluginImages.get(CFPluginImages.ICON_VALUE);
break;
case SCOPETYPE:
img=CFPluginImages.get(CFPluginImages.ICON_VALUE);
break;
case PARAMETERTYPE:
insertlen=name.length();
img=CFPluginImages.get(CFPluginImages.ICON_VALUE);
break;
}
CompletionProposal prop=new CompletionProposal(replacementString,offset,0,insertlen,img,display,null,help);
return prop;
}