Program: 68499
Project: 68499
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;
        fixedReport=true;
      }
 else       if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_AUTO;
        fixedReport=false;
      }
    }
  }
 else {
    fixedReport=HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference);
  }
  if (enableAgentStyleEngine) {
    htmlEmitter=new HTMLPerformanceOptimize(this,writer,fixedReport,enableInlineStyle,browserVersion);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,fixedReport,enableInlineStyle,htmlRtLFlag,browserVersion);
  }
  if (isEmbeddable) {
    outputCSSStyles(reportDesign,designHandle);
    if (needFixTransparentPNG) {
      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);
          }
        }
      }
    }
    outputClientScript(report);
    return;
  }
  openRootTag();
  writeBidiFlag();
  writer.openTag(HTMLTags.TAG_HEAD);
  outputReportTitle(report);
  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);
  if (needFixTransparentPNG) {
    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());
  }
  outputClientScript(report);
}

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;
        fixedReport=true;
      }
 else       if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_AUTO;
        fixedReport=false;
      }
    }
  }
 else {
    fixedReport=HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference);
  }
  if (enableAgentStyleEngine) {
    htmlEmitter=new HTMLPerformanceOptimize(this,writer,fixedReport,enableInlineStyle,browserVersion);
  }
 else {
    htmlEmitter=new HTMLVisionOptimize(this,writer,fixedReport,enableInlineStyle,htmlRtLFlag,browserVersion);
  }
  if (isEmbeddable) {
    outputCSSStyles(reportDesign,designHandle);
    if (needFixTransparentPNG) {
      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);
          }
        }
      }
    }
    outputClientScript(report);
    return;
  }
  openRootTag();
  writeBidiFlag();
  writer.openTag(HTMLTags.TAG_HEAD);
  outputReportTitle(report);
  writer.openTag(HTMLTags.TAG_META);
  writer.attribute(HTMLTags.ATTR_HTTP_EQUIV,"String_Node_Str");
  writer.attribute(HTMLTags.ATTR_CONTENT,"String_Node_Str");
  if (!OUTPUT_FORMAT_HTML.equals(getOutputFormat())) {
    writer.closeTag(HTMLTags.TAG_META);
  }
  outputCSSStyles(reportDesign,designHandle);
  if (needFixTransparentPNG) {
    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());
  }
  outputClientScript(report);
}