Program: 127313
Project: 127313
Buggy source:
@Override protected void addFields(){
  int width=getSize().x;
  GridLayout layout2;
  databaseSettingGroup=new Group(this,SWT.NONE);
  GridLayout gridLayout1=new GridLayout(1,false);
  databaseSettingGroup.setLayout(gridLayout1);
  GridData gridData1=new GridData(SWT.FILL,SWT.FILL,true,true);
  databaseSettingGroup.setLayoutData(gridData1);
  scrolledComposite=new ScrolledComposite(databaseSettingGroup,SWT.V_SCROLL | SWT.H_SCROLL);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  scrolledComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  newParent=new Composite(scrolledComposite,SWT.NONE);
  GridLayout gridLayout=new GridLayout();
  newParent.setLayout(gridLayout);
  scrolledComposite.setContent(newParent);
  compositeGroupDbSettings=Form.startNewGridLayout(newParent,1);
  layout2=(GridLayout)compositeGroupDbSettings.getLayout();
  layout2.marginHeight=0;
  layout2.marginTop=0;
  layout2.marginBottom=0;
  layout2.marginLeft=0;
  layout2.marginRight=0;
  layout2.marginWidth=0;
  compositeDbSettings=new Composite(compositeGroupDbSettings,SWT.NULL);
  compositeDbSettings.setLayout(new GridLayout(3,false));
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.minimumWidth=width;
  gridData.widthHint=width;
  compositeDbSettings.setLayoutData(gridData);
  layout2=(GridLayout)compositeDbSettings.getLayout();
  layout2.marginHeight=0;
  layout2.marginTop=0;
  layout2.marginBottom=0;
  addDBSelectCombo();
  Label label=new Label(compositeDbSettings,SWT.SEPARATOR | SWT.H_SCROLL);
  GridData data=new GridData(GridData.FILL_HORIZONTAL);
  data.horizontalSpan=3;
  label.setLayoutData(data);
  addFieldsForTypeDB(compositeGroupDbSettings);
  addFieldsForGeneralDB(compositeGroupDbSettings);
  switchBetweenTypeandGeneralDB(true);
  addCheckAndStandardButtons(width,compositeGroupDbSettings);
  checkDBTypeAS400();
  scrolledComposite.addControlListener(new ControlAdapter(){
    @Override public void controlResized(    ControlEvent e){
      Rectangle r=scrolledComposite.getClientArea();
      if (getConnection().getDatabaseType() != null && getConnection().getDatabaseType().equals(EDatabaseConnTemplate.HIVE.getDBDisplayName())) {
        scrolledComposite.setMinSize(newParent.computeSize(SWT.DEFAULT,820));
      }
 else {
        scrolledComposite.setMinSize(newParent.computeSize(SWT.DEFAULT,550));
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addFields(){
  int width=getSize().x;
  GridLayout layout2;
  databaseSettingGroup=new Group(this,SWT.NONE);
  GridLayout gridLayout1=new GridLayout(1,false);
  databaseSettingGroup.setLayout(gridLayout1);
  GridData gridData1=new GridData(SWT.FILL,SWT.FILL,true,true);
  databaseSettingGroup.setLayoutData(gridData1);
  scrolledComposite=new ScrolledComposite(databaseSettingGroup,SWT.V_SCROLL | SWT.H_SCROLL);
  scrolledComposite.setExpandHorizontal(true);
  scrolledComposite.setExpandVertical(true);
  scrolledComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  newParent=new Composite(scrolledComposite,SWT.NONE);
  GridLayout gridLayout=new GridLayout();
  newParent.setLayout(gridLayout);
  scrolledComposite.setContent(newParent);
  compositeGroupDbSettings=Form.startNewGridLayout(newParent,1);
  layout2=(GridLayout)compositeGroupDbSettings.getLayout();
  layout2.marginHeight=0;
  layout2.marginTop=0;
  layout2.marginBottom=0;
  layout2.marginLeft=0;
  layout2.marginRight=0;
  layout2.marginWidth=0;
  compositeDbSettings=new Composite(compositeGroupDbSettings,SWT.NULL);
  compositeDbSettings.setLayout(new GridLayout(3,false));
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.minimumWidth=width;
  gridData.widthHint=width;
  compositeDbSettings.setLayoutData(gridData);
  layout2=(GridLayout)compositeDbSettings.getLayout();
  layout2.marginHeight=0;
  layout2.marginTop=0;
  layout2.marginBottom=0;
  addDBSelectCombo();
  Label label=new Label(compositeDbSettings,SWT.SEPARATOR | SWT.H_SCROLL);
  GridData data=new GridData(GridData.FILL_HORIZONTAL);
  data.horizontalSpan=3;
  label.setLayoutData(data);
  addFieldsForTypeDB(compositeGroupDbSettings);
  addFieldsForGeneralDB(compositeGroupDbSettings);
  switchBetweenTypeandGeneralDB(true);
  addCheckAndStandardButtons(width,compositeGroupDbSettings);
  checkDBTypeAS400();
  scrolledComposite.addControlListener(new ControlAdapter(){
    @Override public void controlResized(    ControlEvent e){
      Rectangle r=scrolledComposite.getClientArea();
      if (getConnection().getDatabaseType() != null && getConnection().getDatabaseType().equals(EDatabaseConnTemplate.HIVE.getDBDisplayName())) {
        if (Platform.getOS().equals(Platform.OS_LINUX)) {
          scrolledComposite.setMinSize(newParent.computeSize(SWT.DEFAULT,900));
        }
 else {
          scrolledComposite.setMinSize(newParent.computeSize(SWT.DEFAULT,820));
        }
      }
 else {
        scrolledComposite.setMinSize(newParent.computeSize(SWT.DEFAULT,550));
      }
    }
  }
);
}