Program: 69178
Project: 69178
Buggy source:
public IStyle getStyle(Chart model,StyledComponent name){
  SimpleStyle ss=null;
  if (cache == null || !useCache) {
    StyleHandle style=handle.getPrivateStyle();
    ss=new SimpleStyle();
    String fname=style.getFontFamilyHandle().getStringValue();
    int fsize=getFontSizeIntValue(handle);
    boolean fbold=getFontWeight(style.getFontWeight()) >= 700;
    boolean fitalic=DesignChoiceConstants.FONT_STYLE_ITALIC.equals(style.getFontStyle());
    boolean funder=DesignChoiceConstants.TEXT_UNDERLINE_UNDERLINE.equals(style.getTextUnderline());
    boolean fstrike=DesignChoiceConstants.TEXT_LINE_THROUGH_LINE_THROUGH.equals(style.getTextLineThrough());
    if (dstyle != null) {
      CSSValueList valueList=(CSSValueList)dstyle.getProperty(StyleConstants.STYLE_FONT_FAMILY);
      if (valueList.getLength() > 0) {
        fname=valueList.item(0).getCssText();
      }
      fsize=getSize(dstyle.getProperty(StyleConstants.STYLE_FONT_SIZE));
      fbold=isBoldFont(dstyle.getProperty(StyleConstants.STYLE_FONT_WEIGHT));
      fitalic=isItalicFont(dstyle.getFontStyle());
      funder=CSSConstants.CSS_UNDERLINE_VALUE.equals(dstyle.getTextUnderline());
      fstrike=CSSConstants.CSS_LINE_THROUGH_VALUE.equals(dstyle.getTextLineThrough());
    }
    HorizontalAlignment ha=HorizontalAlignment.LEFT_LITERAL;
    if (DesignChoiceConstants.TEXT_ALIGN_CENTER.equals(style.getTextAlign())) {
      ha=HorizontalAlignment.CENTER_LITERAL;
    }
 else     if (DesignChoiceConstants.TEXT_ALIGN_RIGHT.equals(style.getTextAlign())) {
      ha=HorizontalAlignment.RIGHT_LITERAL;
    }
    VerticalAlignment va=VerticalAlignment.TOP_LITERAL;
    if (DesignChoiceConstants.VERTICAL_ALIGN_MIDDLE.equals(style.getVerticalAlign())) {
      va=VerticalAlignment.CENTER_LITERAL;
    }
 else     if (DesignChoiceConstants.VERTICAL_ALIGN_BOTTOM.equals(style.getVerticalAlign())) {
      va=VerticalAlignment.BOTTOM_LITERAL;
    }
    TextAlignment ta=goFactory.createTextAlignment();
    ta.setHorizontalAlignment(ha);
    ta.setVerticalAlignment(va);
    FontDefinition fd=goFactory.createFontDefinition(fname,fsize,fbold,fitalic,funder,fstrike,true,0,ta);
    ss.setFont(fd);
    ColorHandle ch=style.getColor();
    if (dstyle != null) {
      ss.setColor(getColor(dstyle.getProperty(StyleConstants.STYLE_COLOR)));
    }
 else     if (ch != null && ch.getRGB() != -1) {
      int rgbValue=ch.getRGB();
      ColorDefinition cd=goFactory.createColorDefinition((rgbValue >> 16) & 0xff,(rgbValue >> 8) & 0xff,rgbValue & 0xff);
      ss.setColor(cd);
    }
 else {
      ss.setColor(goFactory.BLACK());
    }
    ch=style.getBackgroundColor();
    if (dstyle != null) {
      ss.setBackgroundColor(getColor(dstyle.getProperty(StyleConstants.STYLE_BACKGROUND_COLOR)));
    }
 else     if (ch != null && ch.getRGB() != -1) {
      int rgbValue=ch.getRGB();
      ColorDefinition cd=goFactory.createColorDefinition((rgbValue >> 16) & 0xff,(rgbValue >> 8) & 0xff,rgbValue & 0xff);
      ss.setBackgroundColor(cd);
    }
    if (style.getBackgroundImage() != null && style.getBackgroundImage().length() > 0) {
      String urlString=style.getBackgroundImage();
      try {
        new URL(urlString);
        ss.setBackgroundImage(goFactory.createImage(urlString));
      }
 catch (      Exception _) {
        if (urlString != null && urlString.startsWith("String_Node_Str")) {
          urlString="String_Node_Str" + urlString;
        }
 else {
          urlString="String_Node_Str" + urlString;
        }
        try {
          new URL(urlString);
          ss.setBackgroundImage(goFactory.createImage(urlString));
        }
 catch (        Exception __) {
          logger.log(_);
        }
      }
    }
    double pt=convertToPixel(style.getPaddingTop());
    double pb=convertToPixel(style.getPaddingBottom());
    double pl=convertToPixel(style.getPaddingLeft());
    double pr=convertToPixel(style.getPaddingRight());
    ss.setPadding(goFactory.createInsets(pt,pl,pb,pr));
    if (useCache) {
      cache=ss;
    }
  }
  if (useCache) {
    ss=cache.copy();
  }
  return ss;
}

Fixed version (ground truth):
public IStyle getStyle(Chart model,StyledComponent name){
  SimpleStyle ss=null;
  if (cache == null || !useCache) {
    StyleHandle style=handle.getPrivateStyle();
    ss=new SimpleStyle();
    String fname=style.getFontFamilyHandle().getStringValue();
    int fsize=getFontSizeIntValue(handle);
    boolean fbold=getFontWeight(style.getFontWeight()) >= 700;
    boolean fitalic=DesignChoiceConstants.FONT_STYLE_ITALIC.equals(style.getFontStyle());
    boolean funder=DesignChoiceConstants.TEXT_UNDERLINE_UNDERLINE.equals(style.getTextUnderline());
    boolean fstrike=DesignChoiceConstants.TEXT_LINE_THROUGH_LINE_THROUGH.equals(style.getTextLineThrough());
    if (dstyle != null) {
      CSSValueList valueList=(CSSValueList)dstyle.getProperty(StyleConstants.STYLE_FONT_FAMILY);
      if (valueList.getLength() > 0) {
        fname=valueList.item(0).getCssText();
      }
      fsize=getSize(dstyle.getProperty(StyleConstants.STYLE_FONT_SIZE));
      fbold=isBoldFont(dstyle.getProperty(StyleConstants.STYLE_FONT_WEIGHT));
      fitalic=isItalicFont(dstyle.getFontStyle());
      funder=CSSConstants.CSS_UNDERLINE_VALUE.equals(dstyle.getTextUnderline());
      fstrike=CSSConstants.CSS_LINE_THROUGH_VALUE.equals(dstyle.getTextLineThrough());
    }
    HorizontalAlignment ha=HorizontalAlignment.LEFT_LITERAL;
    if (DesignChoiceConstants.TEXT_ALIGN_CENTER.equals(style.getTextAlign())) {
      ha=HorizontalAlignment.CENTER_LITERAL;
    }
 else     if (DesignChoiceConstants.TEXT_ALIGN_RIGHT.equals(style.getTextAlign())) {
      ha=HorizontalAlignment.RIGHT_LITERAL;
    }
    VerticalAlignment va=VerticalAlignment.TOP_LITERAL;
    if (DesignChoiceConstants.VERTICAL_ALIGN_MIDDLE.equals(style.getVerticalAlign())) {
      va=VerticalAlignment.CENTER_LITERAL;
    }
 else     if (DesignChoiceConstants.VERTICAL_ALIGN_BOTTOM.equals(style.getVerticalAlign())) {
      va=VerticalAlignment.BOTTOM_LITERAL;
    }
    TextAlignment ta=goFactory.createTextAlignment();
    ta.setHorizontalAlignment(ha);
    ta.setVerticalAlignment(va);
    FontDefinition fd=goFactory.createFontDefinition(fname,fsize,fbold,fitalic,funder,fstrike,true,0,ta);
    ss.setFont(fd);
    ColorHandle ch=style.getColor();
    if (dstyle != null) {
      ss.setColor(getColor(dstyle.getProperty(StyleConstants.STYLE_COLOR)));
    }
 else     if (ch != null && ch.getRGB() != -1) {
      int rgbValue=ch.getRGB();
      ColorDefinition cd=goFactory.createColorDefinition((rgbValue >> 16) & 0xff,(rgbValue >> 8) & 0xff,rgbValue & 0xff);
      ss.setColor(cd);
    }
 else {
      ss.setColor(goFactory.BLACK());
    }
    ch=style.getBackgroundColor();
    if (dstyle != null) {
      ss.setBackgroundColor(getColor(dstyle.getProperty(StyleConstants.STYLE_BACKGROUND_COLOR)));
    }
 else     if (ch != null && ch.getRGB() != -1) {
      int rgbValue=ch.getRGB();
      ColorDefinition cd=goFactory.createColorDefinition((rgbValue >> 16) & 0xff,(rgbValue >> 8) & 0xff,rgbValue & 0xff);
      ss.setBackgroundColor(cd);
    }
    if (style.getBackgroundImage() != null && style.getBackgroundImage().length() > 0) {
      String urlString=style.getBackgroundImage();
      try {
        new URL(urlString);
        ss.setBackgroundImage(goFactory.createImage(urlString));
      }
 catch (      Exception _) {
        if (urlString != null && urlString.startsWith("String_Node_Str")) {
          urlString="String_Node_Str" + urlString;
        }
 else {
          urlString="String_Node_Str" + urlString;
        }
        try {
          new URL(urlString);
          ss.setBackgroundImage(goFactory.createImage(urlString));
        }
 catch (        Exception __) {
          logger.log(_);
        }
      }
    }
    double pt=convertToPixel(style.getPaddingTop());
    double pb=convertToPixel(style.getPaddingBottom());
    double pl=convertToPixel(style.getPaddingLeft());
    double pr=convertToPixel(style.getPaddingRight());
    ss.setPadding(goFactory.createInsets(pt,pl,pb,pr));
    String dateTimeFormat=null, stringFormat=null, numberFormat=null;
    if (dstyle != null) {
      dateTimeFormat=dstyle.getDateTimeFormat();
      stringFormat=dstyle.getStringFormat();
      numberFormat=dstyle.getNumberFormat();
    }
 else {
      dateTimeFormat=style.getDateTimeFormat();
      stringFormat=style.getStringFormat();
      numberFormat=style.getNumberFormat();
    }
    if (dateTimeFormat != null) {
      ss.setDateTimeFormat(JavaDateFormatSpecifierImpl.create(new DateFormatter(dateTimeFormat).getFormatCode()));
    }
    if (stringFormat != null) {
      ss.setStringFormat(StringFormatSpecifierImpl.create(stringFormat));
    }
    if (numberFormat != null) {
      ss.setNumberFormat(JavaNumberFormatSpecifierImpl.create(new NumberFormatter(numberFormat).getFormatCode()));
    }
    if (useCache) {
      cache=ss;
    }
  }
  if (useCache) {
    ss=cache.copy();
  }
  return ss;
}