Program: 69828
Project: 69828
Buggy source:
private void outputCSSStyles(Report reportDesign,ReportDesignHandle designHandle){
  if (report == null) {
    logger.log(Level.WARNING,"String_Node_Str");
  }
 else {
    if (!enableInlineStyle) {
      writer.openTag(HTMLTags.TAG_STYLE);
      writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
      String styleNamePrefix;
      if (null != htmlIDNamespace) {
        styleNamePrefix="String_Node_Str" + htmlIDNamespace;
      }
 else {
        styleNamePrefix="String_Node_Str";
      }
      String defaultStyleName=reportDesign.getRootStyleName();
      Map styles=reportDesign.getStyles();
      Iterator iter=styles.entrySet().iterator();
      while (iter.hasNext()) {
        Map.Entry entry=(Map.Entry)iter.next();
        String styleName=(String)entry.getKey();
        if (styleName != null) {
          IStyle style=(IStyle)entry.getValue();
          StringBuffer styleBuffer=new StringBuffer();
          if (styleName.equals(defaultStyleName)) {
            htmlEmitter.buildDefaultStyle(styleBuffer,style);
          }
 else {
            htmlEmitter.buildStyle(styleBuffer,style);
          }
          if (styleBuffer.length() > 0) {
            writer.style(styleNamePrefix + styleName,styleBuffer.toString());
          }
        }
      }
      writer.closeTag(HTMLTags.TAG_STYLE);
    }
  }
  hasCsslinks=false;
  if (designHandle != null) {
    List externalCsses=designHandle.getAllExternalIncludedCsses();
    if (null != externalCsses) {
      Iterator iter=externalCsses.iterator();
      while (iter.hasNext()) {
        IncludedCssStyleSheetHandle cssStyleSheetHandle=(IncludedCssStyleSheetHandle)iter.next();
        String href=cssStyleSheetHandle.getExternalCssURI();
        if (href != null) {
          hasCsslinks=true;
          writer.openTag(HTMLTags.TAG_LINK);
          writer.attribute(HTMLTags.ATTR_REL,"String_Node_Str");
          writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
          writer.attribute(HTMLTags.ATTR_HREF,href);
          writer.closeTag(HTMLTags.TAG_LINK);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void outputCSSStyles(Report reportDesign,ReportDesignHandle designHandle){
  if (report == null) {
    logger.log(Level.WARNING,"String_Node_Str");
  }
 else {
    if (!enableInlineStyle) {
      writer.openTag(HTMLTags.TAG_STYLE);
      writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
      String styleNamePrefix;
      if (null != htmlIDNamespace) {
        styleNamePrefix="String_Node_Str" + htmlIDNamespace;
      }
 else {
        styleNamePrefix="String_Node_Str";
      }
      String defaultStyleName=reportDesign.getRootStyleName();
      Map styles=reportDesign.getStyles();
      Iterator iter=styles.entrySet().iterator();
      while (iter.hasNext()) {
        Map.Entry entry=(Map.Entry)iter.next();
        String styleName=(String)entry.getKey();
        if (styleName != null) {
          IStyle style=(IStyle)entry.getValue();
          StringBuffer styleBuffer=new StringBuffer();
          if (styleName.equals(defaultStyleName)) {
            htmlEmitter.buildDefaultStyle(styleBuffer,style);
          }
 else {
            htmlEmitter.buildStyle(styleBuffer,style);
          }
          if (styleBuffer.length() > 0) {
            writer.style(styleNamePrefix + styleName,styleBuffer.toString());
            outputtedStyles.add(styleName);
          }
        }
      }
      writer.closeTag(HTMLTags.TAG_STYLE);
    }
  }
  hasCsslinks=false;
  if (designHandle != null) {
    List externalCsses=designHandle.getAllExternalIncludedCsses();
    if (null != externalCsses) {
      Iterator iter=externalCsses.iterator();
      while (iter.hasNext()) {
        IncludedCssStyleSheetHandle cssStyleSheetHandle=(IncludedCssStyleSheetHandle)iter.next();
        String href=cssStyleSheetHandle.getExternalCssURI();
        if (href != null) {
          hasCsslinks=true;
          writer.openTag(HTMLTags.TAG_LINK);
          writer.attribute(HTMLTags.ATTR_REL,"String_Node_Str");
          writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
          writer.attribute(HTMLTags.ATTR_HREF,href);
          writer.closeTag(HTMLTags.TAG_LINK);
        }
      }
    }
  }
}