Program: 76165
Project: 76165
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);
      style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.RIGHT_VALUE);
    }
  }
  if (null == layoutPreference) {
    if (report != null) {
      Report reportDesign=report.getDesign();
      ReportDesignHandle designHandle=reportDesign.getReportDesign();
      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 (isEmbeddable) {
    fixTransparentPNG();
    writer.openTag(HTMLTags.TAG_DIV);
    if (report != null) {
      String reportStyleName=report.getDesign().getRootStyleName();
      if (reportStyleName != null) {
        IStyle style=report.findStyle(reportStyleName);
        StringBuffer styleBuffer=new StringBuffer();
        AttributeBuilder.buildStyle(styleBuffer,style,this);
        writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
      }
    }
    return;
  }
  writer.startWriter();
  writer.openTag(HTMLTags.TAG_HTML);
  writer.openTag(HTMLTags.TAG_HEAD);
  Report reportDesign=null;
  if (report != null) {
    reportDesign=report.getDesign();
    ReportDesignHandle designHandle=reportDesign.getReportDesign();
    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.closeNoEndTag();
  writer.openTag(HTMLTags.TAG_STYLE);
  writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
  IStyle style;
  StringBuffer styleBuffer=new StringBuffer();
  if (report == null) {
    logger.log(Level.WARNING,"String_Node_Str");
  }
 else {
    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);
      AttributeBuilder.buildStyle(styleBuffer,style,this);
      writer.style('.' + styleName,styleBuffer.toString());
    }
  }
  writer.closeTag(HTMLTags.TAG_STYLE);
  fixTransparentPNG();
  writer.closeTag(HTMLTags.TAG_HEAD);
  writer.openTag(HTMLTags.TAG_BODY);
  if (report != null) {
    String reportStyleName=report.getDesign().getRootStyleName();
    if (reportStyleName != null) {
      writer.attribute(HTMLTags.ATTR_CLASS,reportStyleName);
    }
  }
}

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);
      style.setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.RIGHT_VALUE);
    }
  }
  if (null == layoutPreference) {
    if (report != null) {
      Report reportDesign=report.getDesign();
      ReportDesignHandle designHandle=reportDesign.getReportDesign();
      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 (isEmbeddable) {
    fixTransparentPNG();
    writer.openTag(HTMLTags.TAG_DIV);
    if (report != null) {
      String reportStyleName=report.getDesign().getRootStyleName();
      if (reportStyleName != null) {
        IStyle style=report.findStyle(reportStyleName);
        StringBuffer styleBuffer=new StringBuffer();
        AttributeBuilder.buildStyle(styleBuffer,style,this);
        writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
      }
    }
    return;
  }
  writer.startWriter();
  writer.openTag(HTMLTags.TAG_HTML);
  writer.openTag(HTMLTags.TAG_HEAD);
  Report reportDesign=null;
  if (report != null) {
    reportDesign=report.getDesign();
    ReportDesignHandle designHandle=reportDesign.getReportDesign();
    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.closeNoEndTag();
  writer.openTag(HTMLTags.TAG_STYLE);
  writer.attribute(HTMLTags.ATTR_TYPE,"String_Node_Str");
  IStyle style;
  StringBuffer styleBuffer=new StringBuffer();
  if (report == null) {
    logger.log(Level.WARNING,"String_Node_Str");
  }
 else {
    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);
      AttributeBuilder.buildStyle(styleBuffer,style,this);
      writer.style('.' + styleName,styleBuffer.toString());
    }
  }
  writer.closeTag(HTMLTags.TAG_STYLE);
  fixTransparentPNG();
  writer.closeTag(HTMLTags.TAG_HEAD);
  writer.openTag(HTMLTags.TAG_BODY);
  if (report != null) {
    String reportStyleName=report.getDesign().getRootStyleName();
    if (reportStyleName != null) {
      writer.attribute(HTMLTags.ATTR_CLASS,reportStyleName);
      writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str");
    }
  }
}