Program: 95837
Project: 95837
Buggy source:
/** 
 * Constructs a text field. When pressing STRG+SPACE a list pops up.
 * @param compMapper The Component Name mapper to use.
 * @param composite The parent composite.
 * @param style The style of the text field.
 */
public CompNamePopUpTextField(IComponentNameMapper compMapper,Composite composite,int style){
  super(composite,style);
  KeyStroke ks=null;
  try {
    ks=KeyStroke.getInstance("String_Node_Str");
  }
 catch (  ParseException e) {
  }
  m_labelProvider=new LabelProvider(){
    public Image getImage(    Object element){
      CompNamesProposal p=(CompNamesProposal)element;
      char type=p.getLabel().charAt(0);
switch (type) {
case 'G':
        return IconConstants.GLOBAL_NAME_IMAGE;
case 'L':
      return IconConstants.LOCAL_NAME_IMAGE;
case 'A':
    return IconConstants.AUT_COMP_NAME_IMAGE;
default :
  return null;
}
}
public String getText(Object element){
CompNamesProposal p=(CompNamesProposal)element;
return p.getLabel().substring(1);
}
public boolean isLabelProperty(Object element,String property){
return false;
}
}
;
m_popupListener=new IContentProposalListener2Implementation();
m_contentProposalProvider=new CompNamesProposalProvider(compMapper);
enableContentProposal(m_contentProposalProvider,ks);
int delay=Plugin.getDefault().getPreferenceStore().getInt(Constants.MILLIS_TO_OPEN_COMP_NAMES_CONTENT_PROPOSAL);
final DelayableTimer contentProposalTimer=new DelayableTimer(delay,new Runnable(){
public void run(){
openContentProposals();
}
}
);
addKeyListener(new KeyListener(){
public void keyReleased(KeyEvent e){
if (!getText().equals(StringConstants.EMPTY) && triggerCharWasTyped(e)) {
contentProposalTimer.schedule();
}
}
public void keyPressed(KeyEvent e){
contentProposalTimer.cancel();
}
}
);
}

Fixed version (ground truth):
/** 
 * Constructs a text field. When pressing STRG+SPACE a list pops up.
 * @param compMapper The Component Name mapper to use.
 * @param composite The parent composite.
 * @param style The style of the text field.
 */
public CompNamePopUpTextField(IComponentNameMapper compMapper,Composite composite,int style){
  super(composite,style);
  KeyStroke ks=null;
  try {
    ks=KeyStroke.getInstance("String_Node_Str");
  }
 catch (  ParseException e) {
  }
  m_labelProvider=new LabelProvider(){
    public Image getImage(    Object element){
      CompNamesProposal p=(CompNamesProposal)element;
      char type=p.getLabel().charAt(0);
switch (type) {
case 'G':
        return IconConstants.GLOBAL_NAME_IMAGE;
case 'L':
      return IconConstants.LOCAL_NAME_IMAGE;
case 'A':
    return IconConstants.AUT_COMP_NAME_IMAGE;
default :
  return null;
}
}
public String getText(Object element){
CompNamesProposal p=(CompNamesProposal)element;
return p.getLabel().substring(1);
}
public boolean isLabelProperty(Object element,String property){
return false;
}
}
;
m_popupListener=new IContentProposalListener2Implementation();
m_contentProposalProvider=new CompNamesProposalProvider(compMapper);
enableContentProposal(m_contentProposalProvider,ks);
int delay=Plugin.getDefault().getPreferenceStore().getInt(Constants.MILLIS_TO_OPEN_COMP_NAMES_CONTENT_PROPOSAL);
final DelayableTimer contentProposalTimer=new DelayableTimer(delay,new Runnable(){
public void run(){
Display.getDefault().syncExec(new Runnable(){
public void run(){
  openContentProposals();
}
}
);
}
}
);
addKeyListener(new KeyListener(){
public void keyReleased(KeyEvent e){
if (!getText().equals(StringConstants.EMPTY) && triggerCharWasTyped(e)) {
contentProposalTimer.schedule();
}
}
public void keyPressed(KeyEvent e){
contentProposalTimer.cancel();
}
}
);
}