Program: 71665
Project: 71665
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);
        style.setProperty(IStyle.STYLE_DIRECTION,IStyle.RTL_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,layoutPreference);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,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);
    }
  }
  String defaultStyleName="String_Node_Str";
  if (isEmbeddable) {
    outputCSSStyles(defaultStyleName,defaultStyleBuffer,reportDesign,designHandle);
    fixTransparentPNG();
    fixRedirect();
    writer.openTag(HTMLTags.TAG_DIV);
    if (htmlRtLFlag) {
      writer.attribute(HTMLTags.ATTR_HTML_DIR,CSSConstants.CSS_RTL_VALUE);
    }
    writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
    return;
  }
  writer.startWriter();
  writer.openTag(HTMLTags.TAG_HTML);
  if (htmlRtLFlag) {
    writer.attribute(HTMLTags.ATTR_HTML_DIR,CSSConstants.CSS_RTL_VALUE);
  }
  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);
  outputCSSStyles(defaultStyleName,defaultStyleBuffer,reportDesign,designHandle);
  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");
  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,layoutPreference);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,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);
    }
  }
  String defaultStyleName="String_Node_Str";
  if (isEmbeddable) {
    outputCSSStyles(defaultStyleName,defaultStyleBuffer,reportDesign,designHandle);
    fixTransparentPNG();
    fixRedirect();
    writer.openTag(HTMLTags.TAG_DIV);
    if (htmlRtLFlag) {
      writer.attribute(HTMLTags.ATTR_HTML_DIR,CSSConstants.CSS_RTL_VALUE);
    }
    writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
    return;
  }
  writer.startWriter();
  writer.openTag(HTMLTags.TAG_HTML);
  if (htmlRtLFlag) {
    writer.attribute(HTMLTags.ATTR_HTML_DIR,CSSConstants.CSS_RTL_VALUE);
  }
  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);
  outputCSSStyles(defaultStyleName,defaultStyleBuffer,reportDesign,designHandle);
  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");
  }
}