Program: 67667
Project: 67667
Buggy source:
/** 
 */
private void createDropDownComponent(int iXLoc,int iYLoc){
  if (!bEnabled) {
    return;
  }
  int iShellHeight=170;
  int iShellWidth=190;
  if (bGradientEnabled) {
    iShellHeight+=30;
  }
  if (bImageEnabled) {
    iShellHeight+=30;
  }
  if (bAutoEnabled) {
    iShellHeight+=30;
  }
  if (bTransparentEnabled) {
    iShellHeight+=30;
  }
  if (bPositiveNegativeEnabled) {
    iShellHeight+=30;
  }
  if (bPatternFillEnabled) {
    iShellHeight+=30;
  }
  Shell shell=new Shell(this.getShell(),SWT.NO_FOCUS);
  shell.setLayout(new FillLayout());
  shell.setSize(iShellWidth,iShellHeight);
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=iShellWidth;
  }
  shell.setLocation(iXLoc,iYLoc);
  shell.addShellListener(new ShellAdapter(){
    public void shellClosed(    ShellEvent e){
      clearColorSelection();
    }
  }
);
  cmpDropDown=new Composite(shell,SWT.NO_FOCUS);
  GridLayout glDropDown=new GridLayout();
  glDropDown.marginHeight=2;
  glDropDown.marginWidth=2;
  glDropDown.horizontalSpacing=1;
  glDropDown.verticalSpacing=4;
  cmpDropDown.setLayout(glDropDown);
  if (colorArray == null) {
    colorArray=createColorMap(getDisplay());
  }
  ColorSelectionCanvas cnv=new ColorSelectionCanvas(cmpDropDown,SWT.BORDER,colorArray);
  GridData gdCnv=new GridData(GridData.FILL_BOTH);
  gdCnv.widthHint=190;
  gdCnv.heightHint=110;
  cnv.setLayoutData(gdCnv);
  cnv.addListener(SWT.Traverse,this);
  cnv.addListener(SWT.FocusOut,this);
  if (this.fCurrent instanceof ColorDefinition) {
    cnv.setColor(new Color(this.getDisplay(),((ColorDefinition)fCurrent).getRed(),((ColorDefinition)fCurrent).getGreen(),((ColorDefinition)fCurrent).getBlue()));
  }
  cmpButtons=new Composite(cmpDropDown,SWT.NO_FOCUS);
  GridLayout glButtons=new GridLayout();
  glButtons.marginHeight=3;
  glButtons.marginWidth=4;
  glButtons.horizontalSpacing=1;
  glButtons.verticalSpacing=4;
  glButtons.numColumns=2;
  cmpButtons.setLayout(glButtons);
  GridData gdButtons=new GridData(GridData.FILL_HORIZONTAL);
  cmpButtons.setLayoutData(gdButtons);
  GridLayout glTransparency=new GridLayout();
  glTransparency.numColumns=1;
  glTransparency.horizontalSpacing=5;
  glTransparency.verticalSpacing=3;
  glTransparency.marginHeight=4;
  glTransparency.marginWidth=0;
  Composite cmpTransparency=new Composite(cmpButtons,SWT.NONE | SWT.NO_FOCUS);
  GridData gdTransparency=new GridData(GridData.FILL_BOTH);
  gdTransparency.horizontalSpan=2;
  cmpTransparency.setLayoutData(gdTransparency);
  cmpTransparency.setLayout(glTransparency);
  if (bTransparencySliderEnable) {
    lblTransparency=new Label(cmpTransparency,SWT.NONE);
    GridData gdLBLTransparency=new GridData(GridData.FILL_HORIZONTAL);
    gdLBLTransparency.horizontalIndent=2;
    lblTransparency.setLayoutData(gdLBLTransparency);
    lblTransparency.setText(Messages.getString("String_Node_Str"));
    srTransparency=new Slider(cmpTransparency,SWT.HORIZONTAL | SWT.NO_FOCUS);
    GridData gdTransparent=new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
    gdTransparent.horizontalSpan=2;
    srTransparency.setLayoutData(gdTransparent);
    if (fCurrent == null) {
      srTransparency.setValues(0,0,256,1,1,10);
      srTransparency.setEnabled(false);
    }
 else {
      int iValue=0;
      if (fCurrent instanceof ColorDefinition) {
        iValue=((ColorDefinition)fCurrent).getTransparency();
        srTransparency.setValues(iValue,0,256,1,1,10);
      }
 else       if (fCurrent instanceof Gradient) {
        iValue=((Gradient)fCurrent).getTransparency();
        srTransparency.setValues(iValue,0,256,1,1,10);
      }
 else {
        srTransparency.setEnabled(false);
      }
    }
    lblTransparency.setText(new MessageFormat(Messages.getString("String_Node_Str")).format(new Object[]{Integer.valueOf(srTransparency.getSelection())}));
    srTransparency.setToolTipText(String.valueOf(srTransparency.getSelection()));
    srTransparency.addSelectionListener(this);
    srTransparency.addListener(SWT.FocusOut,this);
    srTransparency.addListener(SWT.KeyDown,this);
    srTransparency.addListener(SWT.Traverse,this);
  }
  final int BUTTON_HEIGHTHINT=28;
  if (this.bTransparentEnabled) {
    btnReset=new Button(cmpButtons,SWT.NONE);
    GridData gdReset=new GridData(GridData.FILL_BOTH);
    gdReset.heightHint=BUTTON_HEIGHTHINT;
    gdReset.horizontalSpan=2;
    btnReset.setLayoutData(gdReset);
    btnReset.setText(Messages.getString("String_Node_Str"));
    btnReset.addSelectionListener(this);
    btnReset.addListener(SWT.FocusOut,this);
    btnReset.addListener(SWT.KeyDown,this);
    btnReset.addListener(SWT.Traverse,this);
  }
  if (this.bAutoEnabled) {
    btnAuto=new Button(cmpButtons,SWT.NONE);
    GridData gdGradient=new GridData(GridData.FILL_BOTH);
    gdGradient.heightHint=BUTTON_HEIGHTHINT;
    gdGradient.horizontalSpan=2;
    btnAuto.setLayoutData(gdGradient);
    btnAuto.setText(Messages.getString("String_Node_Str"));
    btnAuto.addSelectionListener(this);
    btnAuto.addListener(SWT.FocusOut,this);
    btnAuto.addListener(SWT.KeyDown,this);
    btnAuto.addListener(SWT.Traverse,this);
  }
  if (this.bGradientEnabled) {
    btnGradient=new Button(cmpButtons,SWT.NONE);
    GridData gdGradient=new GridData(GridData.FILL_BOTH);
    gdGradient.heightHint=BUTTON_HEIGHTHINT;
    gdGradient.horizontalSpan=2;
    btnGradient.setLayoutData(gdGradient);
    btnGradient.setText(Messages.getString("String_Node_Str"));
    btnGradient.addSelectionListener(this);
    btnGradient.addListener(SWT.FocusOut,this);
    btnGradient.addListener(SWT.KeyDown,this);
    btnGradient.addListener(SWT.Traverse,this);
  }
  btnCustom=new Button(cmpButtons,SWT.NONE);
  GridData gdCustom=new GridData(GridData.FILL_BOTH);
  gdCustom.heightHint=BUTTON_HEIGHTHINT;
  gdCustom.horizontalSpan=2;
  btnCustom.setLayoutData(gdCustom);
  btnCustom.setText(Messages.getString("String_Node_Str"));
  btnCustom.addSelectionListener(this);
  btnCustom.addListener(SWT.FocusOut,this);
  btnCustom.addListener(SWT.KeyDown,this);
  btnCustom.addListener(SWT.Traverse,this);
  if (this.bImageEnabled) {
    btnImage=new Button(cmpButtons,SWT.NONE);
    GridData gdImage=new GridData(GridData.FILL_BOTH);
    gdImage.heightHint=BUTTON_HEIGHTHINT;
    gdImage.horizontalSpan=2;
    btnImage.setLayoutData(gdImage);
    btnImage.setText(Messages.getString("String_Node_Str"));
    btnImage.addSelectionListener(this);
    btnImage.addListener(SWT.FocusOut,this);
    btnImage.addListener(SWT.KeyDown,this);
    btnImage.addListener(SWT.Traverse,this);
  }
  if (this.bPositiveNegativeEnabled) {
    btnPN=new Button(cmpButtons,SWT.NONE);
    GridData gdPN=new GridData(GridData.FILL_BOTH);
    gdPN.heightHint=BUTTON_HEIGHTHINT;
    gdPN.horizontalSpan=2;
    btnPN.setLayoutData(gdPN);
    btnPN.setText(Messages.getString("String_Node_Str"));
    btnPN.addSelectionListener(this);
    btnPN.addListener(SWT.FocusOut,this);
    btnPN.addListener(SWT.KeyDown,this);
    btnPN.addListener(SWT.Traverse,this);
  }
  if (bPatternFillEnabled) {
    btnPatternFill=new Button(cmpButtons,SWT.NONE);
    GridData gd=new GridData(GridData.FILL_BOTH);
    gd.heightHint=BUTTON_HEIGHTHINT;
    gd.horizontalSpan=2;
    btnPatternFill.setLayoutData(gd);
    btnPatternFill.setText(Messages.getString("String_Node_Str"));
    btnPatternFill.addSelectionListener(this);
    btnPatternFill.addListener(SWT.FocusOut,this);
    btnPatternFill.addListener(SWT.KeyDown,this);
    btnPatternFill.addListener(SWT.Traverse,this);
  }
  shell.pack();
  shell.layout();
  shell.open();
}

Fixed version (ground truth):
/** 
 */
private void createDropDownComponent(int iXLoc,int iYLoc){
  if (!bEnabled) {
    return;
  }
  int iShellHeight=170;
  int iShellWidth=190;
  if (bGradientEnabled) {
    iShellHeight+=30;
  }
  if (bImageEnabled) {
    iShellHeight+=30;
  }
  if (bAutoEnabled) {
    iShellHeight+=30;
  }
  if (bTransparentEnabled) {
    iShellHeight+=30;
  }
  if (bPositiveNegativeEnabled) {
    iShellHeight+=30;
  }
  if (bPatternFillEnabled) {
    iShellHeight+=30;
  }
  Shell shell=new Shell(this.getShell(),SWT.NO_FOCUS);
  shell.setLayout(new FillLayout());
  shell.setSize(iShellWidth,iShellHeight);
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=iShellWidth;
  }
  shell.setLocation(iXLoc,iYLoc);
  shell.addShellListener(new ShellAdapter(){
    @Override public void shellClosed(    ShellEvent e){
      clearColorSelection();
    }
  }
);
  cmpDropDown=new Composite(shell,SWT.NO_FOCUS);
  GridLayout glDropDown=new GridLayout();
  glDropDown.marginHeight=2;
  glDropDown.marginWidth=2;
  glDropDown.horizontalSpacing=1;
  glDropDown.verticalSpacing=4;
  cmpDropDown.setLayout(glDropDown);
  if (colorArray == null) {
    colorArray=createColorMap(getDisplay());
  }
  ColorSelectionCanvas cnv=new ColorSelectionCanvas(cmpDropDown,SWT.BORDER,colorArray);
  GridData gdCnv=new GridData(GridData.FILL_BOTH);
  gdCnv.widthHint=190;
  gdCnv.heightHint=110;
  cnv.setLayoutData(gdCnv);
  cnv.addListener(SWT.Traverse,this);
  cnv.addListener(SWT.FocusOut,this);
  if (this.fCurrent instanceof ColorDefinition) {
    cnv.setColor(new Color(this.getDisplay(),((ColorDefinition)fCurrent).getRed(),((ColorDefinition)fCurrent).getGreen(),((ColorDefinition)fCurrent).getBlue()));
  }
  cmpButtons=new Composite(cmpDropDown,SWT.NO_FOCUS);
  GridLayout glButtons=new GridLayout();
  glButtons.marginHeight=3;
  glButtons.marginWidth=4;
  glButtons.horizontalSpacing=1;
  glButtons.verticalSpacing=4;
  glButtons.numColumns=2;
  cmpButtons.setLayout(glButtons);
  GridData gdButtons=new GridData(GridData.FILL_HORIZONTAL);
  cmpButtons.setLayoutData(gdButtons);
  GridLayout glTransparency=new GridLayout();
  glTransparency.numColumns=1;
  glTransparency.horizontalSpacing=5;
  glTransparency.verticalSpacing=3;
  glTransparency.marginHeight=4;
  glTransparency.marginWidth=0;
  Composite cmpTransparency=new Composite(cmpButtons,SWT.NONE | SWT.NO_FOCUS);
  GridData gdTransparency=new GridData(GridData.FILL_BOTH);
  gdTransparency.horizontalSpan=2;
  cmpTransparency.setLayoutData(gdTransparency);
  cmpTransparency.setLayout(glTransparency);
  if (bTransparencySliderEnable) {
    lblTransparency=new Label(cmpTransparency,SWT.NONE);
    GridData gdLBLTransparency=new GridData(GridData.FILL_HORIZONTAL);
    gdLBLTransparency.horizontalIndent=2;
    lblTransparency.setLayoutData(gdLBLTransparency);
    lblTransparency.setText(Messages.getString("String_Node_Str"));
    srTransparency=new Slider(cmpTransparency,SWT.HORIZONTAL | SWT.NO_FOCUS);
    GridData gdTransparent=new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
    gdTransparent.horizontalSpan=2;
    srTransparency.setLayoutData(gdTransparent);
    if (fCurrent == null) {
      srTransparency.setValues(0,0,256,1,1,10);
      srTransparency.setEnabled(false);
    }
 else {
      int iValue=0;
      if (fCurrent instanceof ColorDefinition) {
        iValue=((ColorDefinition)fCurrent).getTransparency();
        srTransparency.setValues(iValue,0,256,1,1,10);
      }
 else       if (fCurrent instanceof Gradient) {
        iValue=((Gradient)fCurrent).getTransparency();
        srTransparency.setValues(iValue,0,256,1,1,10);
      }
 else {
        srTransparency.setEnabled(false);
      }
    }
    lblTransparency.setText(new MessageFormat(Messages.getString("String_Node_Str")).format(new Object[]{Integer.valueOf(srTransparency.getSelection())}));
    srTransparency.setToolTipText(String.valueOf(srTransparency.getSelection()));
    srTransparency.addSelectionListener(this);
    srTransparency.addListener(SWT.FocusOut,this);
    srTransparency.addListener(SWT.KeyDown,this);
    srTransparency.addListener(SWT.Traverse,this);
  }
  final int BUTTON_HEIGHTHINT=28;
  if (this.bTransparentEnabled) {
    btnReset=new Button(cmpButtons,SWT.NONE);
    GridData gdReset=new GridData(GridData.FILL_BOTH);
    gdReset.heightHint=BUTTON_HEIGHTHINT;
    gdReset.horizontalSpan=2;
    btnReset.setLayoutData(gdReset);
    btnReset.setText(Messages.getString("String_Node_Str"));
    btnReset.addSelectionListener(this);
    btnReset.addListener(SWT.FocusOut,this);
    btnReset.addListener(SWT.KeyDown,this);
    btnReset.addListener(SWT.Traverse,this);
  }
  if (this.bAutoEnabled) {
    btnAuto=new Button(cmpButtons,SWT.NONE);
    GridData gdGradient=new GridData(GridData.FILL_BOTH);
    gdGradient.heightHint=BUTTON_HEIGHTHINT;
    gdGradient.horizontalSpan=2;
    btnAuto.setLayoutData(gdGradient);
    btnAuto.setText(Messages.getString("String_Node_Str"));
    btnAuto.addSelectionListener(this);
    btnAuto.addListener(SWT.FocusOut,this);
    btnAuto.addListener(SWT.KeyDown,this);
    btnAuto.addListener(SWT.Traverse,this);
  }
  if (this.bGradientEnabled) {
    btnGradient=new Button(cmpButtons,SWT.NONE);
    GridData gdGradient=new GridData(GridData.FILL_BOTH);
    gdGradient.heightHint=BUTTON_HEIGHTHINT;
    gdGradient.horizontalSpan=2;
    btnGradient.setLayoutData(gdGradient);
    btnGradient.setText(Messages.getString("String_Node_Str"));
    btnGradient.addSelectionListener(this);
    btnGradient.addListener(SWT.FocusOut,this);
    btnGradient.addListener(SWT.KeyDown,this);
    btnGradient.addListener(SWT.Traverse,this);
  }
  btnCustom=new Button(cmpButtons,SWT.NONE);
  GridData gdCustom=new GridData(GridData.FILL_BOTH);
  gdCustom.heightHint=BUTTON_HEIGHTHINT;
  gdCustom.horizontalSpan=2;
  btnCustom.setLayoutData(gdCustom);
  btnCustom.setText(Messages.getString("String_Node_Str"));
  btnCustom.addSelectionListener(this);
  btnCustom.addListener(SWT.FocusOut,this);
  btnCustom.addListener(SWT.KeyDown,this);
  btnCustom.addListener(SWT.Traverse,this);
  if (this.bImageEnabled) {
    btnImage=new Button(cmpButtons,SWT.NONE);
    GridData gdImage=new GridData(GridData.FILL_BOTH);
    gdImage.heightHint=BUTTON_HEIGHTHINT;
    gdImage.horizontalSpan=2;
    btnImage.setLayoutData(gdImage);
    btnImage.setText(Messages.getString("String_Node_Str"));
    btnImage.addSelectionListener(this);
    btnImage.addListener(SWT.FocusOut,this);
    btnImage.addListener(SWT.KeyDown,this);
    btnImage.addListener(SWT.Traverse,this);
  }
  if (this.bPositiveNegativeEnabled) {
    btnPN=new Button(cmpButtons,SWT.NONE);
    GridData gdPN=new GridData(GridData.FILL_BOTH);
    gdPN.heightHint=BUTTON_HEIGHTHINT;
    gdPN.horizontalSpan=2;
    btnPN.setLayoutData(gdPN);
    btnPN.setText(Messages.getString("String_Node_Str"));
    btnPN.addSelectionListener(this);
    btnPN.addListener(SWT.FocusOut,this);
    btnPN.addListener(SWT.KeyDown,this);
    btnPN.addListener(SWT.Traverse,this);
  }
  if (bPatternFillEnabled) {
    btnPatternFill=new Button(cmpButtons,SWT.NONE);
    GridData gd=new GridData(GridData.FILL_BOTH);
    gd.heightHint=BUTTON_HEIGHTHINT;
    gd.horizontalSpan=2;
    btnPatternFill.setLayoutData(gd);
    btnPatternFill.setText(Messages.getString("String_Node_Str"));
    btnPatternFill.addSelectionListener(this);
    btnPatternFill.addListener(SWT.FocusOut,this);
    btnPatternFill.addListener(SWT.KeyDown,this);
    btnPatternFill.addListener(SWT.Traverse,this);
  }
  shell.pack();
  shell.layout();
  shell.open();
}