Program: 3864
Project: 3864
Buggy source:
@Override public void paint(Graphics2D g,Object object,int width,int height){
  Shape mainPanelShape=getShape();
  Area panelArea=new Area(mainPanelShape);
  Point bottomLocation=SwingUtilities.convertPoint(mainPanel,bottomPanel.getLocation(),LibrarySharePanel.this);
  Area bottomArea=new Area(new Rectangle2D.Float(0,bottomLocation.y,getWidth(),1000));
  bottomArea.intersect(panelArea);
  Graphics2D g2=(Graphics2D)g.create();
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  g2.setRenderingHint(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_SPEED);
  g2.setColor(Color.WHITE);
  g2.fill(panelArea);
  if (bottomPanel.isVisible()) {
    bottomGradient=new GradientPaint(0,bottomLocation.y,bottomPanelTopGradient,0,bottomLocation.y + bottomPanel.getHeight(),bottomPanelBottomGradient);
    g2.setPaint(bottomGradient);
    g2.fill(bottomArea);
    g2.setColor(dividerColor);
    Rectangle panelBounds=mainPanelShape.getBounds();
    g2.drawLine(panelBounds.x,bottomLocation.y,panelBounds.x + panelBounds.width,bottomLocation.y);
  }
  if (signInPanel.isVisible()) {
    g2.setColor(dividerColor);
    Rectangle panelBounds=mainPanelShape.getBounds();
    Point signInLocation=SwingUtilities.convertPoint(mainPanel,signInPanel.getLocation(),LibrarySharePanel.this);
    g2.drawLine(panelBounds.x,signInLocation.y,panelBounds.x + panelBounds.width,signInLocation.y);
  }
  g2.setColor(borderColor);
  g2.setStroke(new BasicStroke(2));
  g2.draw(mainPanelShape);
  g2.setStroke(new BasicStroke(1));
  g2.draw(mainPanelShape);
  g2.translate(1,1);
  g2.draw(mainPanelShape);
  g2.dispose();
}

Fixed version (ground truth):
@Override public void paint(Graphics2D g,Object object,int width,int height){
  Shape mainPanelShape=getShape();
  Area panelArea=new Area(mainPanelShape);
  Point bottomLocation=SwingUtilities.convertPoint(mainPanel,bottomPanel.getLocation(),LibrarySharePanel.this);
  Area bottomArea=new Area(new Rectangle2D.Float(0,bottomLocation.y,getWidth(),1000));
  bottomArea.intersect(panelArea);
  Graphics2D g2=(Graphics2D)g.create();
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  g2.setRenderingHint(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_SPEED);
  g2.setColor(Color.WHITE);
  g2.fill(panelArea);
  if (bottomPanel.isVisible()) {
    bottomGradient=new GradientPaint(0,bottomLocation.y,bottomPanelTopGradient,0,bottomLocation.y + bottomPanel.getHeight(),bottomPanelBottomGradient);
    g2.setPaint(bottomGradient);
    g2.fill(bottomArea);
    g2.setColor(dividerColor);
    Rectangle panelBounds=mainPanelShape.getBounds();
    g2.drawLine(panelBounds.x,bottomLocation.y,panelBounds.x + panelBounds.width,bottomLocation.y);
  }
  if (signInPanel.isVisible()) {
    g2.setColor(dividerColor);
    Rectangle panelBounds=mainPanelShape.getBounds();
    Point signInLocation=SwingUtilities.convertPoint(mainPanel,signInPanel.getLocation(),LibrarySharePanel.this);
    g2.drawLine(panelBounds.x,signInLocation.y,panelBounds.x + panelBounds.width,signInLocation.y);
  }
  g2.setColor(borderColor);
  g2.setStroke(new BasicStroke(2));
  Shape originalClip=g2.getClip();
  g2.setClip(originalClip.getBounds().x,originalClip.getBounds().y,10,10);
  g2.draw(mainPanelShape);
  g2.setClip(originalClip);
  g2.setStroke(new BasicStroke(1));
  g2.draw(mainPanelShape);
  g2.translate(1,1);
  g2.draw(mainPanelShape);
  g2.dispose();
}