Program: 72693
Project: 72693
Buggy source:
public void start(IReportContent report){
  logger.log(Level.FINE,"String_Node_Str");
  this.report=report;
  writer.open(out,"String_Node_Str");
  if (htmlRtLFlag) {
    String reportStyleName=report == null ? null : report.getDesign().getRootStyleName();
    if (reportStyleName != null) {
      IStyle style=report.findStyle(reportStyleName);
      if (null != style) {
        style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.RIGHT_VALUE);
      }
    }
  }
  ReportDesignHandle designHandle=null;
  Report reportDesign=null;
  if (report != null) {
    reportDesign=report.getDesign();
    designHandle=reportDesign.getReportDesign();
  }
  if (null == layoutPreference) {
    if (designHandle != null) {
      String reportLayoutPreference=designHandle.getLayoutPreference();
      if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_FIXED;
      }
 else       if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_AUTO;
      }
    }
  }
  if (enableAgentStyleEngine) {
    htmlEmitter=new HTMLPerformanceOptimize(this,writer,isEmbeddable,layoutPreference);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,isEmbeddable,layoutPreference);
  }
  StringBuffer defaultStyleBuffer=new StringBuffer();
  if (report != null) {
    String reportStyleName=report.getDesign().getRootStyleName();
    if (reportStyleName != null) {
      IStyle style=report.findStyle(reportStyleName);
      htmlEmitter.buildDefaultStyle(defaultStyleBuffer,style);
    }
  }
  if (isEmbeddable) {
    fixTransparentPNG();
    fixRedirect();
    writer.openTag(HTMLTags.TAG_DIV);
    writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
    return;
  }
  writer.startWriter();
  writer.openTag(HTMLTags.TAG_HTML);
  writer.openTag(HTMLTags.TAG_HEAD);
  if (designHandle != null) {
    String title=designHandle.getStringProperty(IModuleModel.TITLE_PROP);
    if (title == null) {
      if (renderOption != null) {
        HTMLRenderOption htmlOption=new HTMLRenderOption(renderOption);
        title=htmlOption.getHtmlTitle();
      }
    }
    if (title != null) {
      writer.openTag(HTMLTags.TAG_TITLE);
      writer.text(title);
      writer.closeTag(HTMLTags.TAG_TITLE);
    }
  }
  writer.openTag(HTMLTags.TAG_META);
  writer.attribute(HTMLTags.ATTR_HTTP_EQUIV,"String_Node_Str");
  writer.attribute(HTMLTags.ATTR_CONTENT,"String_Node_Str");
  writer.closeTag(HTMLTags.TAG_META);
  writer.openTag(HTMLTags.TAG_STYLE);
  writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
  IStyle style;
  StringBuffer styleBuffer=new StringBuffer();
  String defaultStyleName="String_Node_Str";
  if (report == null) {
    logger.log(Level.WARNING,"String_Node_Str");
  }
 else {
    writer.style('.' + defaultStyleName,defaultStyleBuffer.toString());
    Map styles=reportDesign.getStyles();
    Iterator iter=styles.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry entry=(Map.Entry)iter.next();
      String styleName=(String)entry.getKey();
      style=(IStyle)entry.getValue();
      styleBuffer.setLength(0);
      htmlEmitter.buildStyle(styleBuffer,style);
      if (styleBuffer.length() > 0) {
        writer.style('.' + styleName,styleBuffer.toString());
        outputtedStyles.add(styleName);
      }
    }
  }
  writer.closeTag(HTMLTags.TAG_STYLE);
  hasCsslinks=false;
  fixTransparentPNG();
  fixRedirect();
  writer.closeTag(HTMLTags.TAG_HEAD);
  writer.openTag(HTMLTags.TAG_BODY);
  if (defaultStyleBuffer.length() > 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,defaultStyleName);
  }
  if (outputMasterPageContent) {
    writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void start(IReportContent report){
  logger.log(Level.FINE,"String_Node_Str");
  this.report=report;
  writer.open(out,"String_Node_Str");
  if (htmlRtLFlag) {
    String reportStyleName=report == null ? null : report.getDesign().getRootStyleName();
    if (reportStyleName != null) {
      IStyle style=report.findStyle(reportStyleName);
      if (null != style) {
        style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.RIGHT_VALUE);
      }
    }
  }
  ReportDesignHandle designHandle=null;
  Report reportDesign=null;
  if (report != null) {
    reportDesign=report.getDesign();
    designHandle=reportDesign.getReportDesign();
  }
  if (null == layoutPreference) {
    if (designHandle != null) {
      String reportLayoutPreference=designHandle.getLayoutPreference();
      if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_FIXED;
      }
 else       if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_AUTO;
      }
    }
  }
  if (enableAgentStyleEngine) {
    htmlEmitter=new HTMLPerformanceOptimize(this,writer,isEmbeddable,layoutPreference);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,isEmbeddable,layoutPreference);
  }
  StringBuffer defaultStyleBuffer=new StringBuffer();
  if (report != null) {
    String reportStyleName=report.getDesign().getRootStyleName();
    if (reportStyleName != null) {
      IStyle style=report.findStyle(reportStyleName);
      htmlEmitter.buildDefaultStyle(defaultStyleBuffer,style);
    }
  }
  if (isEmbeddable) {
    fixTransparentPNG();
    fixRedirect();
    writer.openTag(HTMLTags.TAG_DIV);
    writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
    return;
  }
  writer.startWriter();
  writer.openTag(HTMLTags.TAG_HTML);
  writer.openTag(HTMLTags.TAG_HEAD);
  if (designHandle != null) {
    String title=designHandle.getStringProperty(IModuleModel.TITLE_PROP);
    if (title == null) {
      if (renderOption != null) {
        HTMLRenderOption htmlOption=new HTMLRenderOption(renderOption);
        title=htmlOption.getHtmlTitle();
      }
    }
    if (title != null) {
      writer.openTag(HTMLTags.TAG_TITLE);
      writer.text(title);
      writer.closeTag(HTMLTags.TAG_TITLE);
    }
  }
  writer.openTag(HTMLTags.TAG_META);
  writer.attribute(HTMLTags.ATTR_HTTP_EQUIV,"String_Node_Str");
  writer.attribute(HTMLTags.ATTR_CONTENT,"String_Node_Str");
  writer.closeTag(HTMLTags.TAG_META);
  writer.openTag(HTMLTags.TAG_STYLE);
  writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
  IStyle style;
  StringBuffer styleBuffer=new StringBuffer();
  String defaultStyleName="String_Node_Str";
  if (report == null) {
    logger.log(Level.WARNING,"String_Node_Str");
  }
 else {
    writer.style('.' + defaultStyleName,defaultStyleBuffer.toString());
    Map styles=reportDesign.getStyles();
    Iterator iter=styles.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry entry=(Map.Entry)iter.next();
      String styleName=(String)entry.getKey();
      style=(IStyle)entry.getValue();
      styleBuffer.setLength(0);
      htmlEmitter.buildStyle(styleBuffer,style);
      if (styleBuffer.length() > 0) {
        writer.style('.' + styleName,styleBuffer.toString());
        outputtedStyles.add(styleName);
      }
    }
  }
  writer.closeTag(HTMLTags.TAG_STYLE);
  hasCsslinks=false;
  if (designHandle != null) {
    Iterator iter=designHandle.includeCssesIterator();
    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);
      }
    }
  }
  fixTransparentPNG();
  fixRedirect();
  writer.closeTag(HTMLTags.TAG_HEAD);
  writer.openTag(HTMLTags.TAG_BODY);
  if (defaultStyleBuffer.length() > 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,defaultStyleName);
  }
  if (outputMasterPageContent) {
    writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str");
  }
}