Program: 69801
Project: 69801
Buggy source:
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();
    Map appContext=reportContext.getAppContext();
    if (appContext != null) {
      Object tmp=appContext.get(EngineConstants.APPCONTEXT_CHART_RESOLUTION);
      if (tmp != null && tmp instanceof Number) {
        imageDpi=((Number)tmp).intValue();
      }
    }
    if (imageDpi <= 0) {
      imageDpi=designHandle.getImageDPI();
    }
    if (imageDpi <= 0) {
      imageDpi=96;
    }
  }
  retrieveRtLFlag();
  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,enableInlineStyle);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,layoutPreference,enableInlineStyle,htmlRtLFlag);
  }
  if (isEmbeddable) {
    outputCSSStyles(reportDesign,designHandle);
    fixTransparentPNG();
    fixRedirect();
    openRootTag();
    writeBidiFlag();
    if (report != null) {
      String defaultStyleName=report.getDesign().getRootStyleName();
      if (defaultStyleName != null) {
        if (enableInlineStyle) {
          StringBuffer defaultStyleBuffer=new StringBuffer();
          IStyle defaultStyle=report.findStyle(defaultStyleName);
          htmlEmitter.buildDefaultStyle(defaultStyleBuffer,defaultStyle);
          if (defaultStyleBuffer.length() > 0) {
            writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
          }
        }
 else {
          if (htmlIDNamespace != null) {
            writer.attribute(HTMLTags.ATTR_CLASS,htmlIDNamespace + defaultStyleName);
          }
 else {
            writer.attribute(HTMLTags.ATTR_CLASS,defaultStyleName);
          }
        }
      }
    }
    return;
  }
  openRootTag();
  writeBidiFlag();
  writer.openTag(HTMLTags.TAG_HEAD);
  outputReportTitle(designHandle);
  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(reportDesign,designHandle);
  fixTransparentPNG();
  fixRedirect();
  writer.closeTag(HTMLTags.TAG_HEAD);
  writer.openTag(HTMLTags.TAG_BODY);
  StringBuffer defaultStyleBuffer=new StringBuffer();
  if (report != null) {
    String defaultStyleName=report.getDesign().getRootStyleName();
    if (defaultStyleName != null) {
      if (enableInlineStyle) {
        IStyle defaultStyle=report.findStyle(defaultStyleName);
        htmlEmitter.buildDefaultStyle(defaultStyleBuffer,defaultStyle);
      }
 else {
        if (htmlIDNamespace != null) {
          writer.attribute(HTMLTags.ATTR_CLASS,htmlIDNamespace + defaultStyleName);
        }
 else {
          writer.attribute(HTMLTags.ATTR_CLASS,defaultStyleName);
        }
      }
    }
  }
  if (outputMasterPageContent) {
    defaultStyleBuffer.append("String_Node_Str");
  }
  if (defaultStyleBuffer.length() > 0) {
    writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
  }
}

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();
    Map appContext=reportContext.getAppContext();
    if (appContext != null) {
      Object tmp=appContext.get(EngineConstants.APPCONTEXT_CHART_RESOLUTION);
      if (tmp != null && tmp instanceof Number) {
        imageDpi=((Number)tmp).intValue();
      }
    }
    if (imageDpi <= 0) {
      imageDpi=designHandle.getImageDPI();
    }
    if (imageDpi <= 0) {
      imageDpi=96;
    }
  }
  retrieveRtLFlag();
  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,enableInlineStyle,browserVersion);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,layoutPreference,enableInlineStyle,htmlRtLFlag,browserVersion);
  }
  if (isEmbeddable) {
    outputCSSStyles(reportDesign,designHandle);
    fixTransparentPNG();
    fixRedirect();
    openRootTag();
    writeBidiFlag();
    if (report != null) {
      String defaultStyleName=report.getDesign().getRootStyleName();
      if (defaultStyleName != null) {
        if (enableInlineStyle) {
          StringBuffer defaultStyleBuffer=new StringBuffer();
          IStyle defaultStyle=report.findStyle(defaultStyleName);
          htmlEmitter.buildDefaultStyle(defaultStyleBuffer,defaultStyle);
          if (defaultStyleBuffer.length() > 0) {
            writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
          }
        }
 else {
          if (htmlIDNamespace != null) {
            writer.attribute(HTMLTags.ATTR_CLASS,htmlIDNamespace + defaultStyleName);
          }
 else {
            writer.attribute(HTMLTags.ATTR_CLASS,defaultStyleName);
          }
        }
      }
    }
    return;
  }
  openRootTag();
  writeBidiFlag();
  writer.openTag(HTMLTags.TAG_HEAD);
  outputReportTitle(designHandle);
  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(reportDesign,designHandle);
  fixTransparentPNG();
  fixRedirect();
  writer.closeTag(HTMLTags.TAG_HEAD);
  writer.openTag(HTMLTags.TAG_BODY);
  StringBuffer defaultStyleBuffer=new StringBuffer();
  if (report != null) {
    String defaultStyleName=report.getDesign().getRootStyleName();
    if (defaultStyleName != null) {
      if (enableInlineStyle) {
        IStyle defaultStyle=report.findStyle(defaultStyleName);
        htmlEmitter.buildDefaultStyle(defaultStyleBuffer,defaultStyle);
      }
 else {
        if (htmlIDNamespace != null) {
          writer.attribute(HTMLTags.ATTR_CLASS,htmlIDNamespace + defaultStyleName);
        }
 else {
          writer.attribute(HTMLTags.ATTR_CLASS,defaultStyleName);
        }
      }
    }
  }
  if (outputMasterPageContent) {
    defaultStyleBuffer.append("String_Node_Str");
  }
  if (defaultStyleBuffer.length() > 0) {
    writer.attribute(HTMLTags.ATTR_STYLE,defaultStyleBuffer.toString());
  }
}