Program: 60218
Project: 60218
Buggy source:
public BorderInfo getBorderInfo(){
  BorderInfo binfo=this.borderInfo;
  if (binfo != INVALID_BORDER_INFO) {
    return binfo;
  }
  binfo=super.getBorderInfo();
  if (binfo == null || (binfo.topStyle == HtmlValues.BORDER_STYLE_NONE && binfo.bottomStyle == HtmlValues.BORDER_STYLE_NONE && binfo.leftStyle == HtmlValues.BORDER_STYLE_NONE && binfo.rightStyle == HtmlValues.BORDER_STYLE_NONE)) {
    if (binfo == null) {
      binfo=new BorderInfo();
    }
    HTMLElementImpl element=this.element;
    if (element != null) {
      String border=element.getAttribute(HtmlAttributeProperties.FRAMEBORDER);
      if (border != null) {
        border=border.trim();
      }
      int value;
      if (border != null) {
        try {
          value=Integer.parseInt(border);
        }
 catch (        NumberFormatException nfe) {
          value=0;
        }
      }
 else {
        value=1;
      }
      HtmlInsets borderInsets=new HtmlInsets();
      borderInsets.top=borderInsets.left=borderInsets.right=borderInsets.bottom=(value != 0 ? 1 : 0);
      borderInsets.topType=borderInsets.leftType=borderInsets.rightType=borderInsets.bottomType=HtmlInsets.TYPE_PIXELS;
      binfo.insets=borderInsets;
      if (binfo.topColor == null) {
        binfo.topColor=Color.DARK_GRAY;
      }
      if (binfo.leftColor == null) {
        binfo.leftColor=Color.DARK_GRAY;
      }
      if (binfo.rightColor == null) {
        binfo.rightColor=Color.LIGHT_GRAY;
      }
      if (binfo.bottomColor == null) {
        binfo.bottomColor=Color.LIGHT_GRAY;
      }
      if (value != 0) {
        binfo.topStyle=binfo.leftStyle=binfo.rightStyle=binfo.bottomStyle=HtmlValues.BORDER_STYLE_SOLID;
      }
    }
  }
  this.borderInfo=binfo;
  return binfo;
}

Fixed version (ground truth):
public BorderInfo getBorderInfo(){
  BorderInfo binfo=this.borderInfo;
  if (binfo != INVALID_BORDER_INFO) {
    return binfo;
  }
  binfo=super.getBorderInfo();
  if (binfo == null || (binfo.getTopStyle() == HtmlValues.BORDER_STYLE_NONE && binfo.getBottomStyle() == HtmlValues.BORDER_STYLE_NONE && binfo.getLeftStyle() == HtmlValues.BORDER_STYLE_NONE && binfo.getRightStyle() == HtmlValues.BORDER_STYLE_NONE)) {
    if (binfo == null) {
      binfo=new BorderInfo();
    }
    HTMLElementImpl element=this.element;
    if (element != null) {
      String border=element.getAttribute(HtmlAttributeProperties.FRAMEBORDER);
      if (border != null) {
        border=border.trim();
      }
      int value;
      if (border != null) {
        try {
          value=Integer.parseInt(border);
        }
 catch (        NumberFormatException nfe) {
          value=0;
        }
      }
 else {
        value=1;
      }
      HtmlInsets borderInsets=new HtmlInsets();
      borderInsets.top=borderInsets.left=borderInsets.right=borderInsets.bottom=(value != 0 ? 1 : 0);
      borderInsets.topType=borderInsets.leftType=borderInsets.rightType=borderInsets.bottomType=HtmlInsets.TYPE_PIXELS;
      binfo.setInsets(borderInsets);
      if (binfo.getTopColor() == null) {
        binfo.setTopColor(Color.DARK_GRAY);
      }
      if (binfo.getLeftColor() == null) {
        binfo.setLeftColor(Color.DARK_GRAY);
      }
      if (binfo.getRightColor() == null) {
        binfo.setRightColor(Color.LIGHT_GRAY);
      }
      if (binfo.getBottomColor() == null) {
        binfo.setBottomColor(Color.LIGHT_GRAY);
      }
      if (value != 0) {
        binfo.setTopStyle(HtmlValues.BORDER_STYLE_SOLID);
        binfo.setLeftStyle(HtmlValues.BORDER_STYLE_SOLID);
        binfo.setRightStyle(HtmlValues.BORDER_STYLE_SOLID);
        binfo.setBottomStyle(HtmlValues.BORDER_STYLE_SOLID);
      }
    }
  }
  this.borderInfo=binfo;
  return binfo;
}