Program: 74970
Project: 74970
Buggy source:
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drawed
 */
protected void drawContainer(IContainerArea container){
  IStyle style=container.getStyle();
  if (null == style) {
    return;
  }
  ContainerPosition curPos=getContainerPosition();
  if (container.getContent() != null) {
    int layoutX=curPos.x + getX(container);
    int layoutY=curPos.y + getY(container);
    int startX=layoutX;
    int startY=layoutY;
    int width=getWidth(container);
    int height=getHeight(container);
    Color bc=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BACKGROUND_COLOR));
    pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
    drawBackgroundImage(style,startX,startY,width,height);
    int borderTopWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_TOP_WIDTH));
    int borderLeftWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_LEFT_WIDTH));
    int borderBottomWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_WIDTH));
    int borderRightWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_WIDTH));
    if (borderTopWidth > 0 || borderLeftWidth > 0 || borderBottomWidth > 0 || borderRightWidth > 0) {
      Color borderTopColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_TOP_COLOR));
      Color borderRightColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_COLOR));
      Color borderBottomColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_COLOR));
      Color borderLeftColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_LEFT_COLOR));
      BorderInfo[] borders=new BorderInfo[4];
      borders[BorderInfo.TOP_BORDER]=new BorderInfo(layoutX,layoutY + borderTopWidth / 2,layoutX + getWidth(container),layoutY + borderTopWidth / 2,borderTopWidth,borderTopColor,style.getProperty(StyleConstants.STYLE_BORDER_TOP_STYLE),BorderInfo.TOP_BORDER);
      borders[BorderInfo.RIGHT_BORDER]=new BorderInfo(layoutX + getWidth(container) - borderRightWidth / 2,layoutY,layoutX + getWidth(container) - borderRightWidth / 2,layoutY + getHeight(container),borderRightWidth,borderRightColor,style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_STYLE),BorderInfo.RIGHT_BORDER);
      borders[BorderInfo.BOTTOM_BORDER]=new BorderInfo(layoutX,layoutY + getHeight(container) - borderBottomWidth / 2,layoutX + getWidth(container),layoutY + getHeight(container) - borderBottomWidth / 2,borderBottomWidth,borderBottomColor,style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_STYLE),BorderInfo.BOTTOM_BORDER);
      borders[BorderInfo.LEFT_BORDER]=new BorderInfo(layoutX + borderLeftWidth / 2,layoutY,layoutX + borderLeftWidth / 2,layoutY + getHeight(container),borderLeftWidth,borderLeftColor,style.getProperty(StyleConstants.STYLE_BORDER_LEFT_STYLE),BorderInfo.LEFT_BORDER);
      drawBorder(borders);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draws a container's border, and its background color/image if there is any.
 * @param container the containerArea whose border and background need to be drawed
 */
protected void drawContainer(IContainerArea container){
  IStyle style=container.getStyle();
  if (null == style) {
    return;
  }
  ContainerPosition curPos=getContainerPosition();
  if (container.getContent() != null) {
    int layoutX=curPos.x + getX(container);
    int layoutY=curPos.y + getY(container);
    int startX=layoutX;
    int startY=layoutY;
    int width=getWidth(container);
    int height=getHeight(container);
    Color bc=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BACKGROUND_COLOR));
    pageGraphic.drawBackgroundColor(bc,startX,startY,width,height);
    drawBackgroundImage(style,startX,startY,width,height);
    int borderTopWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_TOP_WIDTH));
    int borderLeftWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_LEFT_WIDTH));
    int borderBottomWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_WIDTH));
    int borderRightWidth=getScaledValue(style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_WIDTH));
    if (borderTopWidth > 0 || borderLeftWidth > 0 || borderBottomWidth > 0 || borderRightWidth > 0) {
      Color borderTopColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_TOP_COLOR));
      Color borderRightColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_COLOR));
      Color borderBottomColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_COLOR));
      Color borderLeftColor=PropertyUtil.getColor(style.getProperty(StyleConstants.STYLE_BORDER_LEFT_COLOR));
      BorderInfo[] borders=new BorderInfo[4];
      borders[BorderInfo.TOP_BORDER]=new BorderInfo(layoutX + borderLeftWidth / 2,layoutY + borderTopWidth / 2,layoutX + getWidth(container) - borderRightWidth / 2,layoutY + borderTopWidth / 2,borderTopWidth,borderTopColor,style.getProperty(StyleConstants.STYLE_BORDER_TOP_STYLE),BorderInfo.TOP_BORDER);
      borders[BorderInfo.RIGHT_BORDER]=new BorderInfo(layoutX + getWidth(container) - borderRightWidth / 2,layoutY + borderTopWidth / 2,layoutX + getWidth(container) - borderRightWidth / 2,layoutY + getHeight(container) - borderBottomWidth / 2,borderRightWidth,borderRightColor,style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_STYLE),BorderInfo.RIGHT_BORDER);
      borders[BorderInfo.BOTTOM_BORDER]=new BorderInfo(layoutX + borderLeftWidth / 2,layoutY + getHeight(container) - borderBottomWidth / 2,layoutX + getWidth(container) - borderRightWidth / 2,layoutY + getHeight(container) - borderBottomWidth / 2,borderBottomWidth,borderBottomColor,style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_STYLE),BorderInfo.BOTTOM_BORDER);
      borders[BorderInfo.LEFT_BORDER]=new BorderInfo(layoutX + borderLeftWidth / 2,layoutY + borderTopWidth / 2,layoutX + borderLeftWidth / 2,layoutY + getHeight(container) - borderBottomWidth / 2,borderLeftWidth,borderLeftColor,style.getProperty(StyleConstants.STYLE_BORDER_LEFT_STYLE),BorderInfo.LEFT_BORDER);
      drawBorder(borders);
    }
  }
}