Program: 104305
Project: 104305
Buggy source:
/** 
 * Overrides the <code>paintComponent</code> method of <tt>JButton</tt> to paint the button background and icon, and all additional effects of this configururable button.
 * @param g The Graphics object.
 */
public void paintComponent(Graphics g){
  AntialiasingManager.activateAntialiasing(g);
  if (this.bgImage != null) {
    if (this.iconImage == null && !isEnabled()) {
      Image disabledImage=new ImageIcon(LightGrayFilter.createDisabledImage(bgImage)).getImage();
      g.drawImage(disabledImage,0,0,this);
    }
 else {
      g.drawImage(this.bgImage,0,0,this);
    }
  }
  if (this.iconImage != null) {
    if (!isEnabled()) {
      Image disabledImage=new ImageIcon(LightGrayFilter.createDisabledImage(iconImage)).getImage();
      if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
        g.drawImage(disabledImage,(this.bgImage.getWidth(null) - disabledImage.getWidth(null)) / 2,(this.bgImage.getHeight(null) - disabledImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(disabledImage,7,(this.bgImage.getHeight(null) - disabledImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(disabledImage,this.bgImage.getWidth(null) - 3,(this.bgImage.getHeight(null) - disabledImage.getHeight(null)) / 2,this);
      }
    }
 else {
      if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,(this.bgImage.getWidth(null) - this.iconImage.getWidth(null)) / 2,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,7,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,this.bgImage.getWidth(null) - 3,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
    }
  }
  if (this.bgRolloverImage != null && this.getModel().isRollover()) {
    g.drawImage(this.bgRolloverImage,0,0,this);
    if (this.iconImage != null) {
      if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,(this.bgImage.getWidth(null) - this.iconImage.getWidth(null)) / 2,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,7,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,this.bgImage.getWidth(null) - 3,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
    }
  }
  if (this.getModel().isPressed()) {
    if (this.pressedImage != null) {
      g.drawImage(this.pressedImage,0,0,this);
    }
 else {
      g.drawImage(this.bgRolloverImage,0,0,this);
      if (this.iconImage != null) {
        if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
          g.drawImage(this.iconImage,(this.bgImage.getWidth(null) - this.iconImage.getWidth(null)) / 2 + 1,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2 + 1,this);
        }
 else         if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
          g.drawImage(this.iconImage,7 + 1,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2 + 1,this);
        }
 else         if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
          g.drawImage(this.iconImage,this.bgImage.getWidth(null) - 3 + 1,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2 + 1,this);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Overrides the <code>paintComponent</code> method of <tt>JButton</tt> to paint the button background and icon, and all additional effects of this configururable button.
 * @param g The Graphics object.
 */
public void paintComponent(Graphics g){
  AntialiasingManager.activateAntialiasing(g);
  if (isOpaque()) {
    g.setColor(getBackground());
    g.fillRect(0,0,getWidth(),getHeight());
  }
  if (this.bgImage != null) {
    if (this.iconImage == null && !isEnabled()) {
      Image disabledImage=new ImageIcon(LightGrayFilter.createDisabledImage(bgImage)).getImage();
      g.drawImage(disabledImage,0,0,this);
    }
 else {
      g.drawImage(this.bgImage,0,0,this);
    }
  }
  if (this.iconImage != null) {
    if (!isEnabled()) {
      Image disabledImage=new ImageIcon(LightGrayFilter.createDisabledImage(iconImage)).getImage();
      if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
        g.drawImage(disabledImage,(this.bgImage.getWidth(null) - disabledImage.getWidth(null)) / 2,(this.bgImage.getHeight(null) - disabledImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(disabledImage,7,(this.bgImage.getHeight(null) - disabledImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(disabledImage,this.bgImage.getWidth(null) - 3,(this.bgImage.getHeight(null) - disabledImage.getHeight(null)) / 2,this);
      }
    }
 else {
      if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,(this.bgImage.getWidth(null) - this.iconImage.getWidth(null)) / 2,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,7,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,this.bgImage.getWidth(null) - 3,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
    }
  }
  if (this.bgRolloverImage != null && this.getModel().isRollover()) {
    g.drawImage(this.bgRolloverImage,0,0,this);
    if (this.iconImage != null) {
      if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,(this.bgImage.getWidth(null) - this.iconImage.getWidth(null)) / 2,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,7,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
 else       if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
        g.drawImage(this.iconImage,this.bgImage.getWidth(null) - 3,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2,this);
      }
    }
  }
  if (this.getModel().isPressed()) {
    if (this.pressedImage != null) {
      g.drawImage(this.pressedImage,0,0,this);
    }
 else {
      g.drawImage(this.bgRolloverImage,0,0,this);
      if (this.iconImage != null) {
        if (this.iconLayout.equals(SIPCommButton.CENTER_ICON_LAYOUT)) {
          g.drawImage(this.iconImage,(this.bgImage.getWidth(null) - this.iconImage.getWidth(null)) / 2 + 1,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2 + 1,this);
        }
 else         if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
          g.drawImage(this.iconImage,7 + 1,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2 + 1,this);
        }
 else         if (this.iconLayout.equals(SIPCommButton.LEFT_ICON_LAYOUT)) {
          g.drawImage(this.iconImage,this.bgImage.getWidth(null) - 3 + 1,(this.bgImage.getHeight(null) - this.iconImage.getHeight(null)) / 2 + 1,this);
        }
      }
    }
  }
}