Program: 138119
Project: 138119
Buggy source:
protected void createPatternTestCom(final Composite parent){
  ScrolledComposite scrolledComposite=new ScrolledComposite(parent,SWT.V_SCROLL | SWT.H_SCROLL);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  final Composite mainComposite=new Composite(scrolledComposite,SWT.NULL);
  scrolledComposite.setContent(mainComposite);
  GridLayout blay=new GridLayout();
  mainComposite.setLayout(blay);
  final Composite coboCom=new Composite(mainComposite,SWT.NULL);
  imgCom=new Composite(mainComposite,SWT.NULL);
  final Composite textCom=new Composite(mainComposite,SWT.NULL);
  final Composite buttonsCom=new Composite(mainComposite,SWT.FILL | SWT.NULL);
  mainComposite.addListener(SWT.Resize,new Listener(){
    public void handleEvent(    Event event){
      GridData formData=new GridData(GridData.FILL_HORIZONTAL);
      formData.heightHint=105;
      textCom.setLayoutData(formData);
      buttonsCom.setLayoutData(formData);
    }
  }
);
  GridLayout layout=new GridLayout();
  layout.numColumns=5;
  coboCom.setLayout(layout);
  GridData data=new GridData(GridData.FILL_BOTH);
  buttonJava=new Button(coboCom,SWT.RADIO);
  buttonJava.setText(ExecutionLanguage.JAVA.getLiteral());
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.widthHint=20;
  buttonJava.setLayoutData(data);
  buttonJava.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      isJavaEngine=true;
      sqlButton.setEnabled(false);
      dbCombo.setEnabled(false);
      functionNameText.setEnabled(false);
    }
  }
);
  buttonSql=new Button(coboCom,SWT.RADIO);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.widthHint=90;
  buttonSql.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  buttonSql.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      isJavaEngine=false;
      sqlButton.setEnabled(true);
      dbCombo.setEnabled(true);
      functionNameText.setEnabled(true);
    }
  }
);
  buttonSql.setSelection(true);
  buttonSql.setEnabled(!isJavaEngine);
  buttonSql.setLayoutData(data);
  dbCombo=new CCombo(coboCom,SWT.DROP_DOWN | SWT.BORDER);
  dbCombo.setEditable(false);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.widthHint=60;
  dbCombo.setLayoutData(data);
  functionLabel=new Label(coboCom,SWT.NONE);
  functionLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  functionNameText=new Text(coboCom,SWT.BORDER);
  functionNameText.setText(PluginConstant.EMPTY_STRING);
  GridData functionNameTextGD=new GridData(SWT.LEFT,SWT.DEFAULT,false,false,1,1);
  functionNameTextGD.widthHint=0;
  functionNameText.setLayoutData(functionNameTextGD);
  functionLabel.setLayoutData(functionNameTextGD);
  functionNameText.setVisible(false);
  functionLabel.setVisible(false);
  GridData comData=new GridData(GridData.FILL_HORIZONTAL);
  comData.heightHint=37;
  coboCom.setLayoutData(comData);
  layout=new GridLayout();
  layout.numColumns=2;
  imgCom.setLayout(layout);
  emoticonLabel=new Label(imgCom,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.heightHint=18;
  gd.widthHint=18;
  emoticonLabel.setLayoutData(gd);
  gd=new GridData();
  gd.heightHint=18;
  gd.widthHint=65;
  gd.horizontalAlignment=GridData.BEGINNING;
  resultLabel=new Label(imgCom,SWT.NONE);
  resultLabel.setLayoutData(gd);
  GridData imgData=new GridData(GridData.FILL_HORIZONTAL);
  imgData.heightHint=0;
  imgData.horizontalAlignment=GridData.BEGINNING;
  imgCom.setLayoutData(imgData);
  layout=new GridLayout();
  layout.numColumns=2;
  textCom.setLayout(layout);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.horizontalAlignment=GridData.BEGINNING;
  textAreaLabel=new Label(textCom,SWT.NONE);
  textAreaLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  testText=new Text(textCom,SWT.BORDER | SWT.MULTI | SWT.WRAP| SWT.V_SCROLL);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=40;
  testText.setLayoutData(data);
  testText.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData textAreaLabelGD=new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1);
  textAreaLabel.setLayoutData(textAreaLabelGD);
  regularLabel=new Label(textCom,SWT.NULL);
  regularLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  regularLabel.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData regularLabelGD=new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1);
  regularLabel.setLayoutData(regularLabelGD);
  this.regularText=new Text(textCom,SWT.BORDER | SWT.MULTI | SWT.WRAP| SWT.V_SCROLL);
  this.regularText.setLayoutData(data);
  regularText.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  regularText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      boolean enabled=(!regularText.getText().equals(PluginConstant.EMPTY_STRING)) && (CheckValueUtils.isPatternValue(regularText.getText()));
      if (pattern != null) {
        saveButton.setEnabled(enabled);
      }
      createPatternButton.setEnabled(enabled);
    }
  }
);
  GridData textData=new GridData(GridData.FILL_BOTH);
  textData.heightHint=400;
  textCom.setLayoutData(textData);
  GridLayout llayout=new GridLayout();
  llayout.numColumns=4;
  buttonsCom.setLayout(llayout);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=25;
  data.widthHint=92;
  sqlButton=new Button(buttonsCom,SWT.PUSH);
  sqlButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  sqlButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  sqlButton.setLayoutData(data);
  sqlButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      openSQLEditor();
    }
  }
);
  createPatternButton=new Button(buttonsCom,SWT.PUSH);
  createPatternButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  createPatternButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=25;
  data.widthHint=92;
  createPatternButton.setLayoutData(data);
  createPatternButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      String language=null;
      if (regularExpression != null) {
        language=regularExpression.getExpression().getLanguage();
      }
 else {
        DbmsLanguage dbmsLanguage=getDbmsLanguage();
        if (dbmsLanguage != null) {
          dbmsLanguage.setFunctionName(getFunctionName());
          language=dbmsLanguage.getDbmsName();
        }
      }
      new CreatePatternAction(ResourceManager.getPatternFolder(),ExpressionType.REGEXP,regularText.getText(),language).run();
    }
  }
);
  createPatternButton.setEnabled(false);
  saveButton=new Button(buttonsCom,SWT.PUSH);
  saveButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  saveButton.setEnabled(false);
  saveButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=25;
  data.widthHint=92;
  saveButton.setLayoutData(data);
  saveButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      savePattern();
    }
  }
);
  testButton=new Button(buttonsCom,SWT.PUSH);
  data=new GridData(GridData.FILL_HORIZONTAL);
  testButton.setLayoutData(data);
  testButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  testButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  testButton.setLayoutData(data);
  testButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      testRegularText();
      expandImageComposite(true);
    }
  }
);
  data=new GridData(GridData.FILL_HORIZONTAL);
  buttonsCom.setLayoutData(data);
  scrolledComposite.setMinSize(mainComposite.computeSize(SWT.DEFAULT,SWT.DEFAULT));
  mainComposite.layout();
  activateContext();
  fillComboData();
}

Fixed version (ground truth):
protected void createPatternTestCom(final Composite parent){
  ScrolledComposite scrolledComposite=new ScrolledComposite(parent,SWT.V_SCROLL | SWT.H_SCROLL);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  final Composite mainComposite=new Composite(scrolledComposite,SWT.NULL);
  scrolledComposite.setContent(mainComposite);
  GridLayout blay=new GridLayout();
  mainComposite.setLayout(blay);
  final Composite coboCom=new Composite(mainComposite,SWT.NULL);
  imgCom=new Composite(mainComposite,SWT.NULL);
  final Composite textCom=new Composite(mainComposite,SWT.NULL);
  final Composite buttonsCom=new Composite(mainComposite,SWT.FILL | SWT.NULL);
  mainComposite.addListener(SWT.Resize,new Listener(){
    public void handleEvent(    Event event){
      GridData formData=new GridData(GridData.FILL_HORIZONTAL);
      formData.heightHint=105;
      textCom.setLayoutData(formData);
      buttonsCom.setLayoutData(formData);
    }
  }
);
  GridLayout layout=new GridLayout();
  layout.numColumns=5;
  coboCom.setLayout(layout);
  GridData data=new GridData(GridData.FILL_BOTH);
  buttonJava=new Button(coboCom,SWT.RADIO);
  buttonJava.setText(ExecutionLanguage.JAVA.getLiteral());
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.widthHint=20;
  buttonJava.setLayoutData(data);
  buttonJava.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      isJavaEngine=true;
      sqlButton.setEnabled(false);
      dbCombo.setEnabled(false);
      functionNameText.setEnabled(false);
    }
  }
);
  buttonSql=new Button(coboCom,SWT.RADIO);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.widthHint=90;
  buttonSql.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  buttonSql.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      isJavaEngine=false;
      sqlButton.setEnabled(true);
      dbCombo.setEnabled(true);
      functionNameText.setEnabled(true);
    }
  }
);
  buttonSql.setSelection(true);
  buttonSql.setEnabled(!isJavaEngine);
  buttonSql.setLayoutData(data);
  dbCombo=new CCombo(coboCom,SWT.DROP_DOWN | SWT.BORDER);
  dbCombo.setEditable(false);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.widthHint=60;
  dbCombo.setLayoutData(data);
  functionLabel=new Label(coboCom,SWT.NONE);
  functionLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  functionNameText=new Text(coboCom,SWT.BORDER);
  functionNameText.setText(PluginConstant.EMPTY_STRING);
  GridData functionNameTextGD=new GridData(SWT.LEFT,SWT.DEFAULT,false,false,1,1);
  functionNameTextGD.widthHint=0;
  functionNameText.setLayoutData(functionNameTextGD);
  functionLabel.setLayoutData(functionNameTextGD);
  functionNameText.setVisible(false);
  functionLabel.setVisible(false);
  GridData comData=new GridData(GridData.FILL_HORIZONTAL);
  comData.heightHint=37;
  coboCom.setLayoutData(comData);
  layout=new GridLayout();
  layout.numColumns=2;
  imgCom.setLayout(layout);
  emoticonLabel=new Label(imgCom,SWT.NONE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  gd.heightHint=18;
  gd.widthHint=18;
  emoticonLabel.setLayoutData(gd);
  gd=new GridData();
  gd.heightHint=18;
  gd.widthHint=65;
  gd.horizontalAlignment=GridData.BEGINNING;
  resultLabel=new Label(imgCom,SWT.NONE);
  resultLabel.setLayoutData(gd);
  GridData imgData=new GridData(GridData.FILL_HORIZONTAL);
  imgData.heightHint=0;
  imgData.horizontalAlignment=GridData.BEGINNING;
  imgCom.setLayoutData(imgData);
  layout=new GridLayout();
  layout.numColumns=2;
  textCom.setLayout(layout);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.horizontalAlignment=GridData.BEGINNING;
  textAreaLabel=new Label(textCom,SWT.NONE);
  textAreaLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  testText=new Text(textCom,SWT.BORDER | SWT.MULTI | SWT.WRAP| SWT.V_SCROLL);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=40;
  testText.setLayoutData(data);
  testText.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData textAreaLabelGD=new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1);
  textAreaLabel.setLayoutData(textAreaLabelGD);
  regularLabel=new Label(textCom,SWT.NULL);
  regularLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  regularLabel.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  GridData regularLabelGD=new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1);
  regularLabel.setLayoutData(regularLabelGD);
  this.regularText=new Text(textCom,SWT.BORDER | SWT.MULTI | SWT.WRAP| SWT.V_SCROLL);
  this.regularText.setLayoutData(data);
  regularText.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  regularText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      boolean enabled=(!regularText.getText().equals(PluginConstant.EMPTY_STRING)) && (CheckValueUtils.isPatternValue(regularText.getText()));
      if (pattern != null) {
        saveButton.setEnabled(enabled);
      }
      createPatternButton.setEnabled(enabled);
    }
  }
);
  GridData textData=new GridData(GridData.FILL_BOTH);
  textData.heightHint=400;
  textCom.setLayoutData(textData);
  GridLayout llayout=new GridLayout();
  llayout.numColumns=4;
  buttonsCom.setLayout(llayout);
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=25;
  data.widthHint=92;
  sqlButton=new Button(buttonsCom,SWT.PUSH);
  sqlButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  sqlButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  sqlButton.setLayoutData(data);
  sqlButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      openSQLEditor();
    }
  }
);
  createPatternButton=new Button(buttonsCom,SWT.PUSH);
  createPatternButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  createPatternButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=25;
  data.widthHint=92;
  createPatternButton.setLayoutData(data);
  createPatternButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      String language=null;
      if (regularExpression != null) {
        language=regularExpression.getExpression().getLanguage();
      }
 else {
        DbmsLanguage dbmsLanguage=getDbmsLanguage();
        if (dbmsLanguage != null) {
          dbmsLanguage.setFunctionName(getFunctionName());
          language=dbmsLanguage.getDbmsName();
        }
      }
      new CreatePatternAction(ResourceManager.getPatternFolder(),ExpressionType.REGEXP,regularText.getText(),language).run();
    }
  }
);
  createPatternButton.setEnabled(false);
  saveButton=new Button(buttonsCom,SWT.PUSH);
  saveButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  saveButton.setEnabled(false);
  saveButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.heightHint=25;
  data.widthHint=92;
  saveButton.setLayoutData(data);
  saveButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      savePattern();
    }
  }
);
  testButton=new Button(buttonsCom,SWT.PUSH);
  data=new GridData(GridData.FILL_HORIZONTAL);
  testButton.setLayoutData(data);
  testButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  testButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  testButton.setLayoutData(data);
  testButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      testRegularText();
    }
  }
);
  expandImageComposite();
  data=new GridData(GridData.FILL_HORIZONTAL);
  buttonsCom.setLayoutData(data);
  scrolledComposite.setMinSize(mainComposite.computeSize(SWT.DEFAULT,SWT.DEFAULT));
  mainComposite.layout();
  activateContext();
  fillComboData();
}