nus-yam/ex-repair huggingface dataset:
Program: 28618
Project: 28618
Buggy source:
/** 
 * Process our request and locate right SSI command.
 * @param req a value of type 'HttpServletRequest'
 * @param res a value of type 'HttpServletResponse'
 */
protected void requestHandler(HttpServletRequest req,HttpServletResponse res) throws IOException, ServletException {
  ServletContext servletContext=getServletContext();
  String path=SSIServletRequestUtil.getRelativePath(req);
  if (debug > 0)   log("String_Node_Str" + "String_Node_Str" + (buffered ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ path+ "String_Node_Str");
  HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
  if (path == null || path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str") || path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str")) {
    res.sendError(HttpServletResponse.SC_NOT_FOUND,htmlEntityEncoder.encode(path));
    log("String_Node_Str" + path);
    return;
  }
  URL resource=servletContext.getResource(path);
  if (resource == null) {
    res.sendError(HttpServletResponse.SC_NOT_FOUND,htmlEntityEncoder.encode(path));
    log("String_Node_Str" + path);
    return;
  }
  String resourceMimeType=servletContext.getMimeType(path);
  if (resourceMimeType == null) {
    resourceMimeType="String_Node_Str";
  }
  res.setContentType(resourceMimeType + "String_Node_Str" + outputEncoding);
  if (expires != null) {
    res.setDateHeader("String_Node_Str",(new java.util.Date()).getTime() + expires.longValue() * 1000);
  }
  req.setAttribute(Globals.SSI_FLAG_ATTR,"String_Node_Str");
  processSSI(req,res,resource,htmlEntityEncoder);
}

Fixed version (ground truth):
/** 
 * Process our request and locate right SSI command.
 * @param req a value of type 'HttpServletRequest'
 * @param res a value of type 'HttpServletResponse'
 */
protected void requestHandler(HttpServletRequest req,HttpServletResponse res) throws IOException, ServletException {
  ServletContext servletContext=getServletContext();
  String path=SSIServletRequestUtil.getRelativePath(req);
  if (debug > 0)   log("String_Node_Str" + "String_Node_Str" + (buffered ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ path+ "String_Node_Str");
  if (path == null || path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str") || path.toUpperCase(Locale.ENGLISH).startsWith("String_Node_Str")) {
    res.sendError(HttpServletResponse.SC_NOT_FOUND,path);
    log("String_Node_Str" + path);
    return;
  }
  URL resource=servletContext.getResource(path);
  if (resource == null) {
    res.sendError(HttpServletResponse.SC_NOT_FOUND,path);
    log("String_Node_Str" + path);
    return;
  }
  String resourceMimeType=servletContext.getMimeType(path);
  if (resourceMimeType == null) {
    resourceMimeType="String_Node_Str";
  }
  res.setContentType(resourceMimeType + "String_Node_Str" + outputEncoding);
  if (expires != null) {
    res.setDateHeader("String_Node_Str",(new java.util.Date()).getTime() + expires.longValue() * 1000);
  }
  req.setAttribute(Globals.SSI_FLAG_ATTR,"String_Node_Str");
  processSSI(req,res,resource);
}
Program: 28619
Project: 28619
Buggy source:
protected void processSSI(HttpServletRequest req,HttpServletResponse res,URL resource,HtmlEntityEncoder htmlEntityEncoder) throws IOException {
  SSIExternalResolver ssiExternalResolver=new SSIServletExternalResolver(getServletContext(),req,res,isVirtualWebappRelative,debug,inputEncoding);
  SSIProcessor ssiProcessor=new SSIProcessor(ssiExternalResolver,debug,htmlEntityEncoder);
  PrintWriter printWriter=null;
  StringWriter stringWriter=null;
  if (buffered) {
    stringWriter=new StringWriter();
    printWriter=new PrintWriter(stringWriter);
  }
 else {
    printWriter=res.getWriter();
  }
  URLConnection resourceInfo=resource.openConnection();
  InputStream resourceInputStream=resourceInfo.getInputStream();
  String encoding=resourceInfo.getContentEncoding();
  if (encoding == null) {
    encoding=inputEncoding;
  }
  InputStreamReader isr;
  if (encoding == null) {
    isr=new InputStreamReader(resourceInputStream);
  }
 else {
    isr=new InputStreamReader(resourceInputStream,encoding);
  }
  BufferedReader bufferedReader=new BufferedReader(isr);
  long lastModified=ssiProcessor.process(bufferedReader,resourceInfo.getLastModified(),printWriter);
  if (lastModified > 0) {
    res.setDateHeader("String_Node_Str",lastModified);
  }
  if (buffered) {
    printWriter.flush();
    String text=stringWriter.toString();
    res.getWriter().write(text);
  }
}

Fixed version (ground truth):
protected void processSSI(HttpServletRequest req,HttpServletResponse res,URL resource) throws IOException {
  SSIExternalResolver ssiExternalResolver=new SSIServletExternalResolver(getServletContext(),req,res,isVirtualWebappRelative,debug,inputEncoding);
  SSIProcessor ssiProcessor=new SSIProcessor(ssiExternalResolver,debug,new HtmlEntityEncoder());
  PrintWriter printWriter=null;
  StringWriter stringWriter=null;
  if (buffered) {
    stringWriter=new StringWriter();
    printWriter=new PrintWriter(stringWriter);
  }
 else {
    printWriter=res.getWriter();
  }
  URLConnection resourceInfo=resource.openConnection();
  InputStream resourceInputStream=resourceInfo.getInputStream();
  String encoding=resourceInfo.getContentEncoding();
  if (encoding == null) {
    encoding=inputEncoding;
  }
  InputStreamReader isr;
  if (encoding == null) {
    isr=new InputStreamReader(resourceInputStream);
  }
 else {
    isr=new InputStreamReader(resourceInputStream,encoding);
  }
  BufferedReader bufferedReader=new BufferedReader(isr);
  long lastModified=ssiProcessor.process(bufferedReader,resourceInfo.getLastModified(),printWriter);
  if (lastModified > 0) {
    res.setDateHeader("String_Node_Str",lastModified);
  }
  if (buffered) {
    printWriter.flush();
    String text=stringWriter.toString();
    res.getWriter().write(text);
  }
}
Program: 28621
Project: 28621
Buggy source:
/** 
 * initializes internal hash tables with Jar file resources. 
 */
private void init(String jarFileName){
  try {
    FileInputStream fis=new FileInputStream(jarFileName);
    BufferedInputStream bis=new BufferedInputStream(fis);
    ZipInputStream zis=new ZipInputStream(bis);
    extractResources(zis);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * initializes internal hash tables with Jar file resources. 
 */
private void init(String jarFileName){
  ZipInputStream zis=null;
  try {
    FileInputStream fis=new FileInputStream(jarFileName);
    BufferedInputStream bis=new BufferedInputStream(fis);
    zis=new ZipInputStream(bis);
    extractResources(zis);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
 finally {
    if (zis != null) {
      try {
        zis.close();
      }
 catch (      Exception e) {
      }
    }
  }
}
Program: 28622
Project: 28622
Buggy source:
public void receive_reply(ClientRequestInfo ri){
  ServiceContext sc=null;
  int status=-1;
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + prname + "String_Node_Str");
  }
  ORB orb=orbHelper.getORB();
  try {
    sc=ri.get_reply_service_context(SECURITY_ATTRIBUTE_SERVICE_ID);
    if (sc == null) {
      handle_null_service_context(ri);
      return;
    }
  }
 catch (  org.omg.CORBA.BAD_PARAM e) {
    handle_null_service_context(ri);
    return;
  }
catch (  Exception ex) {
    _logger.log(Level.SEVERE,"String_Node_Str",ex);
    return;
  }
  Any a;
  try {
    a=codec.decode_value(sc.context_data,SASContextBodyHelper.type());
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  SASContextBody sasctxbody=SASContextBodyHelper.extract(a);
  short sasdiscr=sasctxbody.discriminator();
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + SvcContextUtils.getMsgname(sasdiscr) + "String_Node_Str");
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str");
  }
  if ((sasdiscr != MTCompleteEstablishContext.value) && (sasdiscr != MTContextError.value)) {
    _logger.log(Level.SEVERE,"String_Node_Str");
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  int st=mapreplyStatus(ri.reply_status());
  setreplyStatus(st,ri.effective_target());
}

Fixed version (ground truth):
public void receive_reply(ClientRequestInfo ri){
  ServiceContext sc=null;
  int status=-1;
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + prname + "String_Node_Str");
  }
  try {
    sc=ri.get_reply_service_context(SECURITY_ATTRIBUTE_SERVICE_ID);
    if (sc == null) {
      handle_null_service_context(ri);
      return;
    }
  }
 catch (  org.omg.CORBA.BAD_PARAM e) {
    handle_null_service_context(ri);
    return;
  }
catch (  Exception ex) {
    _logger.log(Level.SEVERE,"String_Node_Str",ex);
    return;
  }
  Any a;
  try {
    a=codec.decode_value(sc.context_data,SASContextBodyHelper.type());
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  SASContextBody sasctxbody=SASContextBodyHelper.extract(a);
  short sasdiscr=sasctxbody.discriminator();
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + SvcContextUtils.getMsgname(sasdiscr) + "String_Node_Str");
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str");
  }
  if ((sasdiscr != MTCompleteEstablishContext.value) && (sasdiscr != MTContextError.value)) {
    _logger.log(Level.SEVERE,"String_Node_Str");
    throw new SecurityException(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
  }
  int st=mapreplyStatus(ri.reply_status());
  setreplyStatus(st,ri.effective_target());
}
Program: 28625
Project: 28625
Buggy source:
private List<URL> getModuleJarURLs(String installRoot){
  if (installRoot == null) {
    return new ArrayList();
  }
  try {
    JarFile jarfile=new JarFile(Which.jarFile(getClass()));
    String mainClassName=jarfile.getManifest().getMainAttributes().getValue("String_Node_Str");
    if (UberMain.class.getName().equals(mainClassName)) {
      return new ArrayList();
    }
  }
 catch (  Exception ex) {
    logger.warning(ex.getMessage());
  }
  File modulesDir=new File(installRoot,"String_Node_Str");
  final File autostartModulesDir=new File(modulesDir,"String_Node_Str");
  final List<URL> moduleJarURLs=new ArrayList<URL>();
  modulesDir.listFiles(new FileFilter(){
    public boolean accept(    File pathname){
      if (pathname.isDirectory() && !pathname.equals(autostartModulesDir)) {
        pathname.listFiles(this);
      }
 else       if (pathname.getName().endsWith(JAR_EXT) && !moduleExcludes.contains(pathname.getName())) {
        try {
          moduleJarURLs.add(pathname.toURI().toURL());
        }
 catch (        Exception ex) {
          logger.warning(ex.getMessage());
        }
      }
      return false;
    }
  }
);
  return moduleJarURLs;
}

Fixed version (ground truth):
private List<URL> getModuleJarURLs(String installRoot){
  if (installRoot == null) {
    return new ArrayList();
  }
  JarFile jarfile=null;
  try {
    jarfile=new JarFile(Which.jarFile(getClass()));
    String mainClassName=jarfile.getManifest().getMainAttributes().getValue("String_Node_Str");
    if (UberMain.class.getName().equals(mainClassName)) {
      return new ArrayList();
    }
  }
 catch (  Exception ex) {
    logger.warning(ex.getMessage());
  }
 finally {
    if (jarfile != null) {
      try {
        jarfile.close();
      }
 catch (      IOException ex) {
      }
    }
  }
  File modulesDir=new File(installRoot,"String_Node_Str");
  final File autostartModulesDir=new File(modulesDir,"String_Node_Str");
  final List<URL> moduleJarURLs=new ArrayList<URL>();
  modulesDir.listFiles(new FileFilter(){
    public boolean accept(    File pathname){
      if (pathname.isDirectory() && !pathname.equals(autostartModulesDir)) {
        pathname.listFiles(this);
      }
 else       if (pathname.getName().endsWith(JAR_EXT) && !moduleExcludes.contains(pathname.getName())) {
        try {
          moduleJarURLs.add(pathname.toURI().toURL());
        }
 catch (        Exception ex) {
          logger.warning(ex.getMessage());
        }
      }
      return false;
    }
  }
);
  return moduleJarURLs;
}
Program: 28627
Project: 28627
Buggy source:
/** 
 * Renders the default error page.
 */
private static void serveDefaultErrorPage(HttpServletRequest request,HttpServletResponse response,int statusCode) throws IOException, ServletException {
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (response.isCommitted() || statusCode < 400 || (reqFacHelper != null && reqFacHelper.getResponseContentCount() > 0) || Boolean.TRUE.equals(request.getAttribute("String_Node_Str"))) {
    return;
  }
  String message=null;
  if (reqFacHelper != null) {
    message=RequestUtil.filter(reqFacHelper.getResponseMessage());
  }
  if (message == null) {
    message="String_Node_Str";
  }
  String report=null;
  try {
    report=sm.getString("String_Node_Str" + statusCode,message);
  }
 catch (  Throwable t) {
    ;
  }
  if (report == null) {
    return;
  }
  String responseContents=ErrorReportValve.makeErrorPage(statusCode,message,null,null,report,response);
  response.setLocale(sm.getResourceBundleLocale(response.getLocale()));
  try {
    response.setContentType("String_Node_Str");
    response.getWriter().write(responseContents);
  }
 catch (  Throwable t) {
    log.log(Level.WARNING,EXCEPTION_SENDING_DEFAULT_ERROR_PAGE,t);
  }
}

Fixed version (ground truth):
/** 
 * Renders the default error page.
 */
private static void serveDefaultErrorPage(HttpServletRequest request,HttpServletResponse response,int statusCode) throws IOException, ServletException {
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (response.isCommitted() || statusCode < 400 || (reqFacHelper != null && reqFacHelper.getResponseContentCount() > 0) || Boolean.TRUE.equals(request.getAttribute("String_Node_Str"))) {
    return;
  }
  String message=null;
  if (reqFacHelper != null) {
    message=reqFacHelper.getResponseMessage();
  }
  if (message == null) {
    message="String_Node_Str";
  }
 else {
    HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
    message=htmlEntityEncoder.encode(message);
  }
  String report=null;
  try {
    report=sm.getString("String_Node_Str" + statusCode,message);
  }
 catch (  Throwable t) {
    ;
  }
  if (report == null) {
    return;
  }
  String responseContents=ErrorReportValve.makeErrorPage(statusCode,message,null,null,report,response);
  response.setLocale(sm.getResourceBundleLocale(response.getLocale()));
  try {
    response.setContentType("String_Node_Str");
    response.getWriter().write(responseContents);
  }
 catch (  Throwable t) {
    log.log(Level.WARNING,EXCEPTION_SENDING_DEFAULT_ERROR_PAGE,t);
  }
}
Program: 28628
Project: 28628
Buggy source:
private static boolean status(HttpServletRequest request,HttpServletResponse response,Context context,Wrapper wrapper,int statusCode){
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (reqFacHelper == null || !reqFacHelper.isResponseError()) {
    return false;
  }
  boolean matchFound=false;
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    matchFound=true;
    String requestPath=(String)request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
    if (requestPath == null || !requestPath.equals(errorPage.getLocation())) {
      String message=RequestUtil.filter(reqFacHelper.getResponseMessage());
      if (message == null) {
        message="String_Node_Str";
      }
      prepareRequestForDispatch(request,wrapper,errorPage.getLocation(),statusCode,message);
      custom(request,response,errorPage,context);
    }
  }
 else {
    errorPage=((StandardHost)context.getParent()).findErrorPage(statusCode);
    if (errorPage != null) {
      matchFound=true;
      try {
        serveErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        String msg=MessageFormat.format(rb.getString(EXCEPTION_PROCESSING),errorPage);
        log.log(Level.WARNING,msg,e);
      }
    }
  }
  return matchFound;
}

Fixed version (ground truth):
private static boolean status(HttpServletRequest request,HttpServletResponse response,Context context,Wrapper wrapper,int statusCode){
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (reqFacHelper == null || !reqFacHelper.isResponseError()) {
    return false;
  }
  boolean matchFound=false;
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    matchFound=true;
    String requestPath=(String)request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
    if (requestPath == null || !requestPath.equals(errorPage.getLocation())) {
      String message=reqFacHelper.getResponseMessage();
      if (message == null) {
        message="String_Node_Str";
      }
 else {
        HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
        message=htmlEntityEncoder.encode(message);
      }
      prepareRequestForDispatch(request,wrapper,errorPage.getLocation(),statusCode,message);
      custom(request,response,errorPage,context);
    }
  }
 else {
    errorPage=((StandardHost)context.getParent()).findErrorPage(statusCode);
    if (errorPage != null) {
      matchFound=true;
      try {
        serveErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        String msg=MessageFormat.format(rb.getString(EXCEPTION_PROCESSING),errorPage);
        log.log(Level.WARNING,msg,e);
      }
    }
  }
  return matchFound;
}
Program: 28629
Project: 28629
Buggy source:
private void dispatchToErrorPage(Request request,Response response,ErrorPage errorPage,Throwable throwable,Throwable realError,int statusCode){
  response.setAppCommitted(false);
  ServletRequest sreq=request.getRequest();
  ServletResponse sresp=response.getResponse();
  sreq.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,errorPage.getLocation());
  sreq.setAttribute(RequestDispatcher.ERROR_REQUEST_URI,((HttpServletRequest)sreq).getRequestURI());
  Wrapper wrapper=request.getWrapper();
  if (wrapper != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,wrapper.getName());
  }
  if (throwable != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,throwable.getMessage());
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION,realError);
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,realError.getClass());
  }
 else {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(statusCode));
    String message=RequestUtil.filter(((HttpResponse)response).getMessage());
    if (message == null) {
      message="String_Node_Str";
    }
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,message);
  }
  if (custom(request,response,errorPage)) {
    try {
      sresp.flushBuffer();
    }
 catch (    IOException e) {
      log("String_Node_Str" + errorPage,e);
    }
  }
}

Fixed version (ground truth):
private void dispatchToErrorPage(Request request,Response response,ErrorPage errorPage,Throwable throwable,Throwable realError,int statusCode){
  response.setAppCommitted(false);
  ServletRequest sreq=request.getRequest();
  ServletResponse sresp=response.getResponse();
  sreq.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,errorPage.getLocation());
  sreq.setAttribute(RequestDispatcher.ERROR_REQUEST_URI,((HttpServletRequest)sreq).getRequestURI());
  Wrapper wrapper=request.getWrapper();
  if (wrapper != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,wrapper.getName());
  }
  if (throwable != null) {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,throwable.getMessage());
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION,realError);
    sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,realError.getClass());
  }
 else {
    sreq.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,Integer.valueOf(statusCode));
    String message=((HttpResponse)response).getMessage();
    if (message == null) {
      message="String_Node_Str";
    }
 else {
      HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
      message=htmlEntityEncoder.encode(message);
    }
    sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE,message);
  }
  if (custom(request,response,errorPage)) {
    try {
      sresp.flushBuffer();
    }
 catch (    IOException e) {
      log("String_Node_Str" + errorPage,e);
    }
  }
}
Program: 28631
Project: 28631
Buggy source:
public String toString(HtmlEntityEncoder htmlEntityEncoder){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(debug);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(isValid());
  sb.append("String_Node_Str");
  if (isValid()) {
    Enumeration<String> envk=env.keys();
    while (envk.hasMoreElements()) {
      String s=envk.nextElement();
      sb.append("String_Node_Str");
      sb.append(htmlEntityEncoder.encode(s));
      sb.append("String_Node_Str");
      sb.append(blanksToString(htmlEntityEncoder.encode(env.get(s)),"String_Node_Str"));
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(nullsToBlanks(command));
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (workingDirectory != null) {
    sb.append(workingDirectory.toString());
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (int i=0; i < cmdLineParameters.size(); i++) {
    String param=cmdLineParameters.get(i);
    sb.append("String_Node_Str");
    sb.append(htmlEntityEncoder.encode(param));
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String toString(HtmlEntityEncoder htmlEntityEncoder){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(debug);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(isValid());
  sb.append("String_Node_Str");
  if (isValid()) {
    Enumeration<String> envk=env.keys();
    while (envk.hasMoreElements()) {
      String s=envk.nextElement();
      sb.append("String_Node_Str");
      sb.append(htmlEntityEncoder.encode(s));
      sb.append("String_Node_Str");
      sb.append(blanksToString(htmlEntityEncoder.encode(env.get(s)),"String_Node_Str"));
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(nullsToBlanks(command));
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (workingDirectory != null) {
    sb.append(htmlEntityEncoder.encode(workingDirectory.toString()));
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (int i=0; i < cmdLineParameters.size(); i++) {
    String param=cmdLineParameters.get(i);
    sb.append("String_Node_Str");
    sb.append(htmlEntityEncoder.encode(param));
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 28635
Project: 28635
Buggy source:
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  for (int i=0; i < paramNames.length; i++) {
    String paramName=paramNames[i];
    String paramValue=paramValues[i];
    String substitutedValue=ssiMediator.substituteVariables(paramValue);
    if (paramName.equalsIgnoreCase("String_Node_Str")) {
      ssiMediator.setConfigErrMsg(substitutedValue);
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      ssiMediator.setConfigSizeFmt(substitutedValue);
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      ssiMediator.setConfigTimeFmt(substitutedValue);
    }
 else {
      ssiMediator.log("String_Node_Str" + paramName);
      String configErrMsg=ssiMediator.getConfigErrMsg();
      writer.write(configErrMsg);
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  for (int i=0; i < paramNames.length; i++) {
    String paramName=paramNames[i];
    String paramValue=paramValues[i];
    String substitutedValue=ssiMediator.substituteVariables(paramValue);
    if (paramName.equalsIgnoreCase("String_Node_Str")) {
      ssiMediator.setConfigErrMsg(substitutedValue);
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      ssiMediator.setConfigSizeFmt(substitutedValue);
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      ssiMediator.setConfigTimeFmt(substitutedValue);
    }
 else {
      ssiMediator.log("String_Node_Str" + paramName);
      String configErrMsg=ssiMediator.getConfigErrMsg();
      writer.write(htmlEntityEncoder.encode(configErrMsg));
    }
  }
  return 0;
}
Program: 28636
Project: 28636
Buggy source:
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  String encoding=DEFAULT_ENCODING;
  String originalValue=null;
  String errorMessage=ssiMediator.getConfigErrMsg();
  for (int i=0; i < paramNames.length; i++) {
    String paramName=paramNames[i];
    String paramValue=paramValues[i];
    if (paramName.equalsIgnoreCase("String_Node_Str")) {
      originalValue=paramValue;
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      if (isValidEncoding(paramValue)) {
        encoding=paramValue;
      }
 else {
        ssiMediator.log("String_Node_Str" + paramValue);
        writer.write(errorMessage);
      }
    }
 else {
      ssiMediator.log("String_Node_Str" + paramName);
      writer.write(errorMessage);
    }
  }
  String variableValue=ssiMediator.getVariableValue(originalValue,encoding);
  if (variableValue == null) {
    variableValue=MISSING_VARIABLE_VALUE;
  }
  writer.write(variableValue);
  return System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  String encoding=DEFAULT_ENCODING;
  String originalValue=null;
  String errorMessage=null;
  for (int i=0; i < paramNames.length; i++) {
    String paramName=paramNames[i];
    String paramValue=paramValues[i];
    if (paramName.equalsIgnoreCase("String_Node_Str")) {
      originalValue=paramValue;
    }
 else     if (paramName.equalsIgnoreCase("String_Node_Str")) {
      if (isValidEncoding(paramValue)) {
        encoding=paramValue;
      }
 else {
        ssiMediator.log("String_Node_Str" + paramValue);
        if (errorMessage == null) {
          errorMessage=getEncodedConfigErrorMessage(ssiMediator);
        }
        writer.write(errorMessage);
      }
    }
 else {
      ssiMediator.log("String_Node_Str" + paramName);
      if (errorMessage == null) {
        errorMessage=getEncodedConfigErrorMessage(ssiMediator);
      }
      writer.write(errorMessage);
    }
  }
  String variableValue=ssiMediator.getVariableValue(originalValue,encoding);
  if (variableValue == null) {
    variableValue=MISSING_VARIABLE_VALUE;
  }
  writer.write(variableValue);
  return System.currentTimeMillis();
}
Program: 28637
Project: 28637
Buggy source:
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  long lastModified=0;
  String configErrMsg=ssiMediator.getConfigErrMsg();
  String paramName=paramNames[0];
  String paramValue=paramValues[0];
  String substitutedValue=ssiMediator.substituteVariables(paramValue);
  if (paramName.equalsIgnoreCase("String_Node_Str")) {
    lastModified=ssiInclude.process(ssiMediator,"String_Node_Str",new String[]{"String_Node_Str"},new String[]{substitutedValue},writer);
  }
 else   if (paramName.equalsIgnoreCase("String_Node_Str")) {
    boolean foundProgram=false;
    try {
      Runtime rt=Runtime.getRuntime();
      Process proc=rt.exec(substitutedValue);
      foundProgram=true;
      BufferedReader stdOutReader=new BufferedReader(new InputStreamReader(proc.getInputStream()));
      BufferedReader stdErrReader=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
      char[] buf=new char[BUFFER_SIZE];
      IOTools.flow(stdErrReader,writer,buf);
      IOTools.flow(stdOutReader,writer,buf);
      proc.waitFor();
      lastModified=System.currentTimeMillis();
    }
 catch (    InterruptedException e) {
      ssiMediator.log("String_Node_Str" + substitutedValue,e);
      writer.write(configErrMsg);
    }
catch (    IOException e) {
      ssiMediator.log("String_Node_Str" + substitutedValue,e);
    }
  }
  return lastModified;
}

Fixed version (ground truth):
/** 
 * @see SSICommand
 */
public long process(SSIMediator ssiMediator,String commandName,String[] paramNames,String[] paramValues,PrintWriter writer){
  long lastModified=0;
  String configErrMsg=ssiMediator.getConfigErrMsg();
  String paramName=paramNames[0];
  String paramValue=paramValues[0];
  String substitutedValue=ssiMediator.substituteVariables(paramValue);
  if (paramName.equalsIgnoreCase("String_Node_Str")) {
    lastModified=ssiInclude.process(ssiMediator,"String_Node_Str",new String[]{"String_Node_Str"},new String[]{substitutedValue},writer);
  }
 else   if (paramName.equalsIgnoreCase("String_Node_Str")) {
    boolean foundProgram=false;
    try {
      Runtime rt=Runtime.getRuntime();
      Process proc=rt.exec(substitutedValue);
      foundProgram=true;
      BufferedReader stdOutReader=new BufferedReader(new InputStreamReader(proc.getInputStream()));
      BufferedReader stdErrReader=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
      char[] buf=new char[BUFFER_SIZE];
      IOTools.flow(stdErrReader,writer,buf);
      IOTools.flow(stdOutReader,writer,buf);
      proc.waitFor();
      lastModified=System.currentTimeMillis();
    }
 catch (    InterruptedException e) {
      ssiMediator.log("String_Node_Str" + substitutedValue,e);
      writer.write(htmlEntityEncoder.encode(configErrMsg));
    }
catch (    IOException e) {
      ssiMediator.log("String_Node_Str" + substitutedValue,e);
    }
  }
  return lastModified;
}
Program: 28638
Project: 28638
Buggy source:
private void setAttributes(HashMap attributes,String target){
  jndiName=(String)attributes.get(JNDI_NAME);
  description=(String)attributes.get(DESCRIPTION);
  contextInfo=(String)attributes.get(CONTEXT_INFO);
  if (target != null) {
    enabled=resourceUtil.computeEnabledValueForResourceBasedOnTarget((String)attributes.get(ENABLED),target);
  }
 else {
    enabled=(String)attributes.get(ENABLED);
  }
  enabledValueForTarget=(String)attributes.get(ENABLED);
}

Fixed version (ground truth):
private void setAttributes(HashMap attributes,String target){
  jndiName=(String)attributes.get(JNDI_NAME);
  description=(String)attributes.get(DESCRIPTION);
  contextInfoEnabled=(String)attributes.get(CONTEXT_INFO_ENABLED);
  contextInfo=(String)attributes.get(CONTEXT_INFO);
  if (target != null) {
    enabled=resourceUtil.computeEnabledValueForResourceBasedOnTarget((String)attributes.get(ENABLED),target);
  }
 else {
    enabled=(String)attributes.get(ENABLED);
  }
  enabledValueForTarget=(String)attributes.get(ENABLED);
}
Program: 28639
Project: 28639
Buggy source:
/** 
 * Executes the command with the command parameters passed as Properties where the keys are the paramter names and the values the parameter values
 * @param context information
 */
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  HashMap attrList=new HashMap();
  attrList.put(ResourceConstants.JNDI_NAME,jndiName);
  attrList.put(ResourceConstants.CONTEXT_INFO,contextinfo);
  attrList.put(ServerTags.DESCRIPTION,description);
  attrList.put(ResourceConstants.ENABLED,enabled.toString());
  ResourceStatus rs;
  try {
    rs=contextServiceMgr.create(domain.getResources(),attrList,properties,target);
  }
 catch (  Exception e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",jndiName));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
    return;
  }
  ActionReport.ExitCode ec=ActionReport.ExitCode.SUCCESS;
  if (rs.getMessage() != null) {
    report.setMessage(rs.getMessage());
  }
  if (rs.getStatus() == ResourceStatus.FAILURE) {
    ec=ActionReport.ExitCode.FAILURE;
    if (rs.getException() != null)     report.setFailureCause(rs.getException());
  }
  report.setActionExitCode(ec);
}

Fixed version (ground truth):
/** 
 * Executes the command with the command parameters passed as Properties where the keys are the paramter names and the values the parameter values
 * @param context information
 */
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  HashMap attrList=new HashMap();
  attrList.put(ResourceConstants.JNDI_NAME,jndiName);
  attrList.put(ResourceConstants.CONTEXT_INFO_ENABLED,contextinfoenabled.toString());
  attrList.put(ResourceConstants.CONTEXT_INFO,contextinfo);
  attrList.put(ServerTags.DESCRIPTION,description);
  attrList.put(ResourceConstants.ENABLED,enabled.toString());
  ResourceStatus rs;
  try {
    rs=contextServiceMgr.create(domain.getResources(),attrList,properties,target);
  }
 catch (  Exception e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",jndiName));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
    return;
  }
  ActionReport.ExitCode ec=ActionReport.ExitCode.SUCCESS;
  if (rs.getMessage() != null) {
    report.setMessage(rs.getMessage());
  }
  if (rs.getStatus() == ResourceStatus.FAILURE) {
    ec=ActionReport.ExitCode.FAILURE;
    if (rs.getException() != null)     report.setFailureCause(rs.getException());
  }
  report.setActionExitCode(ec);
}
Program: 28640
Project: 28640
Buggy source:
protected void setAttributeList(HashMap attrList){
  attrList.put(ResourceConstants.JNDI_NAME,jndiName);
  attrList.put(ResourceConstants.CONTEXT_INFO,contextinfo);
  attrList.put(ResourceConstants.THREAD_PRIORITY,threadpriority.toString());
  attrList.put(ResourceConstants.LONG_RUNNING_TASKS,longrunningtasks.toString());
  attrList.put(ResourceConstants.HUNG_AFTER_SECONDS,hungafterseconds.toString());
  attrList.put(ResourceConstants.CORE_POOL_SIZE,corepoolsize.toString());
  attrList.put(ResourceConstants.MAXIMUM_POOL_SIZE,maximumpoolsize.toString());
  attrList.put(ResourceConstants.KEEP_ALIVE_SECONDS,keepaliveseconds.toString());
  attrList.put(ResourceConstants.THREAD_LIFETIME_SECONDS,threadlifetimeseconds.toString());
  attrList.put(ResourceConstants.TASK_QUEUE_CAPACITY,taskqueuecapacity.toString());
  attrList.put(ServerTags.DESCRIPTION,description);
  attrList.put(ResourceConstants.ENABLED,enabled.toString());
}

Fixed version (ground truth):
protected void setAttributeList(HashMap attrList){
  attrList.put(ResourceConstants.JNDI_NAME,jndiName);
  attrList.put(ResourceConstants.CONTEXT_INFO_ENABLED,contextinfoenabled.toString());
  attrList.put(ResourceConstants.CONTEXT_INFO,contextinfo);
  attrList.put(ResourceConstants.THREAD_PRIORITY,threadpriority.toString());
  attrList.put(ResourceConstants.LONG_RUNNING_TASKS,longrunningtasks.toString());
  attrList.put(ResourceConstants.HUNG_AFTER_SECONDS,hungafterseconds.toString());
  attrList.put(ResourceConstants.CORE_POOL_SIZE,corepoolsize.toString());
  attrList.put(ResourceConstants.MAXIMUM_POOL_SIZE,maximumpoolsize.toString());
  attrList.put(ResourceConstants.KEEP_ALIVE_SECONDS,keepaliveseconds.toString());
  attrList.put(ResourceConstants.THREAD_LIFETIME_SECONDS,threadlifetimeseconds.toString());
  attrList.put(ResourceConstants.TASK_QUEUE_CAPACITY,taskqueuecapacity.toString());
  attrList.put(ServerTags.DESCRIPTION,description);
  attrList.put(ResourceConstants.ENABLED,enabled.toString());
}
Program: 28641
Project: 28641
Buggy source:
/** 
 * Executes the command with the command parameters passed as Properties where the keys are the paramter names and the values the parameter values
 * @param context information
 */
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  HashMap attrList=new HashMap();
  attrList.put(ResourceConstants.JNDI_NAME,jndiName);
  attrList.put(ResourceConstants.CONTEXT_INFO,contextinfo);
  attrList.put(ResourceConstants.THREAD_PRIORITY,threadpriority.toString());
  attrList.put(ServerTags.DESCRIPTION,description);
  attrList.put(ResourceConstants.ENABLED,enabled.toString());
  ResourceStatus rs;
  try {
    rs=managedThreadFactoryMgr.create(domain.getResources(),attrList,properties,target);
  }
 catch (  Exception e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",jndiName));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
    return;
  }
  ActionReport.ExitCode ec=ActionReport.ExitCode.SUCCESS;
  if (rs.getMessage() != null) {
    report.setMessage(rs.getMessage());
  }
  if (rs.getStatus() == ResourceStatus.FAILURE) {
    ec=ActionReport.ExitCode.FAILURE;
    if (rs.getException() != null)     report.setFailureCause(rs.getException());
  }
  report.setActionExitCode(ec);
}

Fixed version (ground truth):
/** 
 * Executes the command with the command parameters passed as Properties where the keys are the paramter names and the values the parameter values
 * @param context information
 */
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  HashMap attrList=new HashMap();
  attrList.put(ResourceConstants.JNDI_NAME,jndiName);
  attrList.put(ResourceConstants.CONTEXT_INFO_ENABLED,contextinfoenabled.toString());
  attrList.put(ResourceConstants.CONTEXT_INFO,contextinfo);
  attrList.put(ResourceConstants.THREAD_PRIORITY,threadpriority.toString());
  attrList.put(ServerTags.DESCRIPTION,description);
  attrList.put(ResourceConstants.ENABLED,enabled.toString());
  ResourceStatus rs;
  try {
    rs=managedThreadFactoryMgr.create(domain.getResources(),attrList,properties,target);
  }
 catch (  Exception e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",jndiName));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
    return;
  }
  ActionReport.ExitCode ec=ActionReport.ExitCode.SUCCESS;
  if (rs.getMessage() != null) {
    report.setMessage(rs.getMessage());
  }
  if (rs.getStatus() == ResourceStatus.FAILURE) {
    ec=ActionReport.ExitCode.FAILURE;
    if (rs.getException() != null)     report.setFailureCause(rs.getException());
  }
  report.setActionExitCode(ec);
}
Program: 28642
Project: 28642
Buggy source:
protected void setAttributes(HashMap attributes,String target){
  jndiName=(String)attributes.get(JNDI_NAME);
  description=(String)attributes.get(DESCRIPTION);
  contextInfo=(String)attributes.get(CONTEXT_INFO);
  threadPriority=(String)attributes.get(THREAD_PRIORITY);
  longRunningTasks=(String)attributes.get(LONG_RUNNING_TASKS);
  hungAfterSeconds=(String)attributes.get(HUNG_AFTER_SECONDS);
  corePoolSize=(String)attributes.get(CORE_POOL_SIZE);
  maximumPoolSize=(String)attributes.get(MAXIMUM_POOL_SIZE);
  keepAliveSeconds=(String)attributes.get(KEEP_ALIVE_SECONDS);
  threadLifetimeSeconds=(String)attributes.get(THREAD_LIFETIME_SECONDS);
  taskQueueCapacity=(String)attributes.get(TASK_QUEUE_CAPACITY);
  if (target != null) {
    enabled=resourceUtil.computeEnabledValueForResourceBasedOnTarget((String)attributes.get(ENABLED),target);
  }
 else {
    enabled=(String)attributes.get(ENABLED);
  }
  enabledValueForTarget=(String)attributes.get(ENABLED);
}

Fixed version (ground truth):
protected void setAttributes(HashMap attributes,String target){
  jndiName=(String)attributes.get(JNDI_NAME);
  description=(String)attributes.get(DESCRIPTION);
  contextInfo=(String)attributes.get(CONTEXT_INFO);
  contextInfoEnabled=(String)attributes.get(CONTEXT_INFO_ENABLED);
  threadPriority=(String)attributes.get(THREAD_PRIORITY);
  longRunningTasks=(String)attributes.get(LONG_RUNNING_TASKS);
  hungAfterSeconds=(String)attributes.get(HUNG_AFTER_SECONDS);
  corePoolSize=(String)attributes.get(CORE_POOL_SIZE);
  maximumPoolSize=(String)attributes.get(MAXIMUM_POOL_SIZE);
  keepAliveSeconds=(String)attributes.get(KEEP_ALIVE_SECONDS);
  threadLifetimeSeconds=(String)attributes.get(THREAD_LIFETIME_SECONDS);
  taskQueueCapacity=(String)attributes.get(TASK_QUEUE_CAPACITY);
  if (target != null) {
    enabled=resourceUtil.computeEnabledValueForResourceBasedOnTarget((String)attributes.get(ENABLED),target);
  }
 else {
    enabled=(String)attributes.get(ENABLED);
  }
  enabledValueForTarget=(String)attributes.get(ENABLED);
}
Program: 28643
Project: 28643
Buggy source:
private void setAttributes(HashMap attributes,String target){
  jndiName=(String)attributes.get(JNDI_NAME);
  description=(String)attributes.get(DESCRIPTION);
  contextInfo=(String)attributes.get(CONTEXT_INFO);
  threadPriority=(String)attributes.get(THREAD_PRIORITY);
  if (target != null) {
    enabled=resourceUtil.computeEnabledValueForResourceBasedOnTarget((String)attributes.get(ENABLED),target);
  }
 else {
    enabled=(String)attributes.get(ENABLED);
  }
  enabledValueForTarget=(String)attributes.get(ENABLED);
}

Fixed version (ground truth):
private void setAttributes(HashMap attributes,String target){
  jndiName=(String)attributes.get(JNDI_NAME);
  description=(String)attributes.get(DESCRIPTION);
  contextInfoEnabled=(String)attributes.get(CONTEXT_INFO_ENABLED);
  contextInfo=(String)attributes.get(CONTEXT_INFO);
  threadPriority=(String)attributes.get(THREAD_PRIORITY);
  if (target != null) {
    enabled=resourceUtil.computeEnabledValueForResourceBasedOnTarget((String)attributes.get(ENABLED),target);
  }
 else {
    enabled=(String)attributes.get(ENABLED);
  }
  enabledValueForTarget=(String)attributes.get(ENABLED);
}
Program: 28644
Project: 28644
Buggy source:
/** 
 * Gets the value of the contextInfo property.
 * @return possible object is{@link String }
 */
@Attribute String getContextInfo();

Fixed version (ground truth):
/** 
 * Gets the value of the contextInfo property.
 * @return possible object is{@link String }
 */
@Attribute(defaultValue=CONTEXT_INFO_DEFAULT_VALUE) String getContextInfo();
Program: 28645
Project: 28645
Buggy source:
/** 
 * Gets the value of the contextInfo property.
 * @return possible object is{@link String }
 */
@Attribute String getContextInfo();

Fixed version (ground truth):
/** 
 * Gets the value of the contextInfo property.
 * @return possible object is{@link String }
 */
@Attribute(defaultValue=ContextService.CONTEXT_INFO_DEFAULT_VALUE) String getContextInfo();
Program: 28646
Project: 28646
Buggy source:
/** 
 * Gets the value of the contextInfo property.
 * @return possible object is{@link String }
 */
@Attribute String getContextInfo();

Fixed version (ground truth):
/** 
 * Gets the value of the contextInfo property.
 * @return possible object is{@link String }
 */
@Attribute(defaultValue=ContextService.CONTEXT_INFO_DEFAULT_VALUE) String getContextInfo();
Program: 28647
Project: 28647
Buggy source:
private void deleteHK2Cache(Properties properties){
  final String cacheDir=properties.getProperty(HK2_CACHE_DIR);
  if (cacheDir != null) {
    File inhabitantsCache=new File(cacheDir,INHABITANTS_CACHE);
    if (inhabitantsCache.exists()) {
      inhabitantsCache.delete();
    }
  }
}

Fixed version (ground truth):
private void deleteHK2Cache(Properties properties) throws GlassFishException {
  final String cacheDir=properties.getProperty(HK2_CACHE_DIR);
  if (cacheDir != null) {
    File inhabitantsCache=new File(cacheDir,INHABITANTS_CACHE);
    if (inhabitantsCache.exists()) {
      if (!inhabitantsCache.delete()) {
        throw new GlassFishException("String_Node_Str" + inhabitantsCache.getAbsolutePath());
      }
    }
  }
}
Program: 28648
Project: 28648
Buggy source:
private void storeBundleIds(Long[] bundleIds){
  try {
    File f=framework.getBundleContext().getDataFile(BUNDLEIDS_FILENAME);
    if (f == null) {
      logger.log(Level.WARNING,LogFacade.CANT_STORE_BUNDLEIDS);
      return;
    }
    ObjectOutputStream os=new ObjectOutputStream(new FileOutputStream(f));
    os.writeObject(bundleIds);
    os.flush();
    os.close();
    logger.logp(Level.FINE,"String_Node_Str","String_Node_Str","String_Node_Str",new Object[]{f.getAbsolutePath()});
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void storeBundleIds(Long[] bundleIds){
  ObjectOutputStream os=null;
  try {
    File f=framework.getBundleContext().getDataFile(BUNDLEIDS_FILENAME);
    if (f == null) {
      logger.log(Level.WARNING,LogFacade.CANT_STORE_BUNDLEIDS);
      return;
    }
    os=new ObjectOutputStream(new FileOutputStream(f));
    os.writeObject(bundleIds);
    os.flush();
    logger.logp(Level.FINE,"String_Node_Str","String_Node_Str","String_Node_Str",new Object[]{f.getAbsolutePath()});
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (os != null) {
      try {
        os.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 28649
Project: 28649
Buggy source:
private void storeProvisioningOptions(Properties properties){
  try {
    File f=framework.getBundleContext().getDataFile(PROVISIONING_OPTIONS_FILENAME);
    if (f == null) {
      logger.log(Level.WARNING,LogFacade.CANT_STORE_PROVISIONING_OPTIONS);
      return;
    }
    final FileOutputStream os=new FileOutputStream(f);
    getNewProvisioningOptions(properties).store(os,"String_Node_Str");
    os.flush();
    os.close();
    logger.logp(Level.FINE,"String_Node_Str","String_Node_Str","String_Node_Str",new Object[]{f.getAbsolutePath()});
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void storeProvisioningOptions(Properties properties){
  FileOutputStream os=null;
  try {
    File f=framework.getBundleContext().getDataFile(PROVISIONING_OPTIONS_FILENAME);
    if (f == null) {
      logger.log(Level.WARNING,LogFacade.CANT_STORE_PROVISIONING_OPTIONS);
      return;
    }
    os=new FileOutputStream(f);
    getNewProvisioningOptions(properties).store(os,"String_Node_Str");
    os.flush();
    logger.logp(Level.FINE,"String_Node_Str","String_Node_Str","String_Node_Str",new Object[]{f.getAbsolutePath()});
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (os != null) {
      try {
        os.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 28650
Project: 28650
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final ProgressStatusEventSet other=(ProgressStatusEventSet)obj;
  if (this.totalStepCount != other.totalStepCount && (this.totalStepCount == null || !this.totalStepCount.equals(other.totalStepCount))) {
    return false;
  }
  if (this.currentStepCount != other.currentStepCount && (this.currentStepCount == null || !this.currentStepCount.equals(other.currentStepCount))) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final ProgressStatusEventSet other=(ProgressStatusEventSet)obj;
  if ((this.totalStepCount == null) ? (other.totalStepCount != null) : !this.totalStepCount.equals(other.totalStepCount)) {
    return false;
  }
  if ((this.currentStepCount == null) ? (other.currentStepCount != null) : !this.currentStepCount.equals(other.currentStepCount)) {
    return false;
  }
  return true;
}