Program: 92015
Project: 92015
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  int numColumn=2;
  if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
    numColumn=3;
  }
  Composite dialogComposite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(1,true);
  dialogComposite.setLayout(layout);
  Composite commonModeGroup=new Composite(dialogComposite,SWT.NONE);
  layout=new GridLayout(3,true);
  commonModeGroup.setLayout(layout);
  Label channelNameLabel=new Label(commonModeGroup,SWT.RIGHT);
  channelNameLabel.setText(Messages.TraceControl_EnableChannelNameLabel);
  fChannelNameText=new Text(commonModeGroup,SWT.NONE);
  fChannelNameText.setToolTipText(Messages.TraceControl_EnableChannelNameTooltip);
  Label subBufferSizeLabel=new Label(commonModeGroup,SWT.RIGHT);
  subBufferSizeLabel.setText(Messages.TraceControl_SubBufferSizePropertyName);
  fSubBufferSizeText=new Text(commonModeGroup,SWT.NONE);
  fSubBufferSizeText.setToolTipText(Messages.TraceControl_EnableChannelSubBufferSizeTooltip);
  fSubBufferSizeText.addVerifyListener(fVerifyListener);
  fSubBufferSizeText.addFocusListener(fFocusListener);
  fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  Label numSubBufferLabel=new Label(commonModeGroup,SWT.RIGHT);
  numSubBufferLabel.setText(Messages.TraceControl_NbSubBuffersPropertyName);
  fNumberOfSubBuffersText=new Text(commonModeGroup,SWT.NONE);
  fNumberOfSubBuffersText.setToolTipText(Messages.TraceControl_EnableChannelNbSubBuffersTooltip);
  fNumberOfSubBuffersText.addVerifyListener(fVerifyListener);
  fNumberOfSubBuffersText.addFocusListener(fFocusListener);
  Label switchTimerLabel=new Label(commonModeGroup,SWT.RIGHT);
  switchTimerLabel.setText(Messages.TraceControl_SwitchTimerPropertyName);
  fSwitchTimerText=new Text(commonModeGroup,SWT.NONE);
  fSwitchTimerText.setToolTipText(Messages.TraceControl_EnableChannelSwitchTimerTooltip);
  fSwitchTimerText.addVerifyListener(fVerifyListener);
  fSwitchTimerText.addFocusListener(fFocusListener);
  Label readTimerLabel=new Label(commonModeGroup,SWT.RIGHT);
  readTimerLabel.setText(Messages.TraceControl_ReadTimerPropertyName);
  fReadTimerText=new Text(commonModeGroup,SWT.NONE);
  fReadTimerText.setToolTipText(Messages.TraceControl_EnableChannelReadTimerTooltip);
  fReadTimerText.addVerifyListener(fVerifyListener);
  fReadTimerText.addFocusListener(fFocusListener);
  if (fTargetNodeComponent.isTraceFileRotationSupported()) {
    Label maxSizeTraceFilesLabel=new Label(commonModeGroup,SWT.RIGHT);
    maxSizeTraceFilesLabel.setText(Messages.TraceControl_MaxSizeTraceFilesPropertyName);
    fMaxSizeTraceText=new Text(commonModeGroup,SWT.NONE);
    fMaxSizeTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxSizeTraceFilesTooltip);
    fMaxSizeTraceText.addVerifyListener(fVerifyListener);
    fMaxSizeTraceText.addFocusListener(fFocusListener);
    Label maxNumTraceFilesLabel=new Label(commonModeGroup,SWT.RIGHT);
    maxNumTraceFilesLabel.setText(Messages.TraceControl_MaxNumTraceFilesPropertyName);
    fMaxNumberTraceText=new Text(commonModeGroup,SWT.NONE);
    fMaxNumberTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxNumTraceFilesTooltip);
    fMaxNumberTraceText.addVerifyListener(fVerifyListener);
    fMaxNumberTraceText.addFocusListener(fFocusListener);
  }
  if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) {
    fMetadataChannelButton=new Button(commonModeGroup,SWT.CHECK);
    fMetadataChannelButton.setText(Messages.TraceControl_ConfigureMetadataChannelName);
    fMetadataChannelButton.setSelection(false);
    fMetadataChannelButton.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        if (fMetadataChannelButton.getSelection()) {
          fPreviousChannelName=fChannelNameText.getText();
          fChannelNameText.setText("String_Node_Str");
          fChannelNameText.setEnabled(false);
        }
 else {
          fChannelNameText.setText(fPreviousChannelName);
          fChannelNameText.setEnabled(true);
        }
      }
    }
);
  }
  Group discardModeGroup=new Group(dialogComposite,SWT.SHADOW_NONE);
  discardModeGroup.setText(Messages.TraceControl_EnableChannelDiscardModeGroupName);
  layout=new GridLayout(numColumn,true);
  discardModeGroup.setLayout(layout);
  fDiscardModeButton=new Button(discardModeGroup,SWT.RADIO);
  fDiscardModeButton.setText(Messages.TraceControl_EnableChannelDiscardModeLabel);
  fDiscardModeButton.setToolTipText(Messages.TraceControl_EnableChannelDiscardModeTooltip);
  fDiscardModeButton.setSelection(true);
  fOverwriteModeButton=new Button(discardModeGroup,SWT.RADIO);
  fOverwriteModeButton.setText(Messages.TraceControl_EnableChannelOverwriteModeLabel);
  fOverwriteModeButton.setToolTipText(Messages.TraceControl_EnableChannelOverwriteModeTooltip);
  fOverwriteModeButton.setSelection(false);
  Group domainGroup=new Group(dialogComposite,SWT.SHADOW_NONE);
  domainGroup.setText(Messages.TraceControl_DomainDisplayName);
  layout=new GridLayout(numColumn,true);
  domainGroup.setLayout(layout);
  fKernelButton=new Button(domainGroup,SWT.RADIO);
  fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName);
  fKernelButton.setSelection(fIsKernel);
  fUstButton=new Button(domainGroup,SWT.RADIO);
  fUstButton.setText(Messages.TraceControl_UstDisplayName);
  fUstButton.setSelection(!fIsKernel);
  if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
    Group bufferTypeGroup=new Group(dialogComposite,SWT.SHADOW_NONE);
    bufferTypeGroup.setText(Messages.TraceControl_BufferTypeDisplayName);
    layout=new GridLayout(numColumn,true);
    bufferTypeGroup.setLayout(layout);
    GridData data=new GridData(GridData.FILL,GridData.BEGINNING,false,false);
    data.horizontalSpan=3;
    bufferTypeGroup.setLayoutData(data);
    fSharedBuffersButton=new Button(bufferTypeGroup,SWT.RADIO);
    fSharedBuffersButton.setText(Messages.TraceControl_SharedBuffersDisplayName);
    fSharedBuffersButton.setSelection(fIsKernel);
    fSharedBuffersButton.setEnabled(false);
    fPIDBuffersButton=new Button(bufferTypeGroup,SWT.RADIO);
    fPIDBuffersButton.setText(Messages.TraceControl_PerPidBuffersDisplayName);
    fPIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip);
    fPIDBuffersButton.setSelection(false);
    fUIDBuffersButton=new Button(bufferTypeGroup,SWT.RADIO);
    fUIDBuffersButton.setText(Messages.TraceControl_PerUidBuffersDisplayName);
    fUIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip);
    fUIDBuffersButton.setSelection(false);
    fUIDBuffersButton.setEnabled(!fIsKernel);
    fPIDBuffersButton.setEnabled(!fIsKernel);
    fUstButton.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        if (fUstButton.getSelection()) {
          fSharedBuffersButton.setSelection(false);
          fPIDBuffersButton.setSelection(false);
          fUIDBuffersButton.setSelection(false);
          fPIDBuffersButton.setEnabled(true);
          fUIDBuffersButton.setEnabled(true);
        }
 else {
          fSharedBuffersButton.setSelection(true);
          fPIDBuffersButton.setSelection(false);
          fUIDBuffersButton.setSelection(false);
          fPIDBuffersButton.setEnabled(false);
          fUIDBuffersButton.setEnabled(false);
        }
      }
    }
);
  }
  if ((fDomain != null) || (!fHasKernel)) {
    fKernelButton.setEnabled(false);
    fUstButton.setEnabled(false);
    if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
      fSharedBuffersButton.setEnabled(false);
      fUIDBuffersButton.setEnabled(false);
      fPIDBuffersButton.setEnabled(false);
      if (fDomain.getBufferType() != null) {
switch (fDomain.getBufferType()) {
case BUFFER_PER_PID:
          fPIDBuffersButton.setSelection(true);
        break;
case BUFFER_PER_UID:
      fUIDBuffersButton.setSelection(true);
    break;
case BUFFER_SHARED:
  fSharedBuffersButton.setSelection(true);
break;
default :
break;
}
}
}
}
GridData data=new GridData(GridData.FILL,GridData.BEGINNING,false,false);
data.horizontalSpan=3;
discardModeGroup.setLayoutData(data);
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
fDiscardModeButton.setLayoutData(data);
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
fOverwriteModeButton.setLayoutData(data);
data=new GridData(GridData.FILL,GridData.BEGINNING,false,false);
data.horizontalSpan=3;
domainGroup.setLayoutData(data);
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
fKernelButton.setLayoutData(data);
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
fUstButton.setLayoutData(data);
if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
fSharedBuffersButton.setLayoutData(data);
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
fPIDBuffersButton.setLayoutData(data);
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
fUIDBuffersButton.setLayoutData(data);
}
if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) {
data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
data.horizontalSpan=numColumn;
fMetadataChannelButton.setLayoutData(data);
}
data=new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan=2;
fChannelNameText.setLayoutData(data);
fSubBufferSizeText.setLayoutData(data);
fNumberOfSubBuffersText.setLayoutData(data);
fSwitchTimerText.setLayoutData(data);
fReadTimerText.setLayoutData(data);
if (fTargetNodeComponent.isTraceFileRotationSupported()) {
fMaxNumberTraceText.setLayoutData(data);
fMaxSizeTraceText.setLayoutData(data);
}
setDefaults();
return dialogComposite;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  int numColumn=2;
  if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
    numColumn=3;
  }
  Composite dialogComposite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout(1,true);
  dialogComposite.setLayout(layout);
  Composite commonModeGroup=new Composite(dialogComposite,SWT.NONE);
  layout=new GridLayout(3,true);
  commonModeGroup.setLayout(layout);
  Label channelNameLabel=new Label(commonModeGroup,SWT.RIGHT);
  channelNameLabel.setText(Messages.TraceControl_EnableChannelNameLabel);
  fChannelNameText=new Text(commonModeGroup,SWT.NONE);
  fChannelNameText.setToolTipText(Messages.TraceControl_EnableChannelNameTooltip);
  Label subBufferSizeLabel=new Label(commonModeGroup,SWT.RIGHT);
  subBufferSizeLabel.setText(Messages.TraceControl_SubBufferSizePropertyName);
  fSubBufferSizeText=new Text(commonModeGroup,SWT.NONE);
  fSubBufferSizeText.setToolTipText(Messages.TraceControl_EnableChannelSubBufferSizeTooltip);
  fSubBufferSizeText.addVerifyListener(fVerifyListener);
  fSubBufferSizeText.addFocusListener(fFocusListener);
  fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  Label numSubBufferLabel=new Label(commonModeGroup,SWT.RIGHT);
  numSubBufferLabel.setText(Messages.TraceControl_NbSubBuffersPropertyName);
  fNumberOfSubBuffersText=new Text(commonModeGroup,SWT.NONE);
  fNumberOfSubBuffersText.setToolTipText(Messages.TraceControl_EnableChannelNbSubBuffersTooltip);
  fNumberOfSubBuffersText.addVerifyListener(fVerifyListener);
  fNumberOfSubBuffersText.addFocusListener(fFocusListener);
  Label switchTimerLabel=new Label(commonModeGroup,SWT.RIGHT);
  switchTimerLabel.setText(Messages.TraceControl_SwitchTimerPropertyName);
  fSwitchTimerText=new Text(commonModeGroup,SWT.NONE);
  fSwitchTimerText.setToolTipText(Messages.TraceControl_EnableChannelSwitchTimerTooltip);
  fSwitchTimerText.addVerifyListener(fVerifyListener);
  fSwitchTimerText.addFocusListener(fFocusListener);
  Label readTimerLabel=new Label(commonModeGroup,SWT.RIGHT);
  readTimerLabel.setText(Messages.TraceControl_ReadTimerPropertyName);
  fReadTimerText=new Text(commonModeGroup,SWT.NONE);
  fReadTimerText.setToolTipText(Messages.TraceControl_EnableChannelReadTimerTooltip);
  fReadTimerText.addVerifyListener(fVerifyListener);
  fReadTimerText.addFocusListener(fFocusListener);
  if (fTargetNodeComponent.isTraceFileRotationSupported()) {
    Label maxSizeTraceFilesLabel=new Label(commonModeGroup,SWT.RIGHT);
    maxSizeTraceFilesLabel.setText(Messages.TraceControl_MaxSizeTraceFilesPropertyName);
    fMaxSizeTraceText=new Text(commonModeGroup,SWT.NONE);
    fMaxSizeTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxSizeTraceFilesTooltip);
    fMaxSizeTraceText.addVerifyListener(fVerifyListener);
    fMaxSizeTraceText.addFocusListener(fFocusListener);
    Label maxNumTraceFilesLabel=new Label(commonModeGroup,SWT.RIGHT);
    maxNumTraceFilesLabel.setText(Messages.TraceControl_MaxNumTraceFilesPropertyName);
    fMaxNumberTraceText=new Text(commonModeGroup,SWT.NONE);
    fMaxNumberTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxNumTraceFilesTooltip);
    fMaxNumberTraceText.addVerifyListener(fVerifyListener);
    fMaxNumberTraceText.addFocusListener(fFocusListener);
  }
  if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) {
    fMetadataChannelButton=new Button(commonModeGroup,SWT.CHECK);
    fMetadataChannelButton.setText(Messages.TraceControl_ConfigureMetadataChannelName);
    fMetadataChannelButton.setSelection(false);
    fMetadataChannelButton.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        if (fMetadataChannelButton.getSelection()) {
          fPreviousChannelName=fChannelNameText.getText();
          fChannelNameText.setText("String_Node_Str");
          fChannelNameText.setEnabled(false);
        }
 else {
          fChannelNameText.setText(fPreviousChannelName);
          fChannelNameText.setEnabled(true);
        }
      }
    }
);
  }
  Group discardModeGroup=new Group(dialogComposite,SWT.SHADOW_NONE);
  discardModeGroup.setText(Messages.TraceControl_EnableChannelDiscardModeGroupName);
  layout=new GridLayout(numColumn,true);
  discardModeGroup.setLayout(layout);
  fDiscardModeButton=new Button(discardModeGroup,SWT.RADIO);
  fDiscardModeButton.setText(Messages.TraceControl_EnableChannelDiscardModeLabel);
  fDiscardModeButton.setToolTipText(Messages.TraceControl_EnableChannelDiscardModeTooltip);
  fDiscardModeButton.setSelection(true);
  fOverwriteModeButton=new Button(discardModeGroup,SWT.RADIO);
  fOverwriteModeButton.setText(Messages.TraceControl_EnableChannelOverwriteModeLabel);
  fOverwriteModeButton.setToolTipText(Messages.TraceControl_EnableChannelOverwriteModeTooltip);
  fOverwriteModeButton.setSelection(false);
  Group domainGroup=new Group(dialogComposite,SWT.SHADOW_NONE);
  domainGroup.setText(Messages.TraceControl_DomainDisplayName);
  layout=new GridLayout(numColumn,true);
  domainGroup.setLayout(layout);
  fKernelButton=new Button(domainGroup,SWT.RADIO);
  fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName);
  fKernelButton.setSelection(fIsKernel);
  fUstButton=new Button(domainGroup,SWT.RADIO);
  fUstButton.setText(Messages.TraceControl_UstDisplayName);
  fUstButton.setSelection(!fIsKernel);
  if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
    Group bufferTypeGroup=new Group(dialogComposite,SWT.SHADOW_NONE);
    bufferTypeGroup.setText(Messages.TraceControl_BufferTypeDisplayName);
    layout=new GridLayout(numColumn,true);
    bufferTypeGroup.setLayout(layout);
    GridData data=new GridData(GridData.FILL,GridData.BEGINNING,false,false);
    data.horizontalSpan=3;
    bufferTypeGroup.setLayoutData(data);
    fSharedBuffersButton=new Button(bufferTypeGroup,SWT.RADIO);
    fSharedBuffersButton.setText(Messages.TraceControl_SharedBuffersDisplayName);
    fSharedBuffersButton.setSelection(fIsKernel);
    fSharedBuffersButton.setEnabled(false);
    fPIDBuffersButton=new Button(bufferTypeGroup,SWT.RADIO);
    fPIDBuffersButton.setText(Messages.TraceControl_PerPidBuffersDisplayName);
    fPIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip);
    fPIDBuffersButton.setSelection(false);
    fUIDBuffersButton=new Button(bufferTypeGroup,SWT.RADIO);
    fUIDBuffersButton.setText(Messages.TraceControl_PerUidBuffersDisplayName);
    fUIDBuffersButton.setToolTipText(Messages.TraceControl_PerPidBuffersTooltip);
    fUIDBuffersButton.setSelection(false);
    fUIDBuffersButton.setEnabled(!fIsKernel);
    fPIDBuffersButton.setEnabled(!fIsKernel);
    fUstButton.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        if (fUstButton.getSelection()) {
          fSharedBuffersButton.setSelection(false);
          fPIDBuffersButton.setSelection(false);
          fUIDBuffersButton.setSelection(false);
          fPIDBuffersButton.setEnabled(true);
          fUIDBuffersButton.setEnabled(true);
        }
 else {
          fSharedBuffersButton.setSelection(true);
          fPIDBuffersButton.setSelection(false);
          fUIDBuffersButton.setSelection(false);
          fPIDBuffersButton.setEnabled(false);
          fUIDBuffersButton.setEnabled(false);
        }
      }
    }
);
  }
  if ((fDomain != null) || (!fHasKernel)) {
    fKernelButton.setEnabled(false);
    fUstButton.setEnabled(false);
    if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
      fSharedBuffersButton.setEnabled(false);
      fUIDBuffersButton.setEnabled(!fHasKernel);
      fPIDBuffersButton.setEnabled(!fHasKernel);
      setBufferTypeButtonSelection();
    }
  }
  GridData data=new GridData(GridData.FILL,GridData.BEGINNING,false,false);
  data.horizontalSpan=3;
  discardModeGroup.setLayoutData(data);
  data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
  fDiscardModeButton.setLayoutData(data);
  data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
  fOverwriteModeButton.setLayoutData(data);
  data=new GridData(GridData.FILL,GridData.BEGINNING,false,false);
  data.horizontalSpan=3;
  domainGroup.setLayoutData(data);
  data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
  fKernelButton.setLayoutData(data);
  data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
  fUstButton.setLayoutData(data);
  if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
    data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
    fSharedBuffersButton.setLayoutData(data);
    data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
    fPIDBuffersButton.setLayoutData(data);
    data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
    fUIDBuffersButton.setLayoutData(data);
  }
  if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) {
    data=new GridData(SWT.BEGINNING,SWT.BEGINNING,true,true);
    data.horizontalSpan=numColumn;
    fMetadataChannelButton.setLayoutData(data);
  }
  data=new GridData(GridData.FILL_HORIZONTAL);
  data.horizontalSpan=2;
  fChannelNameText.setLayoutData(data);
  fSubBufferSizeText.setLayoutData(data);
  fNumberOfSubBuffersText.setLayoutData(data);
  fSwitchTimerText.setLayoutData(data);
  fReadTimerText.setLayoutData(data);
  if (fTargetNodeComponent.isTraceFileRotationSupported()) {
    fMaxNumberTraceText.setLayoutData(data);
    fMaxSizeTraceText.setLayoutData(data);
  }
  setDefaults();
  return dialogComposite;
}