Program: 138519
Project: 138519
Buggy source:
@Override public void createPartControl(final Composite parent){
  ScrolledComposite scrolledComposite=new ScrolledComposite(parent,SWT.V_SCROLL);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  Composite mainComposite=new Composite(scrolledComposite,SWT.NONE);
  scrolledComposite.setContent(mainComposite);
  BorderLayout blay=new BorderLayout();
  mainComposite.setLayout(blay);
  final Composite composite=new Composite(mainComposite,SWT.NONE);
  composite.setLayoutData(BorderLayout.NORTH);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  layout.marginWidth=0;
  layout.numColumns=1;
  composite.setLayout(layout);
  Composite coboCom=new Composite(composite,SWT.NONE);
  layout=new GridLayout();
  layout.numColumns=3;
  coboCom.setLayout(layout);
  GridData data=new GridData();
  data.horizontalAlignment=GridData.CENTER;
  coboCom.setLayoutData(data);
  buttonJava=new Button(coboCom,SWT.RADIO);
  buttonJava.setText(ExecutionLanguage.JAVA.getLiteral());
  data=new GridData();
  data.widthHint=120;
  buttonJava.setLayoutData(data);
  buttonJava.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      isJavaEngine=true;
      sqlButton.setEnabled(false);
      dbCombo.setEnabled(false);
    }
  }
);
  buttonSql=new Button(coboCom,SWT.RADIO);
  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);
    }
  }
);
  buttonSql.setSelection(true);
  buttonSql.setEnabled(!isJavaEngine);
  dbCombo=new CCombo(coboCom,SWT.DROP_DOWN | SWT.BORDER);
  dbCombo.setEditable(false);
  data=new GridData();
  data.widthHint=100;
  dbCombo.setLayoutData(data);
  listTdDataProviders=RepositoryNodeHelper.getConnectionRepositoryNodes();
  List<String> items=new ArrayList<String>();
  for (  IRepositoryNode connRepNode : listTdDataProviders) {
    ConnectionItem connItem=(ConnectionItem)connRepNode.getObject().getProperty().getItem();
    items.add(connItem.getConnection().getName());
  }
  if (!items.isEmpty()) {
    dbCombo.setItems(items.toArray(new String[0]));
    if (dbCombo.getText().equals("String_Node_Str")) {
      dbCombo.setText(items.get(0));
    }
  }
  Composite imgCom=new Composite(composite,SWT.NONE);
  imgCom.setLayout(layout);
  data=new GridData();
  data.horizontalAlignment=GridData.END;
  imgCom.setLayoutData(data);
  emoticonLabel=new Label(imgCom,SWT.NONE);
  GridData gd=new GridData();
  gd.heightHint=18;
  gd.widthHint=18;
  emoticonLabel.setLayoutData(gd);
  gd=new GridData();
  gd.heightHint=18;
  gd.widthHint=65;
  resultLabel=new Label(imgCom,SWT.NONE);
  resultLabel.setLayoutData(gd);
  Label textAreaLabel=new Label(composite,SWT.NONE);
  textAreaLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  testText=new Text(composite,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"));
  Label regularLabel=new Label(composite,SWT.NONE);
  regularLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  this.regularText=new Text(composite,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);
    }
  }
);
  BorderLayout blayout=new BorderLayout();
  Composite bottom=new Composite(mainComposite,SWT.NONE);
  bottom.setLayout(blayout);
  bottom.setLayoutData(BorderLayout.CENTER);
  Composite centerPane=new Composite(bottom,SWT.NONE);
  centerPane.setLayoutData(BorderLayout.CENTER);
  final Composite rightPane=new Composite(bottom,SWT.NONE);
  rightPane.setLayoutData(BorderLayout.EAST);
  GridLayout llayout=new GridLayout();
  llayout.numColumns=3;
  centerPane.setLayout(llayout);
  GridLayout rlayout=new GridLayout();
  rlayout.numColumns=1;
  rightPane.setLayout(rlayout);
  data=new GridData();
  data.heightHint=25;
  data.widthHint=92;
  sqlButton=new Button(centerPane,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(centerPane,SWT.PUSH);
  createPatternButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  createPatternButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData();
  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) {
          language=dbmsLanguage.getDbmsName();
        }
      }
      new CreatePatternAction(ResourceManager.getPatternFolder(),ExpressionType.REGEXP,regularText.getText(),language).run();
    }
  }
);
  createPatternButton.setEnabled(false);
  saveButton=new Button(centerPane,SWT.PUSH);
  saveButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  saveButton.setEnabled(false);
  saveButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData();
  data.heightHint=25;
  data.widthHint=92;
  saveButton.setLayoutData(data);
  saveButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      savePattern();
    }
  }
);
  testButton=new Button(rightPane,SWT.PUSH);
  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();
    }
  }
);
  scrolledComposite.setMinSize(mainComposite.computeSize(SWT.DEFAULT,SWT.DEFAULT));
  mainComposite.layout();
  activateContext();
}

Fixed version (ground truth):
@Override public void createPartControl(final Composite parent){
  ScrolledComposite scrolledComposite=new ScrolledComposite(parent,SWT.V_SCROLL);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  Composite mainComposite=new Composite(scrolledComposite,SWT.NONE);
  scrolledComposite.setContent(mainComposite);
  BorderLayout blay=new BorderLayout();
  mainComposite.setLayout(blay);
  final Composite composite=new Composite(mainComposite,SWT.NONE);
  composite.setLayoutData(BorderLayout.NORTH);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  layout.marginWidth=0;
  layout.numColumns=1;
  composite.setLayout(layout);
  Composite coboCom=new Composite(composite,SWT.NONE);
  layout=new GridLayout();
  layout.numColumns=3;
  coboCom.setLayout(layout);
  GridData data=new GridData();
  data.horizontalAlignment=GridData.CENTER;
  coboCom.setLayoutData(data);
  buttonJava=new Button(coboCom,SWT.RADIO);
  buttonJava.setText(ExecutionLanguage.JAVA.getLiteral());
  data=new GridData();
  data.widthHint=120;
  buttonJava.setLayoutData(data);
  buttonJava.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      isJavaEngine=true;
      sqlButton.setEnabled(false);
      dbCombo.setEnabled(false);
    }
  }
);
  buttonSql=new Button(coboCom,SWT.RADIO);
  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);
    }
  }
);
  buttonSql.setSelection(true);
  buttonSql.setEnabled(!isJavaEngine);
  dbCombo=new CCombo(coboCom,SWT.DROP_DOWN | SWT.BORDER);
  dbCombo.setEditable(false);
  data=new GridData();
  data.widthHint=100;
  dbCombo.setLayoutData(data);
  listTdDataProviders=RepositoryNodeHelper.getDBConnectionRepositoryNodes();
  List<String> items=new ArrayList<String>();
  for (  IRepositoryNode connRepNode : listTdDataProviders) {
    ConnectionItem connItem=(ConnectionItem)connRepNode.getObject().getProperty().getItem();
    items.add(connItem.getConnection().getName());
  }
  if (!items.isEmpty()) {
    dbCombo.setItems(items.toArray(new String[0]));
    if (dbCombo.getText().equals("String_Node_Str")) {
      dbCombo.setText(items.get(0));
    }
  }
  Composite imgCom=new Composite(composite,SWT.NONE);
  imgCom.setLayout(layout);
  data=new GridData();
  data.horizontalAlignment=GridData.END;
  imgCom.setLayoutData(data);
  emoticonLabel=new Label(imgCom,SWT.NONE);
  GridData gd=new GridData();
  gd.heightHint=18;
  gd.widthHint=18;
  emoticonLabel.setLayoutData(gd);
  gd=new GridData();
  gd.heightHint=18;
  gd.widthHint=65;
  resultLabel=new Label(imgCom,SWT.NONE);
  resultLabel.setLayoutData(gd);
  Label textAreaLabel=new Label(composite,SWT.NONE);
  textAreaLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  testText=new Text(composite,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"));
  Label regularLabel=new Label(composite,SWT.NONE);
  regularLabel.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  this.regularText=new Text(composite,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);
    }
  }
);
  BorderLayout blayout=new BorderLayout();
  Composite bottom=new Composite(mainComposite,SWT.NONE);
  bottom.setLayout(blayout);
  bottom.setLayoutData(BorderLayout.CENTER);
  Composite centerPane=new Composite(bottom,SWT.NONE);
  centerPane.setLayoutData(BorderLayout.CENTER);
  final Composite rightPane=new Composite(bottom,SWT.NONE);
  rightPane.setLayoutData(BorderLayout.EAST);
  GridLayout llayout=new GridLayout();
  llayout.numColumns=3;
  centerPane.setLayout(llayout);
  GridLayout rlayout=new GridLayout();
  rlayout.numColumns=1;
  rightPane.setLayout(rlayout);
  data=new GridData();
  data.heightHint=25;
  data.widthHint=92;
  sqlButton=new Button(centerPane,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(centerPane,SWT.PUSH);
  createPatternButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  createPatternButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData();
  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) {
          language=dbmsLanguage.getDbmsName();
        }
      }
      new CreatePatternAction(ResourceManager.getPatternFolder(),ExpressionType.REGEXP,regularText.getText(),language).run();
    }
  }
);
  createPatternButton.setEnabled(false);
  saveButton=new Button(centerPane,SWT.PUSH);
  saveButton.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  saveButton.setEnabled(false);
  saveButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  data=new GridData();
  data.heightHint=25;
  data.widthHint=92;
  saveButton.setLayoutData(data);
  saveButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      savePattern();
    }
  }
);
  testButton=new Button(rightPane,SWT.PUSH);
  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();
    }
  }
);
  scrolledComposite.setMinSize(mainComposite.computeSize(SWT.DEFAULT,SWT.DEFAULT));
  mainComposite.layout();
  activateContext();
}