Program: 73234
Project: 73234
Buggy source:
/** 
 * Create the image map. As a side effect, this may create other HTML files or subdirectories.
 * @param directory The directory into which to write any HTMLthat is created as a side effect.
 * @throws PrinterException If writing to the toc file fails.
 * @throws IOException If IO fails.
 * @throws IllegalActionException If reading parameters fails.
 */
protected String _createImageMap(File directory) throws IllegalActionException, IOException, PrinterException {
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  List<IconVisibleLocation> iconLocations=_getIconVisibleLocations();
  for (  IconVisibleLocation location : iconLocations) {
    StringBuffer attributeString=new StringBuffer();
    attributeString.append("String_Node_Str");
    HashMap<String,String> areaAttributes=_areaAttributes.get(location.object);
    if (areaAttributes != null) {
      for (      String key : areaAttributes.keySet()) {
        String value=areaAttributes.get(key);
        if (value != null && !value.trim().equals("String_Node_Str")) {
          attributeString.append(key);
          attributeString.append("String_Node_Str");
          attributeString.append(StringUtilities.escapeString(value));
          attributeString.append("String_Node_Str");
        }
      }
    }
    result.append("String_Node_Str" + (int)location.topLeftX + "String_Node_Str"+ (int)location.topLeftY+ "String_Node_Str"+ (int)location.bottomRightX+ "String_Node_Str"+ (int)location.bottomRightY+ "String_Node_Str"+ attributeString+ "String_Node_Str");
  }
  result.append("String_Node_Str");
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Create the image map. As a side effect, this may create other HTML files or subdirectories.
 * @param directory The directory into which to write any HTMLthat is created as a side effect.
 * @throws PrinterException If writing to the toc file fails.
 * @throws IOException If IO fails.
 * @throws IllegalActionException If reading parameters fails.
 */
protected String _createImageMap(File directory) throws IllegalActionException, IOException, PrinterException {
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  List<IconVisibleLocation> iconLocations=_getIconVisibleLocations();
  for (  IconVisibleLocation location : iconLocations) {
    StringBuffer attributeString=new StringBuffer();
    attributeString.append("String_Node_Str");
    HashMap<String,String> areaAttributes=_areaAttributes.get(location.object);
    if (areaAttributes != null) {
      for (      Map.Entry<String,String> entry : areaAttributes.entrySet()) {
        String key=entry.getKey();
        String value=entry.getValue();
        if (value != null && !value.trim().equals("String_Node_Str")) {
          attributeString.append(key);
          attributeString.append("String_Node_Str");
          attributeString.append(StringUtilities.escapeString(value));
          attributeString.append("String_Node_Str");
        }
      }
    }
    result.append("String_Node_Str" + (int)location.topLeftX + "String_Node_Str"+ (int)location.topLeftY+ "String_Node_Str"+ (int)location.bottomRightX+ "String_Node_Str"+ (int)location.bottomRightY+ "String_Node_Str"+ attributeString+ "String_Node_Str");
  }
  result.append("String_Node_Str");
  return result.toString();
}