Program: 119069
Project: 119069
Buggy source:
/** 
 * DOC smallet ConnectionsComposite constructor comment.
 * @param parent
 * @param style
 */
public ConnectionFormComposite(Composite parent,int style,ConnectionsListComposite connectionsListComposite,ConnectionsDialog dialog){
  super(parent,style);
  this.dialog=dialog;
  this.connectionsListComposite=connectionsListComposite;
  toolkit=new FormToolkit(this.getDisplay());
  Composite formBody=toolkit.createComposite(this);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  layout.marginWidth=0;
  setLayout(layout);
  formBody.setLayoutData(new GridData(GridData.FILL_BOTH));
  formBody.setLayout(new GridLayout(3,false));
  GridDataFactory formDefaultFactory=GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER);
  Label repositoryLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(repositoryLabel);
  repositoryCombo=new ComboViewer(formBody,SWT.BORDER | SWT.READ_ONLY);
  repositoryCombo.setContentProvider(new ArrayContentProvider());
  repositoryCombo.setLabelProvider(new RepositoryFactoryLabelProvider());
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(repositoryCombo.getControl());
  Label nameLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(nameLabel);
  nameText=toolkit.createText(formBody,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(nameText);
  Label descriptionLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(descriptionLabel);
  descriptionText=toolkit.createText(formBody,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(descriptionText);
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  boolean usesMailCheck=brandingService.getBrandingConfiguration().isUseMailLoginCheck();
  Label userLabel;
  if (usesMailCheck) {
    userLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  }
 else {
    userLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  }
  formDefaultFactory.copy().applyTo(userLabel);
  userText=toolkit.createText(formBody,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(userText);
  passwordLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(passwordLabel);
  passwordText=toolkit.createText(formBody,"String_Node_Str",SWT.PASSWORD | SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(passwordText);
  Label workSpaceLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(workSpaceLabel);
  Composite wsCompo=toolkit.createComposite(formBody);
  GridLayout wsCompoLayout=new GridLayout(2,false);
  wsCompoLayout.marginHeight=0;
  wsCompoLayout.marginWidth=0;
  wsCompo.setLayout(wsCompoLayout);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(wsCompo);
  workSpaceText=toolkit.createText(wsCompo,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).applyTo(workSpaceText);
  workSpaceButton=toolkit.createButton(wsCompo,null,SWT.PUSH);
  workSpaceButton.setToolTipText(Messages.getString("String_Node_Str"));
  workSpaceButton.setImage(ImageProvider.getImage(EImage.THREE_DOTS_ICON));
  GridDataFactory.fillDefaults().applyTo(workSpaceButton);
  List<IRepositoryFactory> availableRepositories=getUsableRepositoryProvider();
  for (  IRepositoryFactory current : availableRepositories) {
    Map<String,LabelText> list=new HashMap<String,LabelText>();
    Map<String,LabelText> listRequired=new HashMap<String,LabelText>();
    Map<String,Button> listButtons=new HashMap<String,Button>();
    Map<String,LabelledCombo> listChoices=new HashMap<String,LabelledCombo>();
    dynamicControls.put(current,list);
    dynamicRequiredControls.put(current,listRequired);
    dynamicButtons.put(current,listButtons);
    dynamicChoices.put(current,listChoices);
    for (    final DynamicChoiceBean currentChoiceBean : current.getChoices()) {
      Label label=toolkit.createLabel(formBody,currentChoiceBean.getName());
      formDefaultFactory.copy().applyTo(label);
      Combo combo=new Combo(formBody,SWT.BORDER | SWT.READ_ONLY);
      for (      String label1 : currentChoiceBean.getChoices().values()) {
        combo.add(label1);
      }
      formDefaultFactory.copy().grab(true,false).applyTo(combo);
      listChoices.put(currentChoiceBean.getId(),new LabelledCombo(label,combo));
    }
    for (    DynamicFieldBean currentField : current.getFields()) {
      int textStyle=SWT.BORDER;
      if (currentField.isPassword()) {
        textStyle=textStyle | SWT.PASSWORD;
      }
      Label label=toolkit.createLabel(formBody,currentField.getName());
      formDefaultFactory.copy().align(SWT.FILL,SWT.CENTER).applyTo(label);
      Text text=toolkit.createText(formBody,"String_Node_Str",textStyle);
      formDefaultFactory.copy().grab(true,false).align(SWT.FILL,SWT.CENTER).applyTo(text);
      LabelText labelText=new LabelText(label,text);
      if (currentField.isRequired()) {
        listRequired.put(currentField.getId(),labelText);
      }
      list.put(currentField.getId(),labelText);
    }
    for (    final DynamicButtonBean currentButtonBean : current.getButtons()) {
      Button button=new Button(formBody,SWT.PUSH);
      button.setText(currentButtonBean.getName());
      button.addSelectionListener(new DelegateSelectionListener(currentButtonBean));
      formDefaultFactory.copy().align(SWT.RIGHT,SWT.CENTER).applyTo(button);
      listButtons.put(currentButtonBean.getId(),button);
    }
  }
  Label seperator=new Label(formBody,SWT.NONE);
  seperator.setVisible(false);
  GridData seperatorGridData=new GridData();
  seperatorGridData.horizontalSpan=3;
  seperatorGridData.heightHint=0;
  seperator.setLayoutData(seperatorGridData);
  Label placeHolder=new Label(formBody,SWT.NONE);
  deleteProjectsButton=new Button(formBody,SWT.NONE);
  deleteProjectsButton.setText(Messages.getString("String_Node_Str"));
  GridData deleteButtonGridData=new GridData();
  deleteButtonGridData.widthHint=LoginDialogV2.getNewButtonSize(deleteProjectsButton).x;
  deleteButtonGridData.horizontalSpan=2;
  deleteProjectsButton.setLayoutData(deleteButtonGridData);
  addListeners();
  addWorkSpaceListener();
  fillLists();
  showHideDynamicsControls();
  showHideTexts();
}

Fixed version (ground truth):
/** 
 * DOC smallet ConnectionsComposite constructor comment.
 * @param parent
 * @param style
 */
public ConnectionFormComposite(Composite parent,int style,ConnectionsListComposite connectionsListComposite,ConnectionsDialog dialog){
  super(parent,style);
  this.dialog=dialog;
  this.connectionsListComposite=connectionsListComposite;
  toolkit=new FormToolkit(this.getDisplay());
  toolkit.setBackground(ColorConstants.white);
  Composite formBody=toolkit.createComposite(this);
  formBody.setBackground(ColorConstants.white);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  layout.marginWidth=0;
  setLayout(layout);
  formBody.setLayoutData(new GridData(GridData.FILL_BOTH));
  formBody.setLayout(new GridLayout(3,false));
  GridDataFactory formDefaultFactory=GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER);
  Label repositoryLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(repositoryLabel);
  repositoryCombo=new ComboViewer(formBody,SWT.BORDER | SWT.READ_ONLY);
  repositoryCombo.setContentProvider(new ArrayContentProvider());
  repositoryCombo.setLabelProvider(new RepositoryFactoryLabelProvider());
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(repositoryCombo.getControl());
  Label nameLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(nameLabel);
  nameText=toolkit.createText(formBody,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(nameText);
  Label descriptionLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(descriptionLabel);
  descriptionText=toolkit.createText(formBody,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(descriptionText);
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  boolean usesMailCheck=brandingService.getBrandingConfiguration().isUseMailLoginCheck();
  Label userLabel;
  if (usesMailCheck) {
    userLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  }
 else {
    userLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  }
  formDefaultFactory.copy().applyTo(userLabel);
  userText=toolkit.createText(formBody,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(userText);
  passwordLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(passwordLabel);
  passwordText=toolkit.createText(formBody,"String_Node_Str",SWT.PASSWORD | SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(passwordText);
  Label workSpaceLabel=toolkit.createLabel(formBody,Messages.getString("String_Node_Str"));
  formDefaultFactory.copy().applyTo(workSpaceLabel);
  Composite wsCompo=toolkit.createComposite(formBody);
  GridLayout wsCompoLayout=new GridLayout(2,false);
  wsCompoLayout.marginHeight=0;
  wsCompoLayout.marginWidth=0;
  wsCompo.setLayout(wsCompoLayout);
  formDefaultFactory.copy().grab(true,false).span(2,1).applyTo(wsCompo);
  workSpaceText=toolkit.createText(wsCompo,"String_Node_Str",SWT.BORDER);
  formDefaultFactory.copy().grab(true,false).applyTo(workSpaceText);
  workSpaceButton=toolkit.createButton(wsCompo,null,SWT.PUSH);
  workSpaceButton.setToolTipText(Messages.getString("String_Node_Str"));
  workSpaceButton.setImage(ImageProvider.getImage(EImage.THREE_DOTS_ICON));
  GridDataFactory.fillDefaults().applyTo(workSpaceButton);
  List<IRepositoryFactory> availableRepositories=getUsableRepositoryProvider();
  for (  IRepositoryFactory current : availableRepositories) {
    Map<String,LabelText> list=new HashMap<String,LabelText>();
    Map<String,LabelText> listRequired=new HashMap<String,LabelText>();
    Map<String,Button> listButtons=new HashMap<String,Button>();
    Map<String,LabelledCombo> listChoices=new HashMap<String,LabelledCombo>();
    dynamicControls.put(current,list);
    dynamicRequiredControls.put(current,listRequired);
    dynamicButtons.put(current,listButtons);
    dynamicChoices.put(current,listChoices);
    for (    final DynamicChoiceBean currentChoiceBean : current.getChoices()) {
      Label label=toolkit.createLabel(formBody,currentChoiceBean.getName());
      formDefaultFactory.copy().applyTo(label);
      Combo combo=new Combo(formBody,SWT.BORDER | SWT.READ_ONLY);
      for (      String label1 : currentChoiceBean.getChoices().values()) {
        combo.add(label1);
      }
      formDefaultFactory.copy().grab(true,false).applyTo(combo);
      listChoices.put(currentChoiceBean.getId(),new LabelledCombo(label,combo));
    }
    for (    DynamicFieldBean currentField : current.getFields()) {
      int textStyle=SWT.BORDER;
      if (currentField.isPassword()) {
        textStyle=textStyle | SWT.PASSWORD;
      }
      Label label=toolkit.createLabel(formBody,currentField.getName());
      formDefaultFactory.copy().align(SWT.FILL,SWT.CENTER).applyTo(label);
      Text text=toolkit.createText(formBody,"String_Node_Str",textStyle);
      formDefaultFactory.copy().grab(true,false).align(SWT.FILL,SWT.CENTER).applyTo(text);
      LabelText labelText=new LabelText(label,text);
      if (currentField.isRequired()) {
        listRequired.put(currentField.getId(),labelText);
      }
      list.put(currentField.getId(),labelText);
    }
    for (    final DynamicButtonBean currentButtonBean : current.getButtons()) {
      Button button=new Button(formBody,SWT.PUSH);
      button.setText(currentButtonBean.getName());
      button.addSelectionListener(new DelegateSelectionListener(currentButtonBean));
      formDefaultFactory.copy().align(SWT.RIGHT,SWT.CENTER).applyTo(button);
      listButtons.put(currentButtonBean.getId(),button);
    }
  }
  Label seperator=new Label(formBody,SWT.NONE);
  seperator.setVisible(false);
  GridData seperatorGridData=new GridData();
  seperatorGridData.horizontalSpan=3;
  seperatorGridData.heightHint=0;
  seperator.setLayoutData(seperatorGridData);
  Label placeHolder=new Label(formBody,SWT.NONE);
  deleteProjectsButton=new Button(formBody,SWT.NONE);
  deleteProjectsButton.setText(Messages.getString("String_Node_Str"));
  GridData deleteButtonGridData=new GridData();
  deleteButtonGridData.widthHint=LoginDialogV2.getNewButtonSize(deleteProjectsButton).x;
  deleteButtonGridData.horizontalSpan=2;
  deleteProjectsButton.setLayoutData(deleteButtonGridData);
  addListeners();
  addWorkSpaceListener();
  fillLists();
  showHideDynamicsControls();
  showHideTexts();
}