Program: 130024
Project: 130024
Buggy source:
/** 
 * DOC chuang PatternCalendar constructor comment.
 * @param parent
 * @param calendar
 * @param pattern2
 */
public PatternCalendar(Composite parent,int style,String pattern,Calendar calendar){
  super(parent,style);
  final Composite composite=new Composite(this,SWT.BORDER);
  final GridLayout gridLayout=new GridLayout();
  gridLayout.numColumns=2;
  gridLayout.marginWidth=5;
  gridLayout.marginHeight=5;
  composite.setLayout(gridLayout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  composite.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
  Label patternLabel=new Label(composite,SWT.NONE);
  patternLabel.setText(Messages.getString("String_Node_Str"));
  patternLabel.setBackground(patternLabel.getParent().getBackground());
  patternText=new Text(composite,SWT.BORDER);
  patternText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  patternText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      onPatternChange();
    }
  }
);
  JavaSimpleDateFormatProposalProvider proposalProvider=new JavaSimpleDateFormatProposalProvider();
  ContentProposalAdapterExtended contentProposalAdapter=ProposalUtils.getCommonProposal(patternText,proposalProvider);
  contentProposalAdapter.setFilterStyle(ContentProposalAdapterExtended.FILTER_NONE);
  contentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapterExtended.PROPOSAL_INSERT);
  Label exampleLabel=new Label(composite,SWT.NONE);
  exampleLabel.setText(Messages.getString("String_Node_Str"));
  exampleLabel.setBackground(patternLabel.getParent().getBackground());
  exampleValue=new Label(composite,SWT.NONE);
  exampleValue.setText("String_Node_Str");
  exampleValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  if (calendar != null) {
    setCalendar(calendar);
  }
  if (pattern != null) {
    patternText.setText("String_Node_Str" + pattern + "String_Node_Str");
  }
 else {
    patternText.setText(Messages.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * DOC chuang PatternCalendar constructor comment.
 * @param parent
 * @param calendar
 * @param pattern2
 */
public PatternCalendar(Composite parent,int style,String pattern,Calendar calendar){
  super(parent,style);
  final Composite composite=new Composite(this,SWT.BORDER);
  final GridLayout gridLayout=new GridLayout();
  gridLayout.numColumns=2;
  gridLayout.marginWidth=5;
  gridLayout.marginHeight=5;
  composite.setLayout(gridLayout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  composite.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
  Label patternLabel=new Label(composite,SWT.NONE);
  patternLabel.setText(Messages.getString("String_Node_Str"));
  patternLabel.setBackground(patternLabel.getParent().getBackground());
  patternText=new Text(composite,SWT.BORDER);
  patternText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  patternText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      onPatternChange();
    }
  }
);
  JavaSimpleDateFormatProposalProvider proposalProvider=new JavaSimpleDateFormatProposalProvider();
  ContentProposalAdapterExtended contentProposalAdapter=ProposalUtils.getCommonProposal(patternText,proposalProvider);
  contentProposalAdapter.setFilterStyle(ContentProposalAdapterExtended.FILTER_NONE);
  contentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapterExtended.PROPOSAL_INSERT);
  Label exampleLabel=new Label(composite,SWT.NONE);
  exampleLabel.setText(Messages.getString("String_Node_Str"));
  exampleLabel.setBackground(patternLabel.getParent().getBackground());
  exampleValue=new Label(composite,SWT.NONE);
  exampleValue.setText("String_Node_Str");
  exampleValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  if (calendar != null) {
    setCalendar(calendar);
  }
  if (pattern != null) {
    patternText.setText("String_Node_Str" + pattern + "String_Node_Str");
  }
 else {
    patternText.setText(defaultFormat);
  }
}