nus-yam/ex-repair huggingface dataset:
Program: 180520
Project: 180520
Buggy source:
private String extractCharacters(String target,String source,String anchor_pattern,int[] idxs){
  int start_idx=target.indexOf(anchor_pattern);
  String ret="String_Node_Str";
  if (start_idx < 0)   return ret;
  for (  Integer idx : idxs) {
    ret+=source.charAt(start_idx + idx);
  }
  return ret;
}

Fixed version (ground truth):
private String extractCharacters(String target,String source,String anchor_pattern,int[] idxs) throws Exception {
  int start_idx=target.indexOf(anchor_pattern);
  String ret="String_Node_Str";
  if (start_idx < 0)   throw new Exception("String_Node_Str");
  for (  Integer idx : idxs) {
    ret+=source.charAt(start_idx + idx);
  }
  return ret;
}
Program: 180521
Project: 180521
Buggy source:
public String get8ASignature(){
  return this.sig8a;
}

Fixed version (ground truth):
public String get8ASignature() throws Exception {
  return extract8ASignature();
}
Program: 180523
Project: 180523
Buggy source:
public static void banner(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public static void banner(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  if (debug)   System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
}
Program: 180524
Project: 180524
Buggy source:
public static void parseCommandline(String[] argv){
  fillPrecs();
  Getopt g=new Getopt("String_Node_Str",argv,"String_Node_Str");
  int c;
  String arg;
  while ((c=g.getopt()) != -1) {
switch (c) {
case 's':
      arg=g.getOptarg();
    if (arg.equals("String_Node_Str"))     extractsigs=false;
 else     extractsigs=true;
  break;
case 'b':
arg=g.getOptarg();
if (arg.equals("String_Node_Str")) bacterialMode=true;
 else bacterialMode=false;
break;
case 'i':
arg=g.getOptarg();
inputfile=arg;
break;
case 'r':
arg=g.getOptarg();
reportfile=arg;
break;
case 'o':
arg=g.getOptarg();
outputfile=arg;
break;
default :
break;
}
}
}

Fixed version (ground truth):
public static void parseCommandline(String[] argv){
  fillPrecs();
  Getopt g=new Getopt("String_Node_Str",argv,"String_Node_Str");
  int c;
  String arg;
  while ((c=g.getopt()) != -1) {
switch (c) {
case 's':
      arg=g.getOptarg();
    if (arg.equals("String_Node_Str"))     extractsigs=false;
 else     extractsigs=true;
  break;
case 'b':
arg=g.getOptarg();
if (arg.equals("String_Node_Str")) bacterialMode=true;
 else bacterialMode=false;
break;
case 'i':
arg=g.getOptarg();
inputfile=arg;
break;
case 'r':
arg=g.getOptarg();
reportfile=arg;
break;
case 'o':
arg=g.getOptarg();
outputfile=arg;
break;
case 'd':
debug=true;
debug("String_Node_Str");
break;
default :
break;
}
}
}
Program: 180525
Project: 180525
Buggy source:
public static void main(String[] argv) throws Exception {
  Locale locale=new Locale("String_Node_Str","String_Node_Str");
  Locale.setDefault(locale);
  try {
    datadir=System.getProperty("String_Node_Str",datadir);
    if (argv.length == 0) {
      banner();
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.exit(0);
    }
    initSigDB();
    parseCommandline(argv);
    banner();
    if (extractsigs) {
      System.out.println("String_Node_Str");
      extractSigs(inputfile);
    }
 else {
      System.out.println("String_Node_Str");
      parseSigs(inputfile);
    }
    System.out.println("String_Node_Str" + adoms.size() + "String_Node_Str");
    if (bacterialMode) {
      System.out.println("String_Node_Str");
      bacterialPrediction();
    }
 else {
      System.out.println("String_Node_Str");
      fungalPrediction();
    }
    if (outputfile != null)     store(outputfile,adoms);
    if (reportfile != null)     report(reportfile,adoms);
  }
 catch (  Throwable e) {
    e.printStackTrace();
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(String[] argv) throws Exception {
  Locale locale=new Locale("String_Node_Str","String_Node_Str");
  Locale.setDefault(locale);
  try {
    datadir=System.getProperty("String_Node_Str",datadir);
    evalue=Double.parseDouble(System.getProperty("String_Node_Str","String_Node_Str"));
    if (argv.length == 0) {
      banner();
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.exit(0);
    }
    initSigDB();
    parseCommandline(argv);
    banner();
    if (extractsigs) {
      System.out.println("String_Node_Str");
      extractSigs(inputfile);
    }
 else {
      System.out.println("String_Node_Str");
      parseSigs(inputfile);
    }
    System.out.println("String_Node_Str" + adoms.size() + "String_Node_Str");
    if (bacterialMode) {
      System.out.println("String_Node_Str");
      bacterialPrediction();
    }
 else {
      System.out.println("String_Node_Str");
      fungalPrediction();
    }
    if (outputfile != null)     store(outputfile,adoms);
    if (reportfile != null)     report(reportfile,adoms);
  }
 catch (  Throwable e) {
    e.printStackTrace();
    System.exit(1);
  }
}
Program: 180526
Project: 180526
Buggy source:
public void doExport(HttpServletRequest req,HttpServletResponse resp) throws IOException, ServletException {
  IFileStore source=NewFileServlet.getFileStore(sourcePath);
  try {
    if (source.fetchInfo().isDirectory() && source.childNames(EFS.NONE,null).length == 0) {
      resp.sendError(HttpServletResponse.SC_NOT_FOUND,"String_Node_Str");
      return;
    }
    ZipOutputStream zout=new ZipOutputStream(resp.getOutputStream());
    write(source,Path.EMPTY,zout);
    zout.finish();
  }
 catch (  CoreException e) {
    throw new ServletException(e);
  }
}

Fixed version (ground truth):
public void doExport(HttpServletRequest req,HttpServletResponse resp) throws IOException, ServletException {
  IFileStore source=NewFileServlet.getFileStore(sourcePath);
  try {
    if (source.fetchInfo().isDirectory() && source.childNames(EFS.NONE,null).length == 0) {
      resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED,"String_Node_Str");
      return;
    }
    ZipOutputStream zout=new ZipOutputStream(resp.getOutputStream());
    write(source,Path.EMPTY,zout);
    zout.finish();
  }
 catch (  CoreException e) {
    throw new ServletException(e);
  }
}
Program: 180527
Project: 180527
Buggy source:
private void addTransferLinks(URI resource,JSONObject representation) throws URISyntaxException, JSONException {
  URI location=new URI(representation.getString(ProtocolConstants.KEY_LOCATION));
  IPath targetPath=new Path(location.getPath()).removeFirstSegments(1).removeTrailingSeparator();
  IPath path=new Path("String_Node_Str").append(targetPath);
  URI link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_IMPORT_LOCATION,link);
  if (isEmptyDirectory(targetPath))   return;
  path=new Path("String_Node_Str").append(targetPath).addFileExtension("String_Node_Str");
  link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_EXPORT_LOCATION,link);
}

Fixed version (ground truth):
private void addTransferLinks(URI resource,JSONObject representation) throws URISyntaxException, JSONException {
  URI location=new URI(representation.getString(ProtocolConstants.KEY_LOCATION));
  IPath targetPath=new Path(location.getPath()).removeFirstSegments(1).removeTrailingSeparator();
  IPath path=new Path("String_Node_Str").append(targetPath);
  URI link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_IMPORT_LOCATION,link);
  path=new Path("String_Node_Str").append(targetPath).addFileExtension("String_Node_Str");
  link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_EXPORT_LOCATION,link);
}
Program: 180528
Project: 180528
Buggy source:
public static void writeJSONResponse(HttpServletRequest req,HttpServletResponse resp,Object result) throws IOException {
  Assert.isLegal(result instanceof JSONObject || result instanceof JSONArray);
  resp.setStatus(HttpServletResponse.SC_OK);
  resp.setHeader("String_Node_Str","String_Node_Str");
  if (result instanceof JSONObject) {
    decorateResponse(req,(JSONObject)result);
    removeOwnProtocolHostPort((JSONObject)result,req.getScheme(),req.getServerName(),req.getServerPort());
  }
  resp.setContentType(ProtocolConstants.CONTENT_TYPE_JSON);
  String response=prettyPrint(result);
  resp.getWriter().print(response);
  LoggerFactory.getLogger(OrionServlet.class).debug(response);
}

Fixed version (ground truth):
public static void writeJSONResponse(HttpServletRequest req,HttpServletResponse resp,Object result) throws IOException {
  Assert.isLegal(result instanceof JSONObject || result instanceof JSONArray);
  resp.setStatus(HttpServletResponse.SC_OK);
  resp.setHeader("String_Node_Str","String_Node_Str");
  if (result instanceof JSONObject) {
    decorateResponse(req,(JSONObject)result);
  }
  resp.setContentType(ProtocolConstants.CONTENT_TYPE_JSON);
  String response=prettyPrint(result);
  resp.getWriter().print(response);
  LoggerFactory.getLogger(OrionServlet.class).debug(response);
}
Program: 180530
Project: 180530
Buggy source:
public void addAtributesFor(HttpServletRequest request,URI resource,JSONObject representation){
  IPath resourcePath=new Path(resource.getPath());
  if (resourcePath.segmentCount() == 0)   return;
  String service=resourcePath.segment(0);
  if (!("String_Node_Str".equals(service) || "String_Node_Str".equals(service)))   return;
  try {
    URI result=new URI(resource.getScheme(),resource.getUserInfo(),resource.getHost(),resource.getPort(),"String_Node_Str","String_Node_Str",null);
    representation.put(ProtocolConstants.KEY_SEARCH_LOCATION,result.toString());
  }
 catch (  URISyntaxException e) {
    LogHelper.log(e);
  }
catch (  JSONException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void addAtributesFor(HttpServletRequest request,URI resource,JSONObject representation){
  IPath resourcePath=new Path(resource.getPath());
  if (resourcePath.segmentCount() == 0)   return;
  String service=resourcePath.segment(0);
  if (!("String_Node_Str".equals(service) || "String_Node_Str".equals(service)))   return;
  try {
    URI result=new URI(resource.getScheme(),resource.getUserInfo(),resource.getHost(),resource.getPort(),"String_Node_Str","String_Node_Str",null);
    representation.put(ProtocolConstants.KEY_SEARCH_LOCATION,result);
  }
 catch (  URISyntaxException e) {
    LogHelper.log(e);
  }
catch (  JSONException e) {
    throw new RuntimeException(e);
  }
}
Program: 180531
Project: 180531
Buggy source:
public static JSONObject toJSON(IFileStore store,IFileInfo info,URI location){
  JSONObject result=new JSONObject();
  try {
    result.put(ProtocolConstants.KEY_NAME,info.getName());
    result.put(ProtocolConstants.KEY_LOCAL_TIMESTAMP,info.getLastModified());
    result.put(ProtocolConstants.KEY_DIRECTORY,info.isDirectory());
    result.put(ProtocolConstants.KEY_LENGTH,info.getLength());
    if (location != null) {
      result.put(ProtocolConstants.KEY_LOCATION,location);
      if (info.isDirectory())       result.put(ProtocolConstants.KEY_CHILDREN_LOCATION,location + "String_Node_Str");
    }
    result.put(ProtocolConstants.KEY_ATTRIBUTES,getAttributes(store,info));
  }
 catch (  JSONException e) {
    throw new RuntimeException(e);
  }
  return result;
}

Fixed version (ground truth):
public static JSONObject toJSON(IFileStore store,IFileInfo info,URI location){
  JSONObject result=new JSONObject();
  try {
    result.put(ProtocolConstants.KEY_NAME,info.getName());
    result.put(ProtocolConstants.KEY_LOCAL_TIMESTAMP,info.getLastModified());
    result.put(ProtocolConstants.KEY_DIRECTORY,info.isDirectory());
    result.put(ProtocolConstants.KEY_LENGTH,info.getLength());
    if (location != null) {
      result.put(ProtocolConstants.KEY_LOCATION,location);
      if (info.isDirectory())       try {
        result.put(ProtocolConstants.KEY_CHILDREN_LOCATION,new URI(location.getScheme(),location.getUserInfo(),location.getHost(),location.getPort(),location.getPath(),"String_Node_Str",location.getFragment()));
      }
 catch (      URISyntaxException e) {
        throw new RuntimeException(e);
      }
    }
    result.put(ProtocolConstants.KEY_ATTRIBUTES,getAttributes(store,info));
  }
 catch (  JSONException e) {
    throw new RuntimeException(e);
  }
  return result;
}
Program: 180532
Project: 180532
Buggy source:
/** 
 * @param baseLocation The URI of the SiteConfigurationServlet.
 * @return Representation of <code>site</code> as a JSONObject.
 */
public static JSONObject toJSON(SiteConfiguration site,URI baseLocation){
  JSONObject result=WebElementResourceHandler.toJSON(site);
  try {
    result.put(ProtocolConstants.KEY_LOCATION,URIUtil.append(baseLocation,site.getId()).toString());
    result.putOpt(SiteConfigurationConstants.KEY_HOST_HINT,site.getHostHint());
    result.putOpt(SiteConfigurationConstants.KEY_WORKSPACE,site.getWorkspace());
    result.put(SiteConfigurationConstants.KEY_MAPPINGS,site.getMappingsJSON());
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param baseLocation The URI of the SiteConfigurationServlet.
 * @return Representation of <code>site</code> as a JSONObject.
 */
public static JSONObject toJSON(SiteConfiguration site,URI baseLocation){
  JSONObject result=WebElementResourceHandler.toJSON(site);
  try {
    result.put(ProtocolConstants.KEY_LOCATION,URIUtil.append(baseLocation,site.getId()));
    result.putOpt(SiteConfigurationConstants.KEY_HOST_HINT,site.getHostHint());
    result.putOpt(SiteConfigurationConstants.KEY_WORKSPACE,site.getWorkspace());
    result.put(SiteConfigurationConstants.KEY_MAPPINGS,site.getMappingsJSON());
  }
 catch (  JSONException e) {
  }
  return result;
}
Program: 180533
Project: 180533
Buggy source:
/** 
 * Adds a parent resource representation to the parent array
 */
private void addParent(JSONArray parents,String name,URI location) throws JSONException {
  JSONObject parent=new JSONObject();
  parent.put(ProtocolConstants.KEY_NAME,name);
  parent.put(ProtocolConstants.KEY_LOCATION,location);
  String childLocation=location.toString() + "String_Node_Str";
  parent.put(ProtocolConstants.KEY_CHILDREN_LOCATION,childLocation);
  parents.put(parent);
}

Fixed version (ground truth):
/** 
 * Adds a parent resource representation to the parent array
 */
private void addParent(JSONArray parents,String name,URI location) throws JSONException {
  JSONObject parent=new JSONObject();
  parent.put(ProtocolConstants.KEY_NAME,name);
  parent.put(ProtocolConstants.KEY_LOCATION,location);
  URI childLocation;
  try {
    childLocation=new URI(location.getScheme(),location.getUserInfo(),location.getHost(),location.getPort(),location.getPath(),"String_Node_Str",location.getFragment());
  }
 catch (  URISyntaxException e) {
    throw new RuntimeException(e);
  }
  parent.put(ProtocolConstants.KEY_CHILDREN_LOCATION,childLocation);
  parents.put(parent);
}
Program: 180534
Project: 180534
Buggy source:
/** 
 * Returns the location of the project's content (conforming to File REST API).
 */
static String computeProjectContentLocation(URI parentLocation,WebProject project){
  URI contentLocation=project.getContentLocation();
  if (!contentLocation.isAbsolute() || "String_Node_Str".equals(contentLocation.getScheme())) {
    IPath contentPath=new Path(contentLocation.getPath());
    if (contentPath.isAbsolute())     contentPath=new Path(project.getId());
    contentLocation=URIUtil.append(parentLocation,"String_Node_Str" + Activator.LOCATION_FILE_SERVLET + contentPath.makeAbsolute().toString());
  }
  String locationString=contentLocation.toString();
  if (!locationString.endsWith("String_Node_Str"))   locationString+="String_Node_Str";
  return locationString;
}

Fixed version (ground truth):
/** 
 * Returns the location of the project's content (conforming to File REST API).
 */
static URI computeProjectContentLocation(URI parentLocation,WebProject project){
  URI contentLocation=project.getContentLocation();
  if (!contentLocation.isAbsolute() || "String_Node_Str".equals(contentLocation.getScheme())) {
    IPath contentPath=new Path(contentLocation.getPath());
    if (contentPath.isAbsolute())     contentPath=new Path(project.getId());
    String contentPathString=contentPath.makeAbsolute().toString();
    if (!contentPathString.endsWith("String_Node_Str"))     contentPathString+="String_Node_Str";
    contentLocation=URIUtil.append(parentLocation,"String_Node_Str" + Activator.LOCATION_FILE_SERVLET + contentPathString);
  }
  if (!contentLocation.getPath().endsWith("String_Node_Str")) {
    try {
      contentLocation=new URI(contentLocation.getScheme(),contentLocation.getUserInfo(),contentLocation.getHost(),contentLocation.getPort(),contentLocation.getPath() + "String_Node_Str",contentLocation.getQuery(),contentLocation.getFragment());
    }
 catch (    URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }
  return contentLocation;
}
Program: 180537
Project: 180537
Buggy source:
private void addTransferLinks(URI resource,JSONObject representation) throws URISyntaxException, JSONException {
  URI location=new URI(representation.getString(ProtocolConstants.KEY_LOCATION));
  IPath targetPath=new Path(location.getPath()).removeFirstSegments(1).removeTrailingSeparator();
  IPath path=new Path("String_Node_Str").append(targetPath);
  URI link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_IMPORT_LOCATION,link.toString());
  path=new Path("String_Node_Str").append(targetPath).addFileExtension("String_Node_Str");
  link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_EXPORT_LOCATION,link.toString());
}

Fixed version (ground truth):
private void addTransferLinks(URI resource,JSONObject representation) throws URISyntaxException, JSONException {
  URI location=new URI(representation.getString(ProtocolConstants.KEY_LOCATION));
  IPath targetPath=new Path(location.getPath()).removeFirstSegments(1).removeTrailingSeparator();
  IPath path=new Path("String_Node_Str").append(targetPath);
  URI link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_IMPORT_LOCATION,link);
  path=new Path("String_Node_Str").append(targetPath).addFileExtension("String_Node_Str");
  link=new URI(resource.getScheme(),resource.getAuthority(),path.toString(),null,null);
  representation.put(ProtocolConstants.KEY_EXPORT_LOCATION,link);
}
Program: 180538
Project: 180538
Buggy source:
public static void writeJSONResponse(HttpServletRequest req,HttpServletResponse resp,Object result) throws IOException {
  Assert.isLegal(result instanceof JSONObject || result instanceof JSONArray);
  resp.setStatus(HttpServletResponse.SC_OK);
  resp.setHeader("String_Node_Str","String_Node_Str");
  if (result instanceof JSONObject)   decorateResponse(req,(JSONObject)result);
  resp.setContentType(ProtocolConstants.CONTENT_TYPE_JSON);
  String response=prettyPrint(result);
  resp.getWriter().print(response);
  LoggerFactory.getLogger(OrionServlet.class).debug(response);
}

Fixed version (ground truth):
public static void writeJSONResponse(HttpServletRequest req,HttpServletResponse resp,Object result) throws IOException {
  Assert.isLegal(result instanceof JSONObject || result instanceof JSONArray);
  resp.setStatus(HttpServletResponse.SC_OK);
  resp.setHeader("String_Node_Str","String_Node_Str");
  if (result instanceof JSONObject) {
    decorateResponse(req,(JSONObject)result);
    removeOwnProtocolHostPort((JSONObject)result,req.getScheme(),req.getServerName(),req.getServerPort());
  }
  resp.setContentType(ProtocolConstants.CONTENT_TYPE_JSON);
  String response=prettyPrint(result);
  resp.getWriter().print(response);
  LoggerFactory.getLogger(OrionServlet.class).debug(response);
}
Program: 180539
Project: 180539
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String pathInfo=req.getPathInfo();
  IPath path=pathInfo == null ? Path.EMPTY : new Path(pathInfo);
  if (path.segmentCount() != 2 || !"String_Node_Str".equals(path.segment(0))) {
    handleException(resp,"String_Node_Str" + path,null,HttpServletResponse.SC_BAD_REQUEST);
    return;
  }
  ITaskService taskService=taskTracker.getService();
  if (taskService == null) {
    handleException(resp,"String_Node_Str",null);
    return;
  }
  String taskId=path.segment(1);
  TaskInfo task=taskService.getTask(taskId);
  if (task == null) {
    handleException(resp,"String_Node_Str" + taskId,null,HttpServletResponse.SC_NOT_FOUND);
    return;
  }
  JSONObject result=task.toJSON();
  try {
    if (result.optString(ProtocolConstants.KEY_LOCATION,"String_Node_Str").isEmpty())     result.put(ProtocolConstants.KEY_LOCATION,getURI(req).toString());
  }
 catch (  JSONException e) {
  }
  writeJSONResponse(req,resp,result);
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String pathInfo=req.getPathInfo();
  IPath path=pathInfo == null ? Path.EMPTY : new Path(pathInfo);
  if (path.segmentCount() != 2 || !"String_Node_Str".equals(path.segment(0))) {
    handleException(resp,"String_Node_Str" + path,null,HttpServletResponse.SC_BAD_REQUEST);
    return;
  }
  ITaskService taskService=taskTracker.getService();
  if (taskService == null) {
    handleException(resp,"String_Node_Str",null);
    return;
  }
  String taskId=path.segment(1);
  TaskInfo task=taskService.getTask(taskId);
  if (task == null) {
    handleException(resp,"String_Node_Str" + taskId,null,HttpServletResponse.SC_NOT_FOUND);
    return;
  }
  JSONObject result=task.toJSON();
  try {
    if (result.optString(ProtocolConstants.KEY_LOCATION,"String_Node_Str").equals("String_Node_Str"))     result.put(ProtocolConstants.KEY_LOCATION,getURI(req).toString());
  }
 catch (  JSONException e) {
  }
  writeJSONResponse(req,resp,result);
}
Program: 180540
Project: 180540
Buggy source:
private void addEditHeaders(HttpServletResponse resp,IHostedSite site,IPath path){
  resp.addHeader("String_Node_Str",site.getEditServerUrl() + "String_Node_Str");
  resp.addHeader("String_Node_Str",path.toString());
}

Fixed version (ground truth):
private void addEditHeaders(HttpServletResponse resp,IHostedSite site,IPath path){
  resp.addHeader("String_Node_Str",site.getEditServerUrl() + "String_Node_Str");
  resp.addHeader("String_Node_Str",FILE_SERVLET_ALIAS + path.toString());
}
Program: 180541
Project: 180541
Buggy source:
private void serveOrionFile(HttpServletRequest req,HttpServletResponse resp,IHostedSite site,IPath path) throws ServletException {
  String userName=site.getUserName();
  String workspaceId=site.getWorkspaceId();
  String workspaceUri=WORKSPACE_SERVLET_ALIAS + workspaceId;
  boolean allow=false;
  try {
    if (AuthorizationService.checkRights(userName,workspaceUri,"String_Node_Str")) {
      allow=true;
    }
  }
 catch (  JSONException e) {
    throw new ServletException(e);
  }
  if (allow) {
    String pathInfo=path.toString();
    IPath filePath=pathInfo == null ? Path.ROOT : new Path(pathInfo);
    IFileStore file=tempGetFileStore(filePath,userName);
    if (file == null) {
      handleException(resp,new ServerStatus(IStatus.ERROR,404,NLS.bind("String_Node_Str",filePath),null));
    }
    if (fileSerializer.handleRequest(req,resp,file)) {
    }
    if (file != null) {
      addEditHeaders(resp,site,path);
    }
  }
 else {
    String msg=NLS.bind("String_Node_Str",workspaceUri);
    handleException(resp,new ServerStatus(IStatus.ERROR,HttpServletResponse.SC_FORBIDDEN,msg,null));
  }
}

Fixed version (ground truth):
private void serveOrionFile(HttpServletRequest req,HttpServletResponse resp,IHostedSite site,IPath path) throws ServletException {
  String userName=site.getUserName();
  String workspaceId=site.getWorkspaceId();
  String workspaceUri=WORKSPACE_SERVLET_ALIAS + "String_Node_Str" + workspaceId;
  boolean allow=false;
  try {
    if (AuthorizationService.checkRights(userName,workspaceUri,"String_Node_Str")) {
      allow=true;
    }
  }
 catch (  JSONException e) {
    throw new ServletException(e);
  }
  if (allow) {
    String pathInfo=path.toString();
    IPath filePath=pathInfo == null ? Path.ROOT : new Path(pathInfo);
    IFileStore file=tempGetFileStore(filePath,userName);
    if (file == null) {
      handleException(resp,new ServerStatus(IStatus.ERROR,404,NLS.bind("String_Node_Str",filePath),null));
    }
    if (fileSerializer.handleRequest(req,resp,file)) {
    }
    if (file != null) {
      addEditHeaders(resp,site,path);
    }
  }
 else {
    String msg=NLS.bind("String_Node_Str",workspaceUri);
    handleException(resp,new ServerStatus(IStatus.ERROR,HttpServletResponse.SC_FORBIDDEN,msg,null));
  }
}
Program: 180544
Project: 180544
Buggy source:
@Override public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain) throws IOException, ServletException {
  if (siteHostingService != null) {
    HttpServletRequest httpReq=(HttpServletRequest)req;
    String host=httpReq.getHeader("String_Node_Str");
    String requestUri=httpReq.getRequestURI();
    if (siteHostingService.isHosted(host) && !requestUri.startsWith(HOSTED_SITE_ALIAS)) {
      RequestDispatcher rd=httpReq.getRequestDispatcher(HOSTED_SITE_ALIAS + "String_Node_Str" + host+ requestUri);
      rd.forward(req,resp);
      return;
    }
  }
  chain.doFilter(req,resp);
}

Fixed version (ground truth):
@Override public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain) throws IOException, ServletException {
  if (siteHostingService != null) {
    HttpServletRequest httpReq=(HttpServletRequest)req;
    String host=getHostWithoutPort(httpReq);
    if (host != null) {
      String requestUri=httpReq.getRequestURI();
      if (siteHostingService.isHosted(host) && !requestUri.startsWith(HOSTED_SITE_ALIAS)) {
        RequestDispatcher rd=httpReq.getRequestDispatcher(HOSTED_SITE_ALIAS + "String_Node_Str" + host+ requestUri);
        rd.forward(req,resp);
        return;
      }
    }
  }
  chain.doFilter(req,resp);
}
Program: 180545
Project: 180545
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  traceRequest(req);
  String pathInfo=req.getPathInfo();
  IPath path=new Path(pathInfo == null ? "String_Node_Str" : pathInfo);
  if (path.segmentCount() > 0) {
    String hostedHost=path.segment(0);
    URL url=this.getMappedURL(path.removeFirstSegments(1));
    serve(req,resp,url);
  }
 else {
    super.doGet(req,resp);
  }
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  traceRequest(req);
  String pathInfo=req.getPathInfo();
  IPath path=new Path(pathInfo == null ? "String_Node_Str" : pathInfo);
  if (path.segmentCount() > 0) {
    String hostedHost=path.segment(0);
    HostedSite site=HostingActivator.getDefault().getHostingService().get(hostedHost);
    if (site != null) {
      URL url=getMappedURL(site,path.removeFirstSegments(1).makeAbsolute());
      serve(req,resp,url);
    }
 else {
    }
  }
 else {
    super.doGet(req,resp);
  }
}
Program: 180546
Project: 180546
Buggy source:
/** 
 * @param pathInfo
 * @return The pathInfo
 * @throws MalformedURLException
 */
private URL getMappedURL(IPath pathInfo) throws MalformedURLException {
  Map<String,String> map=getMap();
  IPath originalPath=pathInfo;
  IPath path=originalPath;
  String base=null;
  String rest=null;
  int count=path.segmentCount();
  for (int i=0; i <= count; i++) {
    base=map.get(path.toString());
    if (base != null) {
      rest=originalPath.removeFirstSegments(count - i).toString();
      break;
    }
    path=path.removeLastSegments(1);
  }
  if (base != null) {
    String result=base + (rest.length() == 0 || rest.startsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + rest;
    return new URL(result);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a URL  rewriting pathInfo using the most-specific
 * @param site
 * @param pathInfo
 * @return
 * @throws MalformedURLException If the target mapping is not valid URL
 */
private URL getMappedURL(HostedSite site,IPath pathInfo) throws MalformedURLException {
  Map<String,String> map=site.getMappings();
  IPath originalPath=pathInfo;
  IPath path=originalPath;
  String base=null;
  String rest=null;
  int count=path.segmentCount();
  for (int i=0; i <= count; i++) {
    base=map.get(path.toString());
    if (base != null) {
      rest=originalPath.removeFirstSegments(count - i).toString();
      break;
    }
    path=path.removeLastSegments(1);
  }
  if (base != null) {
    String result=base + (rest.length() == 0 || rest.startsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + rest;
    return new URL(result);
  }
  return null;
}
Program: 180547
Project: 180547
Buggy source:
/** 
 * Adds status field to a representation of a site configuration.
 */
private void addStatus(JSONObject siteConfigJson) throws JSONException {
  String id=siteConfigJson.getString(ProtocolConstants.KEY_ID);
  SiteConfiguration siteConfiguration=SiteConfiguration.fromId(id);
  boolean isHosted=HostingActivator.getDefault().getHostingService().isRunning(siteConfiguration);
  if (isHosted) {
    siteConfigJson.put(SiteConfigurationConstants.KEY_STATE,"String_Node_Str");
  }
 else {
    siteConfigJson.put(SiteConfigurationConstants.KEY_STATE,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Adds status field to a representation of a site configuration.
 */
private void addStatus(JSONObject siteConfigJson) throws JSONException {
  String id=siteConfigJson.getString(ProtocolConstants.KEY_ID);
  SiteConfiguration siteConfiguration=SiteConfiguration.fromId(id);
  SiteHostingService hostingService=HostingActivator.getDefault().getHostingService();
  HostedSite site=hostingService.get(siteConfiguration);
  JSONObject status=new JSONObject();
  if (site != null) {
    status.put(SiteConfigurationConstants.KEY_STATUS,"String_Node_Str");
    status.put("String_Node_Str",site.getHost());
  }
 else {
    status.put(SiteConfigurationConstants.KEY_STATUS,"String_Node_Str");
  }
  siteConfigJson.put(SiteConfigurationConstants.KEY_STATUS,status);
}
Program: 180548
Project: 180548
Buggy source:
public void stop(SiteConfiguration siteConfig,WebUser user){
  Key key=createKey(siteConfig);
synchronized (table) {
    HostedSite site=table.get(key);
    if (site == null) {
      throw new SiteHostingException("String_Node_Str");
    }
    table.remove(key);
    releaseHost(site.host);
  }
}

Fixed version (ground truth):
public void stop(SiteConfiguration siteConfig,WebUser user){
  Key key=createKey(siteConfig);
synchronized (table) {
    HostedSite site=table.get(key);
    if (site == null) {
      throw new SiteHostingException("String_Node_Str");
    }
    releaseHost(site.getHost());
    table.remove(key);
  }
}
Program: 180549
Project: 180549
Buggy source:
@Override public boolean isRunning(SiteConfiguration siteConfig){
synchronized (table) {
    return table.containsKey(createKey(siteConfig));
  }
}

Fixed version (ground truth):
@Override public boolean isRunning(SiteConfiguration siteConfig){
  return get(siteConfig) != null;
}
Program: 180550
Project: 180550
Buggy source:
private void releaseHost(String host){
  String lastByteStr=host.substring(host.lastIndexOf("String_Node_Str"));
  int lastByte=Integer.parseInt(lastByteStr);
synchronized (hostLock) {
    allocated.clear(lastByte);
    hosts.remove(host);
  }
}

Fixed version (ground truth):
private void releaseHost(String host){
  String lastByteStr=host.substring(host.lastIndexOf("String_Node_Str") + 1);
  int lastByte=Integer.parseInt(lastByteStr);
synchronized (hostLock) {
    allocated.clear(lastByte);
    hosts.remove(host);
  }
}
Program: 180551
Project: 180551
Buggy source:
public boolean removeRole(String name){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public boolean removeRole(String name){
  return false;
}
Program: 180552
Project: 180552
Buggy source:
private User internalCreateOrUpdateUser(ISecurePreferences userPrefs,User user) throws StorageException, IOException {
  userPrefs.put(USER_NAME,user.getName(),false);
  userPrefs.put(USER_PASSWORD,user.getPassword(),true);
  if (user.getRoles().size() > 0) {
    ISecurePreferences rolesPrefs=userPrefs.node(USER_ROLES);
    for (Iterator i=user.getRoles().iterator(); i.hasNext(); ) {
      Role role=(Role)i.next();
      rolesPrefs.node(role.getName());
    }
  }
  userPrefs.flush();
  return user;
}

Fixed version (ground truth):
private User internalCreateOrUpdateUser(ISecurePreferences userPrefs,User user) throws StorageException, IOException {
  userPrefs.put(USER_NAME,user.getName(),false);
  userPrefs.put(USER_PASSWORD,user.getPassword(),true);
  ISecurePreferences rolesPrefs=userPrefs.node(USER_ROLES);
  for (  String roleName : rolesPrefs.childrenNames()) {
    rolesPrefs.node(roleName).removeNode();
  }
  if (user.getRoles().size() > 0) {
    for (Iterator i=user.getRoles().iterator(); i.hasNext(); ) {
      Role role=(Role)i.next();
      rolesPrefs.node(role.getName());
    }
  }
  userPrefs.flush();
  return user;
}
Program: 180553
Project: 180553
Buggy source:
public User getUser(String key,String value){
  if (key.equals(USER_LOGIN)) {
    ISecurePreferences prefs=SecurePreferencesFactory.getDefault().node(ORION_SERVER_NODE);
    if (!prefs.nodeExists(USERS + "String_Node_Str" + value)) {
      return null;
    }
    ISecurePreferences userPrefs=prefs.node(USERS + "String_Node_Str" + value);
    try {
      return new User(value,userPrefs.get(USER_NAME,"String_Node_Str"),userPrefs.get(USER_PASSWORD,"String_Node_Str"));
    }
 catch (    StorageException e) {
      LogHelper.log(new Status(IStatus.ERROR,Activator.PI_USER_SECURESTORAGE,IStatus.ERROR,"String_Node_Str",e));
    }
  }
  return null;
}

Fixed version (ground truth):
public User getUser(String key,String value){
  if (key.equals(USER_LOGIN)) {
    ISecurePreferences prefs=SecurePreferencesFactory.getDefault().node(ORION_SERVER_NODE);
    if (!prefs.nodeExists(USERS + "String_Node_Str" + value)) {
      return null;
    }
    ISecurePreferences userPrefs=prefs.node(USERS + "String_Node_Str" + value);
    try {
      User user=new User(value,userPrefs.get(USER_NAME,"String_Node_Str"),userPrefs.get(USER_PASSWORD,"String_Node_Str"));
      ISecurePreferences roles=userPrefs.node(USER_ROLES);
      for (      String roleName : roles.childrenNames()) {
        user.addRole(getRole(roleName));
      }
      return user;
    }
 catch (    StorageException e) {
      LogHelper.log(new Status(IStatus.ERROR,Activator.PI_USER_SECURESTORAGE,IStatus.ERROR,"String_Node_Str",e));
    }
  }
  return null;
}
Program: 180554
Project: 180554
Buggy source:
public Role getRole(String name){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public Role getRole(String name){
  return roles.get(name);
}
Program: 180555
Project: 180555
Buggy source:
public SecureStorageUserAdmin(){
}

Fixed version (ground truth):
public SecureStorageUserAdmin(){
  roles.put("String_Node_Str",new Role("String_Node_Str",Role.ROLE));
  roles.put("String_Node_Str",new Role("String_Node_Str",Role.ROLE));
  roles.put("String_Node_Str",new Role("String_Node_Str",Role.ROLE));
}
Program: 180556
Project: 180556
Buggy source:
public Collection<User> getUsers(){
  ISecurePreferences prefs=SecurePreferencesFactory.getDefault().node(ORION_SERVER_NODE);
  if (!prefs.nodeExists(USERS)) {
    return null;
  }
  ISecurePreferences usersPrefs=prefs.node(USERS);
  Collection<User> users=null;
  try {
    for (    String childName : usersPrefs.childrenNames()) {
      if (users == null)       users=new ArrayList<User>();
      ISecurePreferences userPrefs=usersPrefs.node(childName);
      users.add(new User(childName,userPrefs.get(USER_NAME,"String_Node_Str"),"String_Node_Str"));
    }
    return users;
  }
 catch (  StorageException e) {
    LogHelper.log(new Status(IStatus.ERROR,Activator.PI_USER_SECURESTORAGE,IStatus.ERROR,"String_Node_Str",e));
  }
  return null;
}

Fixed version (ground truth):
public Collection<User> getUsers(){
  ISecurePreferences prefs=SecurePreferencesFactory.getDefault().node(ORION_SERVER_NODE);
  if (!prefs.nodeExists(USERS)) {
    return null;
  }
  ISecurePreferences usersPrefs=prefs.node(USERS);
  Collection<User> users=null;
  try {
    for (    String childName : usersPrefs.childrenNames()) {
      if (users == null)       users=new ArrayList<User>();
      ISecurePreferences userPrefs=usersPrefs.node(childName);
      User user=new User(childName,userPrefs.get(USER_NAME,"String_Node_Str"),"String_Node_Str");
      ISecurePreferences roles=userPrefs.node(USER_ROLES);
      for (      String roleName : roles.childrenNames()) {
        user.addRole(getRole(roleName));
      }
      users.add(user);
    }
    return users;
  }
 catch (  StorageException e) {
    LogHelper.log(new Status(IStatus.ERROR,Activator.PI_USER_SECURESTORAGE,IStatus.ERROR,"String_Node_Str",e));
  }
  return null;
}
Program: 180557
Project: 180557
Buggy source:
public Role[] getRoles(String filter) throws InvalidSyntaxException {
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public Role[] getRoles(String filter) throws InvalidSyntaxException {
  return (Role[])roles.values().toArray();
}
Program: 180559
Project: 180559
Buggy source:
@Override protected void doDelete(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String pathString=req.getPathInfo();
  if (pathString.startsWith("String_Node_Str")) {
    String login=pathString.substring("String_Node_Str".length());
    User user=(User)getUserAdmin().getUser("String_Node_Str",login);
    if (user == null) {
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str");
    }
    if (req.getParameter("String_Node_Str") != null) {
      String roles=req.getParameter("String_Node_Str");
      if (roles != null) {
        StringTokenizer tokenizer=new StringTokenizer(roles,"String_Node_Str");
        while (tokenizer.hasMoreTokens()) {
          String role=tokenizer.nextToken();
          user.removeRole(getUserAdmin().getRole(role));
        }
      }
    }
  }
 else   if (pathString.startsWith("String_Node_Str")) {
    String login=pathString.substring(1);
    OrionUserAdmin userAdmin;
    try {
      userAdmin=req.getParameter("String_Node_Str") == null ? getUserAdmin() : getUserAdmin(req.getParameter("String_Node_Str"));
    }
 catch (    UnsupportedUserStoreException e) {
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str" + req.getParameter("String_Node_Str"));
      return;
    }
    if (userAdmin.deleteUser((User)userAdmin.getUser("String_Node_Str",login)) == false) {
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override protected void doDelete(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String pathString=req.getPathInfo();
  OrionUserAdmin userAdmin;
  try {
    userAdmin=req.getParameter("String_Node_Str") == null ? getUserAdmin() : getUserAdmin(req.getParameter("String_Node_Str"));
  }
 catch (  UnsupportedUserStoreException e) {
    resp.sendError(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str" + req.getParameter("String_Node_Str"));
    return;
  }
  if (pathString.startsWith("String_Node_Str")) {
    String login=pathString.substring("String_Node_Str".length());
    User user=(User)userAdmin.getUser("String_Node_Str",login);
    if (user == null) {
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str");
    }
    if (req.getParameter("String_Node_Str") != null) {
      String roles=req.getParameter("String_Node_Str");
      if (roles != null) {
        StringTokenizer tokenizer=new StringTokenizer(roles,"String_Node_Str");
        while (tokenizer.hasMoreTokens()) {
          String role=tokenizer.nextToken();
          user.removeRole(userAdmin.getRole(role));
        }
      }
    }
    userAdmin.updateUser(login,user);
  }
 else   if (pathString.startsWith("String_Node_Str")) {
    String login=pathString.substring(1);
    if (userAdmin.deleteUser((User)userAdmin.getUser("String_Node_Str",login)) == false) {
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST,"String_Node_Str");
    }
  }
}
Program: 180560
Project: 180560
Buggy source:
/** 
 * Generate a name for the file including the current chunk id, and based on the   {@link VideoCaptureActivity#BASE_PATH} and the base name{@link VideoCaptureActivity#BASE_NAME}
 * @return the path
 */
private String createFilePath(){
  return new String(BASE_PATH + BASE_NAME + "String_Node_Str"+ currentChunkId+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Generate a name for the file including the current chunk id, and based on the   {@link VideoCaptureActivity#BASE_PATH} and the base name{@link VideoCaptureActivity#BASE_NAME}
 * @return the path
 */
private String createFilePath(){
  return new String(BASE_PATH + BASE_NAME + "String_Node_Str"+ currentChunkId+++ "String_Node_Str");
}
Program: 180561
Project: 180561
Buggy source:
/** 
 * Checks the if AST for presence of the specified property guard variables (At least 1 occurrence inside if statement list)
 * @param ast the method AST
 * @param ifAST the if AST
 */
private boolean checkGuardVar(DetailAST ifAST,String m){
  found=new boolean[guardVars.length];
  DetailAST ifSlist=ifAST.findFirstToken(TokenTypes.SLIST);
  treeTraversal(ifSlist,TokenTypes.EXPR);
  boolean foundAllGV=true;
  for (int i=0; i < found.length; i++) {
    if (!found[i]) {
      log(ifSlist.getLineNo(),"String_Node_Str" + m + "String_Node_Str"+ guardVars[i]);
      foundAllGV=false;
    }
  }
  return foundAllGV;
}

Fixed version (ground truth):
/** 
 * Checks the if AST for presence of the specified property guard variables (At least 1 occurrence inside if statement list)
 * @param ast the method AST
 * @param ifAST the if AST
 * @return true if all the guard variables have been found, false otherwise
 */
private boolean checkGuardVar(DetailAST ifAST,String m){
  found=new boolean[guardVars.length];
  DetailAST ifSlist=ifAST.findFirstToken(TokenTypes.SLIST);
  treeTraversal(ifSlist,TokenTypes.EXPR);
  boolean foundAllGV=true;
  for (int i=0; i < found.length; i++) {
    if (!found[i]) {
      log(ifSlist.getLineNo(),"String_Node_Str" + m + "String_Node_Str"+ guardVars[i]);
      foundAllGV=false;
    }
  }
  return foundAllGV;
}
Program: 180562
Project: 180562
Buggy source:
/** 
 * Checks the method AST for presence of an else statement.
 * @param ast the method AST to be checked
 * @param mName the method AST name
 */
private boolean checkElse(DetailAST ast){
  return ast.branchContains(TokenTypes.LITERAL_ELSE);
}

Fixed version (ground truth):
/** 
 * Checks the method AST for presence of an else statement.
 * @param ast the method AST to be checked
 * @return true if the branch does not contain an else statement, false otherwise
 */
private boolean checkElse(DetailAST ast){
  return !ast.branchContains(TokenTypes.LITERAL_ELSE);
}
Program: 180563
Project: 180563
Buggy source:
/** 
 * Checks the method for expressions present outside the if statement block.
 * @param ast the method AST
 */
private boolean checkOutsideIf(DetailAST ast){
  return ast.findFirstToken(TokenTypes.SLIST).getChildCount(TokenTypes.EXPR) > 0;
}

Fixed version (ground truth):
/** 
 * Checks the method for expressions present outside the if statement block.
 * @param ast the method AST
 * @return true if there are no expressions present outside the if statement, false otherwise
 */
private boolean checkOutsideIf(DetailAST ast){
  return ast.findFirstToken(TokenTypes.SLIST).getChildCount(TokenTypes.EXPR) == 0;
}
Program: 180564
Project: 180564
Buggy source:
/** 
 * This can be used to update the resource set's package registry with all needed EPackages.
 * @param resourceSet The resource set which registry has to be updated.
 * @generated
 */
@Override public void registerPackages(ResourceSet resourceSet){
  super.registerPackages(resourceSet);
}

Fixed version (ground truth):
/** 
 * This can be used to update the resource set's package registry with all needed EPackages.
 * @param resourceSet The resource set which registry has to be updated.
 * @generated
 */
@Override public void registerPackages(ResourceSet resourceSet){
  super.registerPackages(resourceSet);
  if (!isInWorkspace(org.macjariel.karel.karel.KarelPackage.class)) {
    resourceSet.getPackageRegistry().put(org.macjariel.karel.karel.KarelPackage.eINSTANCE.getNsURI(),org.macjariel.karel.karel.KarelPackage.eINSTANCE);
  }
}
Program: 180565
Project: 180565
Buggy source:
private LdapSecurityManager(){
  mGroupCache=new TimerCacheHashMap<String,Collection<String>>();
}

Fixed version (ground truth):
public LdapSecurityManager(){
  mGroupCache=new TimerCacheHashMap<String,Collection<String>>();
}
Program: 180566
Project: 180566
Buggy source:
public void addNetworkEvent(Event event){
  event.setTime(event.getTime() + network.generateDelay());
  queue.add(event);
}

Fixed version (ground truth):
public void addNetworkEvent(Event event){
  long delayedTime=event.getTime() + network.generateDelay();
  event.setTime(delayedTime);
  queue.add(event);
}
Program: 180567
Project: 180567
Buggy source:
public static Map<String,Class<? extends Event>> createEvents(){
  Map<String,Class<? extends Event>> events=new HashMap<String,Class<? extends Event>>();
  events.put(ADD_JOB,AddJobEvent.class);
  events.put(CANCEL_JOB,CancelJobEvent.class);
  events.put(SET_GRID,SetGridEvent.class);
  events.put(BROKER_DOWN,BrokerDownEvent.class);
  events.put(BROKER_UP,BrokerUpEvent.class);
  events.put(BROKER_LOGGED,BrokerLoggedEvent.class);
  events.put(HERE_IS_EXECUTION_RESULT,HereIsExecutionResultEvent.class);
  events.put(HERE_IS_WORKER,HereIsWorkerEvent.class);
  events.put(PEER_AVAILABLE,PeerAvailableEvent.class);
  events.put(PEER_FAILED,PeerFailedEvent.class);
  events.put(SCHEDULE,ScheduleEvent.class);
  events.put(WORKER_FAILED,WorkerFailedEvent.class);
  events.put(WORKER_AVAILABLE,WorkerAvailableEvent.class);
  return events;
}

Fixed version (ground truth):
public static Map<String,Class<? extends Event>> createEvents(){
  Map<String,Class<? extends Event>> events=new HashMap<String,Class<? extends Event>>();
  events.put(ADD_JOB,AddJobEvent.class);
  events.put(CANCEL_JOB,CancelJobEvent.class);
  events.put(SET_GRID,SetGridEvent.class);
  events.put(BROKER_DOWN,BrokerDownEvent.class);
  events.put(BROKER_UP,BrokerUpEvent.class);
  events.put(BROKER_LOGGED,BrokerLoggedEvent.class);
  events.put(HERE_IS_EXECUTION_RESULT,HereIsExecutionResultEvent.class);
  events.put(HERE_IS_WORKER,HereIsWorkerEvent.class);
  events.put(PEER_AVAILABLE,PeerAvailableEvent.class);
  events.put(PEER_FAILED,PeerFailedEvent.class);
  events.put(SCHEDULE,ScheduleEvent.class);
  events.put(WORKER_FAILED,WorkerFailedEvent.class);
  events.put(WORKER_AVAILABLE,WorkerAvailableEvent.class);
  events.put(WORKER_PREEMPTED,WorkerPreemptedEvent.class);
  return events;
}
Program: 180568
Project: 180568
Buggy source:
@Override public void process(OurSim ourSim){
  Peer peer=ourSim.getGrid().getObject(peerId);
  peer.setWorkerState(workerId,WorkerState.IDLE);
  peer.addAllocation(new Allocation(workerId,peerId));
}

Fixed version (ground truth):
@Override public void process(OurSim ourSim){
  Peer peer=ourSim.getGrid().getObject(peerId);
  peer.addAllocation(new Allocation(workerId,peerId));
  WorkerDistributionHelper.redistributeIdleWorker(getTime(),peer,workerId,ourSim);
}