Program: 91794
Project: 91794
Buggy source:
/** 
 * Creates the connection settings container, where the user can choose how to connect to the docker daemon (using sockets or TCP with SSL - or not)
 * @param parent the parent container (ie, the main container in the preference page)
 */
private void createConnectionSettingsContainer(final Composite parent){
  final int COLUMNS=3;
  final int INDENT=20;
  final Composite container=new Composite(parent,SWT.NONE);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).span(1,1).grab(true,false).applyTo(container);
  GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(6,6).spacing(10,2).applyTo(container);
  final Label connectionNameLabel=new Label(container,SWT.NONE);
  connectionNameLabel.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(connectionNameLabel);
  final Text connectionNameText=new Text(container,SWT.BORDER);
  connectionNameText.setToolTipText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).span(2,1).applyTo(connectionNameText);
  final Button customConnectionSettingsButton=new Button(container,SWT.CHECK);
  customConnectionSettingsButton.setText("String_Node_Str");
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).indent(0,10).span(COLUMNS,1).applyTo(customConnectionSettingsButton);
  final Group customSettingsGroup=new Group(container,SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).span(COLUMNS,1).grab(true,false).applyTo(customSettingsGroup);
  GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(6,6).spacing(10,2).applyTo(customSettingsGroup);
  final Button unixSocketBindingModeButton=new Button(customSettingsGroup,SWT.RADIO);
  unixSocketBindingModeButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(COLUMNS,1).applyTo(unixSocketBindingModeButton);
  final Label unixSocketPathLabel=new Label(customSettingsGroup,SWT.NONE);
  unixSocketPathLabel.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT,0).applyTo(unixSocketPathLabel);
  final Text unixSocketPathText=new Text(customSettingsGroup,SWT.BORDER);
  unixSocketPathText.setToolTipText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).applyTo(unixSocketPathText);
  final Button unixSocketPathBrowseButton=new Button(customSettingsGroup,SWT.BUTTON1);
  unixSocketPathBrowseButton.setText(WizardMessages.getString("String_Node_Str"));
  unixSocketPathBrowseButton.addSelectionListener(onBrowseUnixSocketPath());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(unixSocketPathBrowseButton);
  final Button tcpConnectionBindingModeButton=new Button(customSettingsGroup,SWT.RADIO);
  tcpConnectionBindingModeButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(COLUMNS,1).applyTo(tcpConnectionBindingModeButton);
  final Label tcpHostLabel=new Label(customSettingsGroup,SWT.NONE);
  tcpHostLabel.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT,0).applyTo(tcpHostLabel);
  final Text tcpHostText=new Text(customSettingsGroup,SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(2,1).grab(true,false).applyTo(tcpHostText);
  final Button tcpAuthButton=new Button(customSettingsGroup,SWT.CHECK);
  tcpAuthButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT,0).span(3,1).applyTo(tcpAuthButton);
  final Label tcpCertPathLabel=new Label(customSettingsGroup,SWT.NONE);
  tcpCertPathLabel.setText(WizardMessages.getString("String_Node_Str"));
  tcpCertPathLabel.setToolTipText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT * 2,0).applyTo(tcpCertPathLabel);
  final Text tcpCertPathText=new Text(customSettingsGroup,SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).applyTo(tcpCertPathText);
  final Button tcpCertPathBrowseButton=new Button(customSettingsGroup,SWT.BUTTON1);
  tcpCertPathBrowseButton.setText(WizardMessages.getString("String_Node_Str"));
  tcpCertPathBrowseButton.addSelectionListener(onBrowseTcpCertPath());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(tcpCertPathBrowseButton);
  final Button testConnectionButton=new Button(container,SWT.NONE);
  testConnectionButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(COLUMNS,1).align(SWT.END,SWT.CENTER).applyTo(testConnectionButton);
  testConnectionButton.addSelectionListener(onTestConnectionButtonSelection());
  final IObservableValue connectionNameModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.CONNECTION_NAME).observe(model);
  final IObservableValue unixSocketBindingModeModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.UNIX_SOCKET_BINDING_MODE).observe(model);
  final IObservableValue unixSocketPathModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.UNIX_SOCKET_PATH).observe(model);
  final IObservableValue customConnectionSettingsModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.CUSTOM_SETTINGS).observe(model);
  final IObservableValue tcpConnectionBindingModeModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_CONNECTION_BINDING_MODE).observe(model);
  final IObservableValue tcpCertPathModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_CERT_PATH).observe(model);
  final IObservableValue tcpTlsVerifyModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_TLS_VERIFY).observe(model);
  final IObservableValue tcpHostModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_HOST).observe(model);
  final Control[] bindingModeSelectionControls=new Control[]{unixSocketBindingModeButton,tcpConnectionBindingModeButton};
  final Control[] unixSocketControls=new Control[]{unixSocketPathText,unixSocketPathLabel,unixSocketPathBrowseButton};
  final Control[] tcpConnectionControls=new Control[]{tcpHostText,tcpHostLabel,tcpAuthButton};
  final Control[] tcpAuthControls=new Control[]{tcpCertPathText,tcpCertPathLabel,tcpCertPathBrowseButton};
  customConnectionSettingsModelObservable.addValueChangeListener(onCustomConnectionSettingsSelection(bindingModeSelectionControls,unixSocketControls,tcpAuthControls,tcpConnectionControls));
  unixSocketBindingModeModelObservable.addChangeListener(onUnixSocketBindingSelection(unixSocketControls));
  tcpConnectionBindingModeModelObservable.addChangeListener(onTcpConnectionBindingSelection(tcpConnectionControls,tcpAuthControls));
  tcpTlsVerifyModelObservable.addValueChangeListener(onTcpAuthSelection(tcpAuthControls));
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(connectionNameText),connectionNameModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(customConnectionSettingsButton),customConnectionSettingsModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(unixSocketBindingModeButton),unixSocketBindingModeModelObservable);
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(unixSocketPathText),unixSocketPathModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(tcpConnectionBindingModeButton),tcpConnectionBindingModeModelObservable);
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(tcpHostText),tcpHostModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(tcpAuthButton),tcpTlsVerifyModelObservable);
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(tcpCertPathText),tcpCertPathModelObservable);
  dbc.addValidationStatusProvider(new ConnectionNameValidator(connectionNameModelObservable));
  dbc.addValidationStatusProvider(new UnixSocketValidator(unixSocketBindingModeModelObservable,unixSocketPathModelObservable));
  dbc.addValidationStatusProvider(new TcpHostValidator(tcpConnectionBindingModeModelObservable,tcpHostModelObservable));
  dbc.addValidationStatusProvider(new TcpCertificatesValidator(tcpConnectionBindingModeModelObservable,tcpTlsVerifyModelObservable,tcpCertPathModelObservable));
  connectionNameText.setFocus();
  updateWidgetsState(bindingModeSelectionControls,unixSocketControls,tcpConnectionControls,tcpAuthControls);
}

Fixed version (ground truth):
/** 
 * Creates the connection settings container, where the user can choose how to connect to the docker daemon (using sockets or TCP with SSL - or not)
 * @param parent the parent container (ie, the main container in the preference page)
 */
private void createConnectionSettingsContainer(final Composite parent){
  final int COLUMNS=3;
  final int INDENT=20;
  final Composite container=new Composite(parent,SWT.NONE);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).span(1,1).grab(true,false).applyTo(container);
  GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(6,6).spacing(10,2).applyTo(container);
  final Label connectionNameLabel=new Label(container,SWT.NONE);
  connectionNameLabel.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(connectionNameLabel);
  final Text connectionNameText=new Text(container,SWT.BORDER);
  connectionNameText.setToolTipText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).span(2,1).applyTo(connectionNameText);
  final Button customConnectionSettingsButton=new Button(container,SWT.CHECK);
  customConnectionSettingsButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).indent(0,10).span(COLUMNS,1).applyTo(customConnectionSettingsButton);
  final Group customSettingsGroup=new Group(container,SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.FILL).span(COLUMNS,1).grab(true,false).applyTo(customSettingsGroup);
  GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(6,6).spacing(10,2).applyTo(customSettingsGroup);
  final Button unixSocketBindingModeButton=new Button(customSettingsGroup,SWT.RADIO);
  unixSocketBindingModeButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(COLUMNS,1).applyTo(unixSocketBindingModeButton);
  final Label unixSocketPathLabel=new Label(customSettingsGroup,SWT.NONE);
  unixSocketPathLabel.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT,0).applyTo(unixSocketPathLabel);
  final Text unixSocketPathText=new Text(customSettingsGroup,SWT.BORDER);
  unixSocketPathText.setToolTipText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).applyTo(unixSocketPathText);
  final Button unixSocketPathBrowseButton=new Button(customSettingsGroup,SWT.BUTTON1);
  unixSocketPathBrowseButton.setText(WizardMessages.getString("String_Node_Str"));
  unixSocketPathBrowseButton.addSelectionListener(onBrowseUnixSocketPath());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(unixSocketPathBrowseButton);
  final Button tcpConnectionBindingModeButton=new Button(customSettingsGroup,SWT.RADIO);
  tcpConnectionBindingModeButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(COLUMNS,1).applyTo(tcpConnectionBindingModeButton);
  final Label tcpHostLabel=new Label(customSettingsGroup,SWT.NONE);
  tcpHostLabel.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT,0).applyTo(tcpHostLabel);
  final Text tcpHostText=new Text(customSettingsGroup,SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(2,1).grab(true,false).applyTo(tcpHostText);
  final Button tcpAuthButton=new Button(customSettingsGroup,SWT.CHECK);
  tcpAuthButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT,0).span(3,1).applyTo(tcpAuthButton);
  final Label tcpCertPathLabel=new Label(customSettingsGroup,SWT.NONE);
  tcpCertPathLabel.setText(WizardMessages.getString("String_Node_Str"));
  tcpCertPathLabel.setToolTipText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).indent(INDENT * 2,0).applyTo(tcpCertPathLabel);
  final Text tcpCertPathText=new Text(customSettingsGroup,SWT.BORDER);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).applyTo(tcpCertPathText);
  final Button tcpCertPathBrowseButton=new Button(customSettingsGroup,SWT.BUTTON1);
  tcpCertPathBrowseButton.setText(WizardMessages.getString("String_Node_Str"));
  tcpCertPathBrowseButton.addSelectionListener(onBrowseTcpCertPath());
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).applyTo(tcpCertPathBrowseButton);
  final Button testConnectionButton=new Button(container,SWT.NONE);
  testConnectionButton.setText(WizardMessages.getString("String_Node_Str"));
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.CENTER).span(COLUMNS,1).align(SWT.END,SWT.CENTER).applyTo(testConnectionButton);
  testConnectionButton.addSelectionListener(onTestConnectionButtonSelection());
  final IObservableValue connectionNameModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.CONNECTION_NAME).observe(model);
  final IObservableValue unixSocketBindingModeModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.UNIX_SOCKET_BINDING_MODE).observe(model);
  final IObservableValue unixSocketPathModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.UNIX_SOCKET_PATH).observe(model);
  final IObservableValue customConnectionSettingsModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.CUSTOM_SETTINGS).observe(model);
  final IObservableValue tcpConnectionBindingModeModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_CONNECTION_BINDING_MODE).observe(model);
  final IObservableValue tcpCertPathModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_CERT_PATH).observe(model);
  final IObservableValue tcpTlsVerifyModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_TLS_VERIFY).observe(model);
  final IObservableValue tcpHostModelObservable=BeanProperties.value(NewDockerConnectionPageModel.class,NewDockerConnectionPageModel.TCP_HOST).observe(model);
  final Control[] bindingModeSelectionControls=new Control[]{unixSocketBindingModeButton,tcpConnectionBindingModeButton};
  final Control[] unixSocketControls=new Control[]{unixSocketPathText,unixSocketPathLabel,unixSocketPathBrowseButton};
  final Control[] tcpConnectionControls=new Control[]{tcpHostText,tcpHostLabel,tcpAuthButton};
  final Control[] tcpAuthControls=new Control[]{tcpCertPathText,tcpCertPathLabel,tcpCertPathBrowseButton};
  customConnectionSettingsModelObservable.addValueChangeListener(onCustomConnectionSettingsSelection(bindingModeSelectionControls,unixSocketControls,tcpAuthControls,tcpConnectionControls));
  unixSocketBindingModeModelObservable.addChangeListener(onUnixSocketBindingSelection(unixSocketControls));
  tcpConnectionBindingModeModelObservable.addChangeListener(onTcpConnectionBindingSelection(tcpConnectionControls,tcpAuthControls));
  tcpTlsVerifyModelObservable.addValueChangeListener(onTcpAuthSelection(tcpAuthControls));
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(connectionNameText),connectionNameModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(customConnectionSettingsButton),customConnectionSettingsModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(unixSocketBindingModeButton),unixSocketBindingModeModelObservable);
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(unixSocketPathText),unixSocketPathModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(tcpConnectionBindingModeButton),tcpConnectionBindingModeModelObservable);
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(tcpHostText),tcpHostModelObservable);
  dbc.bindValue(WidgetProperties.selection().observe(tcpAuthButton),tcpTlsVerifyModelObservable);
  dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(tcpCertPathText),tcpCertPathModelObservable);
  dbc.addValidationStatusProvider(new ConnectionNameValidator(connectionNameModelObservable));
  dbc.addValidationStatusProvider(new UnixSocketValidator(unixSocketBindingModeModelObservable,unixSocketPathModelObservable));
  dbc.addValidationStatusProvider(new TcpHostValidator(tcpConnectionBindingModeModelObservable,tcpHostModelObservable));
  dbc.addValidationStatusProvider(new TcpCertificatesValidator(tcpConnectionBindingModeModelObservable,tcpTlsVerifyModelObservable,tcpCertPathModelObservable));
  connectionNameText.setFocus();
  updateWidgetsState(bindingModeSelectionControls,unixSocketControls,tcpConnectionControls,tcpAuthControls);
}