Program: 47838
Project: 47838
Buggy source:
/** 
 * Creates an image map element that complies with the XHTML 1.0 specification.
 * @param name  the map name (<code>null</code> not permitted).
 * @param info  the chart rendering info (<code>null</code> not permitted).
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragmentthat will contain the tooltip text (<code>null</code> not permitted if <code>info</code> contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment thatwill contain the URL reference (<code>null</code> not permitted if <code>info</code> contains URLs).
 * @return The map tag.
 */
public static String getImageMap(String name,ChartRenderingInfo info,ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,URLTagFragmentGenerator urlTagFragmentGenerator){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str" + htmlEscape(name) + "String_Node_Str"+ htmlEscape(name)+ "String_Node_Str");
  sb.append(StringUtils.getLineSeparator());
  EntityCollection entities=info.getEntityCollection();
  if (entities != null) {
    int count=entities.getEntityCount();
    for (int i=count - 1; i >= 0; i--) {
      ChartEntity entity=entities.getEntity(i);
      if (entity.getToolTipText() != null || entity.getURLText() != null) {
        String area=entity.getImageMapAreaTag(toolTipTagFragmentGenerator,urlTagFragmentGenerator);
        if (area.length() > 0) {
          sb.append(area);
          sb.append(StringUtils.getLineSeparator());
        }
      }
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Creates an image map element that complies with the XHTML 1.0 specification.
 * @param name  the map name (<code>null</code> not permitted).
 * @param info  the chart rendering info (<code>null</code> not permitted).
 * @param toolTipTagFragmentGenerator  a generator for the HTML fragmentthat will contain the tooltip text (<code>null</code> not permitted if <code>info</code> contains tooltip information).
 * @param urlTagFragmentGenerator  a generator for the HTML fragment thatwill contain the URL reference (<code>null</code> not permitted if <code>info</code> contains URLs).
 * @return The map tag.
 */
public static String getImageMap(String name,ChartRenderingInfo info,ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,URLTagFragmentGenerator urlTagFragmentGenerator){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + htmlEscape(name) + "String_Node_Str"+ htmlEscape(name)+ "String_Node_Str");
  sb.append(StringUtils.getLineSeparator());
  EntityCollection entities=info.getEntityCollection();
  if (entities != null) {
    int count=entities.getEntityCount();
    for (int i=count - 1; i >= 0; i--) {
      ChartEntity entity=entities.getEntity(i);
      if (entity.getToolTipText() != null || entity.getURLText() != null) {
        String area=entity.getImageMapAreaTag(toolTipTagFragmentGenerator,urlTagFragmentGenerator);
        if (area.length() > 0) {
          sb.append(area);
          sb.append(StringUtils.getLineSeparator());
        }
      }
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}