nus-yam/ex-repair huggingface dataset:
Program: 3258
Project: 3258
Buggy source:
/** 
 * Set the value separator for multiple values stored in one csv value. Is set in dspace.cfg as bulkedit.valueseparator If not set, defaults to double pipe '||'
 */
private void setValueSeparator(){
  valueSeparator=ConfigurationManager.getProperty("String_Node_Str");
  if ((valueSeparator != null) && (!"String_Node_Str".equals(valueSeparator.trim()))) {
    valueSeparator=valueSeparator.trim();
  }
 else {
    valueSeparator="String_Node_Str";
  }
  Pattern spchars=Pattern.compile("String_Node_Str");
  Matcher match=spchars.matcher(valueSeparator);
  escpaedValueSeparator=match.replaceAll("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Set the value separator for multiple values stored in one csv value. Is set in dspace.cfg as bulkedit.valueseparator If not set, defaults to double pipe '||'
 */
private void setValueSeparator(){
  valueSeparator=ConfigurationManager.getProperty("String_Node_Str");
  if ((valueSeparator != null) && (!"String_Node_Str".equals(valueSeparator.trim()))) {
    valueSeparator=valueSeparator.trim();
  }
 else {
    valueSeparator="String_Node_Str";
  }
  Pattern spchars=Pattern.compile("String_Node_Str");
  Matcher match=spchars.matcher(valueSeparator);
  escapedValueSeparator=match.replaceAll("String_Node_Str");
}
Program: 3259
Project: 3259
Buggy source:
/** 
 * output the explanation of the stat block in the relevant format
 * @param explanation     the explanatory or clarification text for the stats
 * @return      a string contianing the formatted explanation
 */
abstract public String blockExplanation(String explanation);

Fixed version (ground truth):
/** 
 * output the explanation of the stat block in the relevant format
 * @param explanation     the explanatory or clarification text for the stats
 * @return      a string containing the formatted explanation
 */
abstract public String blockExplanation(String explanation);
Program: 3260
Project: 3260
Buggy source:
/** 
 * Syncronize the cached list of analysis / report files with the reports directory We synchronize if: 1) The number of files is different (ie. files have been added or removed) 2) We haven't cached anything yet 3) The cache was last generate over an hour ago
 */
private static void syncFileList(){
  File[] fileList=StatisticsLoader.getAnalysisAndReportFileList();
  if (fileList != null && fileList.length != fileCount)   StatisticsLoader.loadFileList(fileList);
 else   if (lastLoaded == null)   StatisticsLoader.loadFileList(fileList);
 else   if (DateUtils.addHours(lastLoaded,1).before(new Date()))   StatisticsLoader.loadFileList(fileList);
}

Fixed version (ground truth):
/** 
 * Synchronize the cached list of analysis / report files with the reports directory We synchronize if: 1) The number of files is different (ie. files have been added or removed) 2) We haven't cached anything yet 3) The cache was last generate over an hour ago
 */
private static void syncFileList(){
  File[] fileList=StatisticsLoader.getAnalysisAndReportFileList();
  if (fileList != null && fileList.length != fileCount)   StatisticsLoader.loadFileList(fileList);
 else   if (lastLoaded == null)   StatisticsLoader.loadFileList(fileList);
 else   if (DateUtils.addHours(lastLoaded,1).before(new Date()))   StatisticsLoader.loadFileList(fileList);
}
Program: 3261
Project: 3261
Buggy source:
/** 
 * The helper function to vaildate the DatePattern.
 * @param pstrPattern The DatePattern to be validated.
 * @return The validated date pattern or defautlt DATE_PATTERN
 */
private String checkPattern(String pstrPattern){
  String strRet=null;
  SimpleDateFormat objFmt=new SimpleDateFormat(DATE_PATTERN);
  try {
    this.mobjSDF=new SimpleDateFormat(pstrPattern);
    strRet=pstrPattern;
  }
 catch (  NullPointerException NPExIgnore) {
    LogLog.error("String_Node_Str" + pstrPattern,NPExIgnore);
    this.mobjSDF=objFmt;
    strRet=DATE_PATTERN;
  }
catch (  IllegalArgumentException IlArgExIgnore) {
    LogLog.error("String_Node_Str" + pstrPattern,IlArgExIgnore);
    this.mobjSDF=objFmt;
    strRet=DATE_PATTERN;
  }
 finally {
    objFmt=null;
  }
  return strRet;
}

Fixed version (ground truth):
/** 
 * The helper function to validate the DatePattern.
 * @param pstrPattern The DatePattern to be validated.
 * @return The validated date pattern or defautlt DATE_PATTERN
 */
private String checkPattern(String pstrPattern){
  String strRet=null;
  SimpleDateFormat objFmt=new SimpleDateFormat(DATE_PATTERN);
  try {
    this.mobjSDF=new SimpleDateFormat(pstrPattern);
    strRet=pstrPattern;
  }
 catch (  NullPointerException NPExIgnore) {
    LogLog.error("String_Node_Str" + pstrPattern,NPExIgnore);
    this.mobjSDF=objFmt;
    strRet=DATE_PATTERN;
  }
catch (  IllegalArgumentException IlArgExIgnore) {
    LogLog.error("String_Node_Str" + pstrPattern,IlArgExIgnore);
    this.mobjSDF=objFmt;
    strRet=DATE_PATTERN;
  }
 finally {
    objFmt=null;
  }
  return strRet;
}
Program: 3263
Project: 3263
Buggy source:
/** 
 * Loads SubmissionConfig object for the given submission info object. If a SubmissionConfig object cannot be loaded, a Servlet Error is thrown. <p> This method just loads this SubmissionConfig object internally, so that it is available via a call to "getSubmissionConfig()"
 * @param request The HTTP Servlet Request object
 * @param subInfo the SubmissionInfo object we are loading into
 * @param forceReload If true, this method reloads from stratch (and overwrites cached SubmissionConfig)
 */
private static void loadSubmissionConfig(HttpServletRequest request,SubmissionInfo subInfo,boolean forceReload) throws ServletException {
  log.debug("String_Node_Str");
  if (!forceReload) {
    subInfo.submissionConfig=loadSubmissionConfigFromCache(request.getSession(),subInfo.getCollectionHandle(),subInfo.isInWorkflow());
  }
  if (subInfo.submissionConfig == null || forceReload) {
    subInfo.submissionConfig=submissionConfigReader.getSubmissionConfig(subInfo.getCollectionHandle(),subInfo.isInWorkflow());
    saveSubmissionConfigToCache(request.getSession(),subInfo.submissionConfig,subInfo.getCollectionHandle(),subInfo.isInWorkflow());
    loadProgressBar(request,subInfo,true);
  }
 else {
    log.debug("String_Node_Str");
    loadProgressBar(request,subInfo,false);
  }
}

Fixed version (ground truth):
/** 
 * Loads SubmissionConfig object for the given submission info object. If a SubmissionConfig object cannot be loaded, a Servlet Error is thrown. <p> This method just loads this SubmissionConfig object internally, so that it is available via a call to "getSubmissionConfig()"
 * @param request The HTTP Servlet Request object
 * @param subInfo the SubmissionInfo object we are loading into
 * @param forceReload If true, this method reloads from scratch (and overwrites cached SubmissionConfig)
 */
private static void loadSubmissionConfig(HttpServletRequest request,SubmissionInfo subInfo,boolean forceReload) throws ServletException {
  log.debug("String_Node_Str");
  if (!forceReload) {
    subInfo.submissionConfig=loadSubmissionConfigFromCache(request.getSession(),subInfo.getCollectionHandle(),subInfo.isInWorkflow());
  }
  if (subInfo.submissionConfig == null || forceReload) {
    subInfo.submissionConfig=submissionConfigReader.getSubmissionConfig(subInfo.getCollectionHandle(),subInfo.isInWorkflow());
    saveSubmissionConfigToCache(request.getSession(),subInfo.submissionConfig,subInfo.getCollectionHandle(),subInfo.isInWorkflow());
    loadProgressBar(request,subInfo,true);
  }
 else {
    log.debug("String_Node_Str");
    loadProgressBar(request,subInfo,false);
  }
}
Program: 3264
Project: 3264
Buggy source:
/** 
 * Formats the file size. Examples: - 50 = 50B - 1024 = 1KB - 1,024,000 = 1MB etc The numbers are formatted using java Locales
 * @param in The number to covnert
 * @return the file size as a String
 */
public static String formatFileSize(double in){
  NumberFormat nf=NumberFormat.getNumberInstance(Locale.getDefault());
  DecimalFormat df=(DecimalFormat)nf;
  df.applyPattern("String_Node_Str");
  if (in < 1024) {
    df.applyPattern("String_Node_Str");
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
 else   if (in < 1024000) {
    in=in / 1024;
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
 else   if (in < 1024000000) {
    in=in / 1024000;
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
 else {
    in=in / 1024000000;
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Formats the file size. Examples: - 50 = 50B - 1024 = 1KB - 1,024,000 = 1MB etc The numbers are formatted using java Locales
 * @param in The number to convert
 * @return the file size as a String
 */
public static String formatFileSize(double in){
  NumberFormat nf=NumberFormat.getNumberInstance(Locale.getDefault());
  DecimalFormat df=(DecimalFormat)nf;
  df.applyPattern("String_Node_Str");
  if (in < 1024) {
    df.applyPattern("String_Node_Str");
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
 else   if (in < 1024000) {
    in=in / 1024;
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
 else   if (in < 1024000000) {
    in=in / 1024000;
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
 else {
    in=in / 1024000000;
    return df.format(in) + "String_Node_Str" + "String_Node_Str";
  }
}
Program: 3265
Project: 3265
Buggy source:
/** 
 * So that any left over indices for items which have been deleted can be assured to have been removed, this method checks for indicies for items which are not in the item table. If it finds an index which does not have an associated item it removes it.
 * @param table		the index table to check
 * @param map		the name of the associated distinct mapping table
 * @param withdrawn TODO
 * @throws BrowseException
 */
public void pruneExcess(String table,String map,boolean withdrawn) throws BrowseException ;

Fixed version (ground truth):
/** 
 * So that any left over indices for items which have been deleted can be assured to have been removed, this method checks for indices for items which are not in the item table. If it finds an index which does not have an associated item it removes it.
 * @param table		the index table to check
 * @param map		the name of the associated distinct mapping table
 * @param withdrawn TODO
 * @throws BrowseException
 */
public void pruneExcess(String table,String map,boolean withdrawn) throws BrowseException ;
Program: 3266
Project: 3266
Buggy source:
/** 
 * Generate a url to the simple search url.
 */
protected String generateURL(Map<String,String> parameters) throws UIException {
  String query=getQuery();
  if (!"String_Node_Str".equals(query))   parameters.put("String_Node_Str",URLEncode(query));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterPage()));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterRpp()));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterSortBy()));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",getParameterOrder());
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterEtAl()));
  return super.generateURL("String_Node_Str",parameters);
}

Fixed version (ground truth):
/** 
 * Generate a url to the simple search url.
 */
protected String generateURL(Map<String,String> parameters) throws UIException {
  Request request=ObjectModelHelper.getRequest(objectModel);
  String scope=request.getParameter("String_Node_Str");
  if (scope != null)   parameters.put("String_Node_Str",scope);
  String query=getQuery();
  if (!"String_Node_Str".equals(query))   parameters.put("String_Node_Str",URLEncode(query));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterPage()));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterRpp()));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterSortBy()));
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",getParameterOrder());
  if (parameters.get("String_Node_Str") == null)   parameters.put("String_Node_Str",String.valueOf(getParameterEtAl()));
  return super.generateURL("String_Node_Str",parameters);
}
Program: 3269
Project: 3269
Buggy source:
/** 
 * Emit XML describing a single Group.
 * @param context the DSpace Context
 * @parm relatedObjectthe DSpaceObject related to this group (if any)
 * @param group the Group to describe
 * @param write the description to this stream
 */
private void writeGroup(Context context,DSpaceObject relatedObject,Group group,XMLStreamWriter writer) throws XMLStreamException, PackageException {
  writer.writeStartElement(GROUP);
  writer.writeAttribute(ID,String.valueOf(group.getID()));
  writer.writeAttribute(NAME,PackageUtils.crosswalkDefaultGroupName(context,group.getName()));
  String groupType=getGroupType(relatedObject,group);
  if (groupType != null && !groupType.isEmpty())   writer.writeAttribute(TYPE,groupType);
  writer.writeStartElement(MEMBERS);
  for (  EPerson member : group.getMembers()) {
    writer.writeEmptyElement(MEMBER);
    writer.writeAttribute(ID,String.valueOf(member.getID()));
    writer.writeAttribute(NAME,member.getName());
  }
  writer.writeEndElement();
  writer.writeStartElement(MEMBER_GROUPS);
  for (  Group member : group.getMemberGroups()) {
    writer.writeEmptyElement(MEMBER_GROUP);
    writer.writeAttribute(ID,String.valueOf(member.getID()));
    writer.writeAttribute(NAME,PackageUtils.crosswalkDefaultGroupName(context,member.getName()));
  }
  writer.writeEndElement();
  writer.writeEndElement();
}

Fixed version (ground truth):
/** 
 * Emit XML describing a single Group.
 * @param context the DSpace Context
 * @parm relatedObjectthe DSpaceObject related to this group (if any)
 * @param group the Group to describe
 * @param write the description to this stream
 */
private void writeGroup(Context context,DSpaceObject relatedObject,Group group,XMLStreamWriter writer) throws XMLStreamException, PackageException {
  writer.writeStartElement(GROUP);
  writer.writeAttribute(ID,String.valueOf(group.getID()));
  writer.writeAttribute(NAME,PackageUtils.translateGroupNameForExport(context,group.getName()));
  String groupType=getGroupType(relatedObject,group);
  if (groupType != null && !groupType.isEmpty())   writer.writeAttribute(TYPE,groupType);
  writer.writeStartElement(MEMBERS);
  for (  EPerson member : group.getMembers()) {
    writer.writeEmptyElement(MEMBER);
    writer.writeAttribute(ID,String.valueOf(member.getID()));
    writer.writeAttribute(NAME,member.getName());
  }
  writer.writeEndElement();
  writer.writeStartElement(MEMBER_GROUPS);
  for (  Group member : group.getMemberGroups()) {
    writer.writeEmptyElement(MEMBER_GROUP);
    writer.writeAttribute(ID,String.valueOf(member.getID()));
    writer.writeAttribute(NAME,PackageUtils.translateGroupNameForExport(context,member.getName()));
  }
  writer.writeEndElement();
  writer.writeEndElement();
}
Program: 3272
Project: 3272
Buggy source:
/** 
 * Return a Group Type string (see RoleDisseminator.GROUP_TYPE_* constants) which describes the type of group and its relation to the given object. <P> As a basic example, if the Group is a Collection Administration group, the Group Type string returned should be "ADMIN" <P> If type string cannot be determined, null is returned.
 * @param dso the related DSpaceObject
 * @param group the group
 * @return a group type string or null
 */
private String getGroupType(DSpaceObject dso,Group group){
  if (dso.getType() == Constants.COMMUNITY) {
    Community community=(Community)dso;
    if (community.getAdministrators().equals(group))     return GROUP_TYPE_ADMIN;
  }
 else   if (dso.getType() == Constants.COLLECTION) {
    Collection collection=(Collection)dso;
    if (collection.getAdministrators().equals(group))     return GROUP_TYPE_ADMIN;
 else     if (collection.getSubmitters().equals(group))     return GROUP_TYPE_SUBMIT;
 else     if (collection.getWorkflowGroup(1).equals(group))     return GROUP_TYPE_WORKFLOW_STEP_1;
 else     if (collection.getWorkflowGroup(2).equals(group))     return GROUP_TYPE_WORKFLOW_STEP_2;
 else     if (collection.getWorkflowGroup(3).equals(group))     return GROUP_TYPE_WORKFLOW_STEP_3;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return a Group Type string (see RoleDisseminator.GROUP_TYPE_* constants) which describes the type of group and its relation to the given object. <P> As a basic example, if the Group is a Collection Administration group, the Group Type string returned should be "ADMIN" <P> If type string cannot be determined, null is returned.
 * @param dso the related DSpaceObject
 * @param group the group
 * @return a group type string or null
 */
private String getGroupType(DSpaceObject dso,Group group){
  if (dso.getType() == Constants.COMMUNITY) {
    Community community=(Community)dso;
    if (community.getAdministrators() != null && community.getAdministrators().equals(group))     return GROUP_TYPE_ADMIN;
  }
 else   if (dso.getType() == Constants.COLLECTION) {
    Collection collection=(Collection)dso;
    if (collection.getAdministrators() != null && collection.getAdministrators().equals(group))     return GROUP_TYPE_ADMIN;
 else     if (collection.getSubmitters() != null && collection.getSubmitters().equals(group))     return GROUP_TYPE_SUBMIT;
 else     if (collection.getWorkflowGroup(1) != null && collection.getWorkflowGroup(1).equals(group))     return GROUP_TYPE_WORKFLOW_STEP_1;
 else     if (collection.getWorkflowGroup(2) != null && collection.getWorkflowGroup(2).equals(group))     return GROUP_TYPE_WORKFLOW_STEP_2;
 else     if (collection.getWorkflowGroup(3) != null && collection.getWorkflowGroup(3).equals(group))     return GROUP_TYPE_WORKFLOW_STEP_3;
  }
  return null;
}
Program: 3274
Project: 3274
Buggy source:
/** 
 * Find the eperson by their email address
 * @return EPerson
 */
public static EPerson findByEmail(Context context,String email) throws SQLException, AuthorizeException {
  TableRow row=DatabaseManager.findByUnique(context,"String_Node_Str","String_Node_Str",email);
  if (row == null) {
    return null;
  }
 else {
    EPerson fromCache=(EPerson)context.fromCache(EPerson.class,row.getIntColumn("String_Node_Str"));
    if (fromCache != null) {
      return fromCache;
    }
 else {
      return new EPerson(context,row);
    }
  }
}

Fixed version (ground truth):
/** 
 * Find the eperson by their email address
 * @return EPerson
 */
public static EPerson findByEmail(Context context,String email) throws SQLException, AuthorizeException {
  if (email == null) {
    return null;
  }
  TableRow row=DatabaseManager.findByUnique(context,"String_Node_Str","String_Node_Str",email.toLowerCase());
  if (row == null) {
    return null;
  }
 else {
    EPerson fromCache=(EPerson)context.fromCache(EPerson.class,row.getIntColumn("String_Node_Str"));
    if (fromCache != null) {
      return fromCache;
    }
 else {
      return new EPerson(context,row);
    }
  }
}
Program: 3276
Project: 3276
Buggy source:
private synchronized String toStringInternal(){
  if (granularity == DateGran.YEAR)   return yearIso.format(calendar.getTime());
 else   if (granularity == DateGran.MONTH)   return yearMonthIso.format(calendar.getTime());
 else   if (granularity == DateGran.DAY)   return dateIso.format(calendar.getTime());
 else   return fullIso.format(calendar.getTime());
}

Fixed version (ground truth):
private synchronized String toStringInternal(){
  if (granularity == DateGran.YEAR)   return String.format("String_Node_Str",getYear());
 else   if (granularity == DateGran.MONTH)   return String.format("String_Node_Str",getYear(),getMonth());
 else   if (granularity == DateGran.DAY)   return String.format("String_Node_Str",getYear(),getMonth(),getDay());
 else   return fullIso.format(calendar.getTime());
}
Program: 3277
Project: 3277
Buggy source:
/** 
 * Construct a date from a Dublin Core value
 * @param fromDC the date string, in ISO 8601 (no timezone, always use UTC/GMT)
 */
public DCDate(String fromDC){
  super();
  if ((fromDC == null) || fromDC.equals("String_Node_Str")) {
    return;
  }
  granularity=DateGran.TIME;
  Date date=tryParse(fullIso,fromDC);
  if (date == null)   date=tryParse(fullIso2,fromDC);
  if (date == null)   date=tryParse(fullIso3,fromDC);
  if (date == null) {
    date=tryParse(dateIso,fromDC);
    granularity=DateGran.DAY;
  }
  if (date == null) {
    date=tryParse(yearMonthIso,fromDC);
    granularity=DateGran.MONTH;
  }
  if (date == null) {
    date=tryParse(yearIso,fromDC);
    granularity=DateGran.YEAR;
  }
  if (date == null)   log.warn("String_Node_Str" + fromDC + "String_Node_Str");
 else   setTime(date);
}

Fixed version (ground truth):
/** 
 * Construct a date from a Dublin Core value
 * @param fromDC the date string, in ISO 8601 (no timezone, always use UTC/GMT)
 */
public DCDate(String fromDC){
  super();
  if ((fromDC == null) || fromDC.equals("String_Node_Str")) {
    return;
  }
  granularity=DateGran.TIME;
  Date date=tryParse(fullIso,fromDC);
  if (date == null)   date=tryParse(fullIso2,fromDC);
  if (date == null)   date=tryParse(fullIso3,fromDC);
  if (date == null) {
    date=tryParse(dateIso,fromDC);
    if (date != null) {
      long ldate=date.getTime();
      date=new Date(ldate - localZone.getOffset(ldate));
      granularity=DateGran.DAY;
    }
  }
  if (date == null) {
    date=tryParse(yearMonthIso,fromDC);
    if (date != null) {
      long ldate=date.getTime();
      date=new Date(ldate - localZone.getOffset(ldate));
      granularity=DateGran.MONTH;
    }
  }
  if (date == null) {
    date=tryParse(yearIso,fromDC);
    if (date != null) {
      long ldate=date.getTime();
      date=new Date(ldate - localZone.getOffset(ldate));
      granularity=DateGran.YEAR;
    }
  }
  if (date == null)   log.warn("String_Node_Str" + fromDC + "String_Node_Str");
 else   setTime(date);
}
Program: 3288
Project: 3288
Buggy source:
public void addBody(Body body) throws WingException {
  Division updated=body.addDivision("String_Node_Str","String_Node_Str");
  updated.setHead(T_head);
  updated.addPara(T_para1);
  updated.addPara().addXref(contextPath,T_go_home);
}

Fixed version (ground truth):
public void addBody(Body body) throws WingException {
  Division updated=body.addDivision("String_Node_Str","String_Node_Str");
  updated.setHead(T_head);
  updated.addPara(T_para1);
  updated.addPara().addXref(contextPath + "String_Node_Str",T_go_home);
}
Program: 3289
Project: 3289
Buggy source:
/** 
 * Interpret named event type.
 * @param text name of event type.
 * @returns numeric value of event type or 0 for error.
 */
public static int parseEventType(String s){
  if (s.equals("String_Node_Str") | s.equalsIgnoreCase("String_Node_Str")) {
    int result=0;
    for (int i=0; i < eventTypeText.length; ++i)     result|=(1 << i);
    return result;
  }
  for (int i=0; i < eventTypeText.length; ++i)   if (eventTypeText[i].equalsIgnoreCase(s))   return 1 << i;
  return 0;
}

Fixed version (ground truth):
/** 
 * Interpret named event type.
 * @param text name of event type.
 * @returns numeric value of event type or 0 for error.
 */
public static int parseEventType(String s){
  if ("String_Node_Str".equals(s) || "String_Node_Str".equalsIgnoreCase(s)) {
    int result=0;
    for (int i=0; i < eventTypeText.length; ++i)     result|=(1 << i);
    return result;
  }
  for (int i=0; i < eventTypeText.length; ++i)   if (eventTypeText[i].equalsIgnoreCase(s))   return 1 << i;
  return 0;
}
Program: 3290
Project: 3290
Buggy source:
/** 
 * Translate a textual DSpace Object type name into an event subject-type mask. NOTE: This returns a BIT-MASK, not a numeric type value; the mask is only used within the event system.
 * @param s text name of object type.
 * @returns numeric value of object type or 0 for error.
 */
public static int parseObjectType(String s){
  if (s.equals("String_Node_Str") | s.equalsIgnoreCase("String_Node_Str"))   return ALL_OBJECTS_MASK;
 else {
    int id=Constants.getTypeID(s.toUpperCase());
    if (id >= 0)     return 1 << id;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Translate a textual DSpace Object type name into an event subject-type mask. NOTE: This returns a BIT-MASK, not a numeric type value; the mask is only used within the event system.
 * @param s text name of object type.
 * @returns numeric value of object type or 0 for error.
 */
public static int parseObjectType(String s){
  if ("String_Node_Str".equals(s) || "String_Node_Str".equalsIgnoreCase(s))   return ALL_OBJECTS_MASK;
 else {
    int id=Constants.getTypeID(s.toUpperCase());
    if (id >= 0)     return 1 << id;
  }
  return 0;
}
Program: 3291
Project: 3291
Buggy source:
private void sendFile(HttpServletRequest request,HttpServletResponse response,String file,String mimeType,boolean compressed) throws ServletException, IOException {
  File f=new File(ConfigurationManager.getProperty("String_Node_Str"),file);
  if (!f.exists()) {
    response.setStatus(HttpServletResponse.SC_NOT_FOUND);
    JSPManager.showJSP(request,response,"String_Node_Str");
    return;
  }
  long lastMod=f.lastModified();
  response.setDateHeader("String_Node_Str",lastMod);
  long modSince=request.getDateHeader("String_Node_Str");
  if (modSince != -1 && lastMod < modSince) {
    response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
    return;
  }
  if (compressed) {
    response.setHeader("String_Node_Str","String_Node_Str");
  }
  InputStream is=new FileInputStream(f);
  response.setContentType(mimeType);
  response.setHeader("String_Node_Str",String.valueOf(f.length()));
  Utils.bufferedCopy(is,response.getOutputStream());
  is.close();
  response.getOutputStream().flush();
}

Fixed version (ground truth):
private void sendFile(HttpServletRequest request,HttpServletResponse response,String file,String mimeType,boolean compressed) throws ServletException, IOException {
  File f=new File(ConfigurationManager.getProperty("String_Node_Str"),file);
  if (!f.exists()) {
    response.setStatus(HttpServletResponse.SC_NOT_FOUND);
    JSPManager.showJSP(request,response,"String_Node_Str");
    return;
  }
  long lastMod=f.lastModified();
  response.setDateHeader("String_Node_Str",lastMod);
  long modSince=request.getDateHeader("String_Node_Str");
  if (modSince != -1 && lastMod < modSince) {
    response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
    return;
  }
  if (compressed) {
    response.setHeader("String_Node_Str","String_Node_Str");
  }
  InputStream is=new FileInputStream(f);
  try {
    response.setContentType(mimeType);
    response.setHeader("String_Node_Str",String.valueOf(f.length()));
    Utils.bufferedCopy(is,response.getOutputStream());
  }
  finally {
    is.close();
  }
  response.getOutputStream().flush();
}
Program: 3293
Project: 3293
Buggy source:
/** 
 * Sets the cause1 value for this LNIRemoteException.
 * @param cause1
 */
public void setCause1(java.lang.Object cause1){
  this.cause1=cause1;
}

Fixed version (ground truth):
/** 
 * Sets the cause1 value for this LNIRemoteException.
 * @param cause1
 */
public synchronized void setCause1(java.lang.Object cause1){
  this.cause1=cause1;
}
Program: 3294
Project: 3294
Buggy source:
public synchronized boolean equals(java.lang.Object obj){
  if (!(obj instanceof LNIRemoteException))   return false;
  LNIRemoteException other=(LNIRemoteException)obj;
  if (obj == null)   return false;
  if (this == obj)   return true;
  if (__equalsCalc != null) {
    return (__equalsCalc == obj);
  }
  __equalsCalc=obj;
  boolean _equals;
  _equals=true && ((this.cause1 == null && other.getCause1() == null) || (this.cause1 != null && this.cause1.equals(other.getCause1()))) && ((this.message1 == null && other.getMessage1() == null) || (this.message1 != null && this.message1.equals(other.getMessage1())));
  __equalsCalc=null;
  return _equals;
}

Fixed version (ground truth):
public synchronized boolean equals(java.lang.Object obj){
  if (!(obj instanceof LNIRemoteException))   return false;
  LNIRemoteException other=(LNIRemoteException)obj;
  if (this == obj)   return true;
  if (__equalsCalc != null) {
    return (__equalsCalc == obj);
  }
  __equalsCalc=obj;
  boolean _equals;
  _equals=true && ((this.cause1 == null && other.getCause1() == null) || (this.cause1 != null && this.cause1.equals(other.getCause1()))) && ((this.message1 == null && other.getMessage1() == null) || (this.message1 != null && this.message1.equals(other.getMessage1())));
  __equalsCalc=null;
  return _equals;
}
Program: 3295
Project: 3295
Buggy source:
/** 
 * Gets the cause1 value for this LNIRemoteException.
 * @return cause1
 */
public java.lang.Object getCause1(){
  return cause1;
}

Fixed version (ground truth):
/** 
 * Gets the cause1 value for this LNIRemoteException.
 * @return cause1
 */
public synchronized java.lang.Object getCause1(){
  return cause1;
}
Program: 3296
Project: 3296
Buggy source:
/** 
 * Sets the message1 value for this LNIRemoteException.
 * @param message1
 */
public void setMessage1(java.lang.String message1){
  this.message1=message1;
}

Fixed version (ground truth):
/** 
 * Sets the message1 value for this LNIRemoteException.
 * @param message1
 */
public synchronized void setMessage1(java.lang.String message1){
  this.message1=message1;
}
Program: 3297
Project: 3297
Buggy source:
/** 
 * Gets the message1 value for this LNIRemoteException.
 * @return message1
 */
public java.lang.String getMessage1(){
  return message1;
}

Fixed version (ground truth):
/** 
 * Gets the message1 value for this LNIRemoteException.
 * @return message1
 */
public synchronized java.lang.String getMessage1(){
  return message1;
}
Program: 3298
Project: 3298
Buggy source:
/** 
 * @param elements
 * @param attributes
 * @return
 */
protected SwordValidationInfo validate(SwordValidationInfo info,Properties validationContext){
  if (errorURI == null) {
    info.addValidationInfo(new SwordValidationInfo(xmlName,ATTRIBUTE_HREF_NAME,SwordValidationInfo.MISSING_ATTRIBUTE_WARNING,SwordValidationInfoType.WARNING));
  }
 else {
    boolean validUri=true;
    if (errorURI.startsWith("String_Node_Str")) {
      if (!(errorURI.equals(ErrorCodes.ERROR_CONTENT) | errorURI.equals(ErrorCodes.ERROR_CHECKSUM_MISMATCH) | errorURI.equals(ErrorCodes.ERROR_BAD_REQUEST)| errorURI.equals(ErrorCodes.TARGET_OWNER_UKNOWN)| errorURI.equals(ErrorCodes.MEDIATION_NOT_ALLOWED))) {
        info.addValidationInfo(new SwordValidationInfo(xmlName,ATTRIBUTE_HREF_NAME,"String_Node_Str",SwordValidationInfoType.ERROR));
        validUri=false;
      }
    }
    if (validUri) {
      SwordValidationInfo item=new SwordValidationInfo(xmlName,ATTRIBUTE_HREF_NAME);
      item.setContentDescription(errorURI);
      info.addAttributeValidationInfo(item);
    }
  }
  return info;
}

Fixed version (ground truth):
/** 
 * @param elements
 * @param attributes
 * @return
 */
protected SwordValidationInfo validate(SwordValidationInfo info,Properties validationContext){
  if (errorURI == null) {
    info.addValidationInfo(new SwordValidationInfo(xmlName,ATTRIBUTE_HREF_NAME,SwordValidationInfo.MISSING_ATTRIBUTE_WARNING,SwordValidationInfoType.WARNING));
  }
 else {
    boolean validUri=true;
    if (errorURI.startsWith("String_Node_Str")) {
      if (!(errorURI.equals(ErrorCodes.ERROR_CONTENT) || errorURI.equals(ErrorCodes.ERROR_CHECKSUM_MISMATCH) || errorURI.equals(ErrorCodes.ERROR_BAD_REQUEST)|| errorURI.equals(ErrorCodes.TARGET_OWNER_UKNOWN)|| errorURI.equals(ErrorCodes.MEDIATION_NOT_ALLOWED))) {
        info.addValidationInfo(new SwordValidationInfo(xmlName,ATTRIBUTE_HREF_NAME,"String_Node_Str",SwordValidationInfoType.ERROR));
        validUri=false;
      }
    }
    if (validUri) {
      SwordValidationInfo item=new SwordValidationInfo(xmlName,ATTRIBUTE_HREF_NAME);
      item.setContentDescription(errorURI);
      info.addAttributeValidationInfo(item);
    }
  }
  return info;
}
Program: 3301
Project: 3301
Buggy source:
public String getServletPath(){
  return this.getServletPath();
}

Fixed version (ground truth):
public String getServletPath(){
  return this.cocoonRequest.getServletPath();
}
Program: 3302
Project: 3302
Buggy source:
public String getRequestURI(){
  return this.getRequestURI();
}

Fixed version (ground truth):
public String getRequestURI(){
  return this.cocoonRequest.getRequestURI();
}
Program: 3303
Project: 3303
Buggy source:
public String getRemoteUser(){
  return this.getRemoteUser();
}

Fixed version (ground truth):
public String getRemoteUser(){
  return this.cocoonRequest.getRemoteUser();
}
Program: 3304
Project: 3304
Buggy source:
public HttpSession getSession(boolean arg0){
  return this.getSession(arg0);
}

Fixed version (ground truth):
public HttpSession getSession(boolean arg0){
  return (HttpSession)this.cocoonRequest.getSession(arg0);
}
Program: 3305
Project: 3305
Buggy source:
public Map act(Redirector redirector,SourceResolver resolver,Map objectModel,String source,Parameters parameters) throws Exception {
  Map<String,String> map=new HashMap<String,String>();
  String propertyFile=parameters.getParameter("String_Node_Str");
  Properties props=new Properties();
  InputStream in=new FileInputStream(propertyFile);
  props.load(in);
  in.close();
  final String[] parameterNames=parameters.getNames();
  for (int i=0; i < parameterNames.length; i++) {
    final String paramName=parameterNames[i];
    if ("String_Node_Str".equals(paramName)) {
      continue;
    }
    map.put(parameters.getParameter(paramName),props.getProperty(paramName));
  }
  return map;
}

Fixed version (ground truth):
public Map act(Redirector redirector,SourceResolver resolver,Map objectModel,String source,Parameters parameters) throws Exception {
  Map<String,String> map=new HashMap<String,String>();
  String propertyFile=parameters.getParameter("String_Node_Str");
  Properties props=new Properties();
  InputStream in=new FileInputStream(propertyFile);
  try {
    props.load(in);
  }
  finally {
    in.close();
  }
  final String[] parameterNames=parameters.getNames();
  for (int i=0; i < parameterNames.length; i++) {
    final String paramName=parameterNames[i];
    if ("String_Node_Str".equals(paramName)) {
      continue;
    }
    map.put(parameters.getParameter(paramName),props.getProperty(paramName));
  }
  return map;
}
Program: 3308
Project: 3308
Buggy source:
/** 
 * Compare these two activity events based upon the given sort parameter. In the case of a tie, allways fallback to sorting based upon the timestamp.
 */
public int compare(E a,E b){
  if (EventSort.URL == sortBy) {
    String aURL=a.getURL();
    String bURL=b.getURL();
    int cmp=aURL.compareTo(bURL);
    if (cmp != 0)     return cmp;
  }
 else   if (EventSort.AGENT == sortBy) {
    String aAgent=a.getDectectedBrowser();
    String bAgent=b.getDectectedBrowser();
    int cmp=aAgent.compareTo(bAgent);
    if (cmp != 0)     return cmp;
  }
 else   if (EventSort.IP == sortBy) {
    String aIP=a.getIP();
    String bIP=b.getIP();
    int cmp=aIP.compareTo(bIP);
    if (cmp != 0)     return cmp;
  }
 else   if (EventSort.SESSION == sortBy) {
    String aSession=a.getSessionID();
    String bSession=b.getSessionID();
    int cmp=aSession.compareTo(bSession);
    if (cmp != 0)     return cmp;
  }
  if (a.getTimeStamp() > b.getTimeStamp())   return 1;
 else   if (a.getTimeStamp() > b.getTimeStamp())   return -1;
  return 0;
}

Fixed version (ground truth):
/** 
 * Compare these two activity events based upon the given sort parameter. In the case of a tie, allways fallback to sorting based upon the timestamp.
 */
public int compare(E a,E b){
  if (a != null && b == null)   return 1;
 else   if (a == null && b != null)   return -1;
 else   if (a == null && b == null)   return 0;
  if (EventSort.URL == sortBy) {
    String aURL=a.getURL();
    String bURL=b.getURL();
    int cmp=aURL.compareTo(bURL);
    if (cmp != 0)     return cmp;
  }
 else   if (EventSort.AGENT == sortBy) {
    String aAgent=a.getDectectedBrowser();
    String bAgent=b.getDectectedBrowser();
    int cmp=aAgent.compareTo(bAgent);
    if (cmp != 0)     return cmp;
  }
 else   if (EventSort.IP == sortBy) {
    String aIP=a.getIP();
    String bIP=b.getIP();
    int cmp=aIP.compareTo(bIP);
    if (cmp != 0)     return cmp;
  }
 else   if (EventSort.SESSION == sortBy) {
    if (a.getEPersonID() > 0 && b.getEPersonID() < 0)     return 1;
 else     if (a.getEPersonID() < 0 && b.getEPersonID() > 0)     return -1;
    String aSession=a.getSessionID();
    String bSession=b.getSessionID();
    int cmp=aSession.compareTo(bSession);
    if (cmp != 0)     return cmp;
  }
  if (a.getTimeStamp() > b.getTimeStamp())   return 1;
 else   if (a.getTimeStamp() > b.getTimeStamp())   return -1;
  return 0;
}
Program: 3310
Project: 3310
Buggy source:
/** 
 * @return a list of all current events.
 */
public static List<Event> getEvents(){
  List<Event> list=new ArrayList<Event>();
  list.addAll(events);
  return list;
}

Fixed version (ground truth):
/** 
 * @return a list of all current events.
 */
public static List<Event> getEvents(){
  List<Event> list=new ArrayList<Event>();
synchronized (events) {
    list.addAll(events);
  }
  return list;
}
Program: 3311
Project: 3311
Buggy source:
/** 
 * Record this current event.
 */
public Map act(Redirector redirector,SourceResolver resolver,Map objectModel,String source,Parameters parameters) throws Exception {
  Request request=ObjectModelHelper.getRequest(objectModel);
  Context context=ContextUtil.obtainContext(objectModel);
  Event event=new Event(context,request);
  events.add(event);
  while (events.size() > MAX_EVENTS)   events.poll();
  return null;
}

Fixed version (ground truth):
/** 
 * Record this current event.
 */
public Map act(Redirector redirector,SourceResolver resolver,Map objectModel,String source,Parameters parameters) throws Exception {
  Request request=ObjectModelHelper.getRequest(objectModel);
  Context context=ContextUtil.obtainContext(objectModel);
synchronized (events) {
    Event event=new Event(context,request);
    events.add(event);
    while (events.size() > MAX_EVENTS)     events.poll();
  }
  return null;
}
Program: 3315
Project: 3315
Buggy source:
/** 
 * Get repeated values from a form. If "foo" is passed in as the parameter, values in the form of parameters "foo", "foo_1", "foo_2", etc. are returned. <P> This method can also handle "composite fields" (metadata fields which may require multiple params, etc. a first name and last name).
 * @param request the HTTP request containing the form information
 * @param metadataField the metadata field which can store repeated values
 * @param param the repeated parameter on the page (used to fill out the metadataField)
 * @return a List of Strings
 */
protected List getRepeatedParameter(HttpServletRequest request,String metadataField,String param){
  List vals=new LinkedList();
  int i=0;
  boolean foundLast=false;
  log.debug("String_Node_Str" + metadataField + "String_Node_Str"+ metadataField);
  while (!foundLast) {
    String s=null;
    if (i == 0)     s=request.getParameter(param);
 else     s=request.getParameter(param + "String_Node_Str" + i);
    if (s != null) {
      boolean addValue=true;
      String[] selected=request.getParameterValues(metadataField + "String_Node_Str");
      if (selected != null) {
        for (int j=0; j < selected.length; j++) {
          if (selected[j].equals(metadataField + "String_Node_Str" + i)) {
            addValue=false;
          }
        }
      }
      if (addValue)       vals.add(s.trim());
    }
 else {
      foundLast=true;
    }
    i++;
  }
  return vals;
}

Fixed version (ground truth):
/** 
 * Get repeated values from a form. If "foo" is passed in as the parameter, values in the form of parameters "foo", "foo_1", "foo_2", etc. are returned. <P> This method can also handle "composite fields" (metadata fields which may require multiple params, etc. a first name and last name).
 * @param request the HTTP request containing the form information
 * @param metadataField the metadata field which can store repeated values
 * @param param the repeated parameter on the page (used to fill out the metadataField)
 * @return a List of Strings
 */
protected List getRepeatedParameter(HttpServletRequest request,String metadataField,String param){
  List vals=new LinkedList();
  int i=1;
  boolean foundLast=false;
  log.debug("String_Node_Str" + metadataField + "String_Node_Str"+ metadataField);
  while (!foundLast) {
    String s=null;
    s=request.getParameter(param + "String_Node_Str" + i);
    if (s == null) {
      s=request.getParameter(param);
      foundLast=true;
    }
    if (s != null) {
      boolean addValue=true;
      String[] selected=request.getParameterValues(metadataField + "String_Node_Str");
      if (selected != null) {
        for (int j=0; j < selected.length; j++) {
          if (selected[j].equals(metadataField + "String_Node_Str" + i)) {
            addValue=false;
          }
        }
      }
      if (addValue)       vals.add(s.trim());
    }
    i++;
  }
  return vals;
}
Program: 3316
Project: 3316
Buggy source:
/** 
 * Decode the given string from URL transmission.
 * @param encodedString The encoded string.
 * @return The unencoded string
 */
public static String URLDecode(String encodedString) throws UIException {
  if (encodedString == null)   return null;
  try {
    return URLDecoder.decode(encodedString,Constants.DEFAULT_ENCODING);
  }
 catch (  UnsupportedEncodingException uee) {
    throw new UIException(uee);
  }
}

Fixed version (ground truth):
/** 
 * Decode the given string from URL transmission.
 * @param encodedString The encoded string.
 * @return The unencoded string
 */
public static String URLDecode(String encodedString) throws UIException {
  if (encodedString == null)   return null;
  try {
    if (encodedString.contains("String_Node_Str")) {
      encodedString=encodedString.replace("String_Node_Str","String_Node_Str");
    }
    return URLDecoder.decode(encodedString,Constants.DEFAULT_ENCODING);
  }
 catch (  UnsupportedEncodingException uee) {
    throw new UIException(uee);
  }
}
Program: 3318
Project: 3318
Buggy source:
/** 
 * Get the file size of the export archive represented by the file name
 * @param fileName name of the file to get the size
 * @param eperson the eperson requesting file
 * @return
 * @throws Exception
 */
public static long getExportFileSize(String fileName) throws Exception {
  String strID=fileName.substring(fileName.lastIndexOf('_') + 1,fileName.lastIndexOf('.'));
  File file=new File(getExportDownloadDirectory(Integer.parseInt(strID)) + System.getProperty("String_Node_Str") + fileName);
  if (!file.exists() || !file.isFile()) {
    throw new FileNotFoundException("String_Node_Str" + getExportDownloadDirectory(Integer.parseInt(strID)) + System.getProperty("String_Node_Str")+ fileName+ "String_Node_Str");
  }
  return file.length();
}

Fixed version (ground truth):
/** 
 * Get the file size of the export archive represented by the file name
 * @param fileName name of the file to get the size
 * @return
 * @throws Exception
 */
public static long getExportFileSize(String fileName) throws Exception {
  String strID=fileName.substring(fileName.lastIndexOf('_') + 1,fileName.lastIndexOf('.'));
  File file=new File(getExportDownloadDirectory(Integer.parseInt(strID)) + System.getProperty("String_Node_Str") + fileName);
  if (!file.exists() || !file.isFile()) {
    throw new FileNotFoundException("String_Node_Str" + getExportDownloadDirectory(Integer.parseInt(strID)) + System.getProperty("String_Node_Str")+ fileName+ "String_Node_Str");
  }
  return file.length();
}
Program: 3319
Project: 3319
Buggy source:
/** 
 * Since the archive is created in a new thread we are unable to communicate with calling method about success or failure. We accomplis this communication with email instead. Send an error email if the export archive fails
 * @param toMail -email to send message to
 * @param fromMail -email for the from field
 * @param ccMail -carbon copy email
 * @param fileName -the file name to be downloaded. It is added to the url in the email
 * @throws MessagingException
 */
public static void emailErrorMessage(String toMail,String fromMail,String ccMail,String error) throws MessagingException {
  StringBuffer content=new StringBuffer();
  content.append("String_Node_Str");
  content.append(System.getProperty("String_Node_Str"));
  content.append(System.getProperty("String_Node_Str"));
  content.append("String_Node_Str");
  content.append(System.getProperty("String_Node_Str"));
  content.append(System.getProperty("String_Node_Str"));
  content.append("String_Node_Str");
  content.append(error);
  content.append(System.getProperty("String_Node_Str"));
  content.append(System.getProperty("String_Node_Str"));
  content.append("String_Node_Str");
  sendMessage(toMail,fromMail,ccMail,"String_Node_Str",content);
}

Fixed version (ground truth):
/** 
 * Since the archive is created in a new thread we are unable to communicate with calling method about success or failure. We accomplis this communication with email instead. Send an error email if the export archive fails
 * @param toMail -email to send message to
 * @param fromMail -email for the from field
 * @param ccMail -carbon copy email
 * @param error -the error message
 * @throws MessagingException
 */
public static void emailErrorMessage(String toMail,String fromMail,String ccMail,String error) throws MessagingException {
  StringBuffer content=new StringBuffer();
  content.append("String_Node_Str");
  content.append(System.getProperty("String_Node_Str"));
  content.append(System.getProperty("String_Node_Str"));
  content.append("String_Node_Str");
  content.append(System.getProperty("String_Node_Str"));
  content.append(System.getProperty("String_Node_Str"));
  content.append("String_Node_Str");
  content.append(error);
  content.append(System.getProperty("String_Node_Str"));
  content.append(System.getProperty("String_Node_Str"));
  content.append("String_Node_Str");
  sendMessage(toMail,fromMail,ccMail,"String_Node_Str",content);
}
Program: 3320
Project: 3320
Buggy source:
public void run(){
  Context context;
  ItemIterator iitems=null;
  try {
    context=new Context();
    context.setIgnoreAuthorization(true);
    iitems=new ItemIterator(context,items);
    String fileName=assembleFileName("String_Node_Str",eperson,new Date());
    String workDir=getExportWorkDirectory() + System.getProperty("String_Node_Str") + fileName;
    String downloadDir=getExportDownloadDirectory(eperson.getID());
    File wkDir=new File(workDir);
    if (!wkDir.exists()) {
      wkDir.mkdirs();
    }
    File dnDir=new File(downloadDir);
    if (!dnDir.exists()) {
      dnDir.mkdirs();
    }
    exportItem(context,iitems,workDir,1);
    zip(workDir,downloadDir + System.getProperty("String_Node_Str") + fileName+ "String_Node_Str");
    emailSuccessMessage(context,eperson,fileName + "String_Node_Str");
    context.setIgnoreAuthorization(false);
  }
 catch (  Exception e1) {
    try {
      emailErrorMessage(eperson,e1.getMessage());
    }
 catch (    Exception e) {
    }
    throw new RuntimeException(e1);
  }
 finally {
    if (iitems != null)     iitems.close();
  }
}

Fixed version (ground truth):
public void run(){
  Context context=null;
  ItemIterator iitems=null;
  try {
    context=new Context();
    context.setIgnoreAuthorization(true);
    iitems=new ItemIterator(context,items);
    String fileName=assembleFileName("String_Node_Str",eperson,new Date());
    String workDir=getExportWorkDirectory() + System.getProperty("String_Node_Str") + fileName;
    String downloadDir=getExportDownloadDirectory(eperson.getID());
    File wkDir=new File(workDir);
    if (!wkDir.exists()) {
      wkDir.mkdirs();
    }
    File dnDir=new File(downloadDir);
    if (!dnDir.exists()) {
      dnDir.mkdirs();
    }
    exportItem(context,iitems,workDir,1);
    zip(workDir,downloadDir + System.getProperty("String_Node_Str") + fileName+ "String_Node_Str");
    emailSuccessMessage(context,eperson,fileName + "String_Node_Str");
    context.setIgnoreAuthorization(false);
  }
 catch (  Exception e1) {
    try {
      emailErrorMessage(eperson,e1.getMessage());
    }
 catch (    Exception e) {
    }
    throw new RuntimeException(e1);
  }
 finally {
    if (iitems != null)     iitems.close();
    try {
      context.complete();
    }
 catch (    SQLException sqle) {
      context.abort();
    }
  }
}