nus-yam/ex-repair huggingface dataset:
Program: 111636
Project: 111636
Buggy source:
private void manageNetworkConnection(String containerId,String methodname,String networkId) throws DockerException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(networkId).path(methodname);
  Map<String,String> request=new HashMap<>();
  request.put("String_Node_Str",containerId);
  Response response=request(POST,Response.class,resource,resource.request(APPLICATION_JSON_TYPE),Entity.json(request));
switch (response.getStatus()) {
case 200:
    return;
case 404:
  throw new ContainerNotFoundException(containerId);
case 500:
throw new DockerException(response.readEntity(String.class));
}
}

Fixed version (ground truth):
private void manageNetworkConnection(String containerId,String methodname,String networkId) throws DockerException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(networkId).path(methodname);
  final Map<String,String> request=new HashMap<>();
  request.put("String_Node_Str",containerId);
  final Response response=request(POST,Response.class,resource,resource.request(APPLICATION_JSON_TYPE),Entity.json(request));
switch (response.getStatus()) {
case 200:
    return;
case 404:
  throw new ContainerNotFoundException(containerId);
case 500:
throw new DockerException(response.readEntity(String.class));
}
}
Program: 111637
Project: 111637
Buggy source:
@Override public LogStream logs(final String containerId,final LogsParam... params) throws DockerException, InterruptedException {
  WebTarget resource=noTimeoutResource().path("String_Node_Str").path(containerId).path("String_Node_Str");
  for (  LogsParam param : params) {
    resource=resource.queryParam(param.name(),param.value());
  }
  return getLogStream(GET,resource,containerId);
}

Fixed version (ground truth):
@Override public LogStream logs(final String containerId,final LogsParam... params) throws DockerException, InterruptedException {
  WebTarget resource=noTimeoutResource().path("String_Node_Str").path(containerId).path("String_Node_Str");
  for (  final LogsParam param : params) {
    resource=resource.queryParam(param.name(),param.value());
  }
  return getLogStream(GET,resource,containerId);
}
Program: 111638
Project: 111638
Buggy source:
@Override public EventStream events(EventsParam... params) throws DockerException, InterruptedException {
  WebTarget resource=noTimeoutResource().path("String_Node_Str");
  final Map<String,String> filters=newHashMap();
  for (  EventsParam param : params) {
    if (param instanceof EventsFilterParam) {
      filters.put(param.name(),param.value());
    }
 else {
      resource=resource.queryParam(param.name(),param.value());
    }
  }
  try {
    if (!filters.isEmpty()) {
      final StringWriter writer=new StringWriter();
      final JsonGenerator generator=objectMapper().getFactory().createGenerator(writer);
      generator.writeStartObject();
      for (      Map.Entry<String,String> entry : filters.entrySet()) {
        generator.writeArrayFieldStart(entry.getKey());
        generator.writeString(entry.getValue());
        generator.writeEndArray();
      }
      generator.writeEndObject();
      generator.close();
      final String encoded=URLEncoder.encode(writer.toString(),UTF_8.name());
      resource=resource.queryParam("String_Node_Str",encoded);
    }
  }
 catch (  IOException exception) {
    throw new DockerException(exception);
  }
  try {
    CloseableHttpClient client=(CloseableHttpClient)ApacheConnectorProvider.getHttpClient(noTimeoutClient);
    CloseableHttpResponse response=client.execute(new HttpGet(resource.getUri()));
    return new EventStream(response,objectMapper());
  }
 catch (  IOException exception) {
    throw new DockerException(exception);
  }
}

Fixed version (ground truth):
@Override public EventStream events(EventsParam... params) throws DockerException, InterruptedException {
  WebTarget resource=noTimeoutResource().path("String_Node_Str");
  final Map<String,String> filters=newHashMap();
  for (  final EventsParam param : params) {
    if (param instanceof EventsFilterParam) {
      filters.put(param.name(),param.value());
    }
 else {
      resource=resource.queryParam(param.name(),param.value());
    }
  }
  try {
    if (!filters.isEmpty()) {
      final StringWriter writer=new StringWriter();
      final JsonGenerator generator=objectMapper().getFactory().createGenerator(writer);
      generator.writeStartObject();
      for (      final Map.Entry<String,String> entry : filters.entrySet()) {
        generator.writeArrayFieldStart(entry.getKey());
        generator.writeString(entry.getValue());
        generator.writeEndArray();
      }
      generator.writeEndObject();
      generator.close();
      final String encoded=URLEncoder.encode(writer.toString(),UTF_8.name());
      resource=resource.queryParam("String_Node_Str",encoded);
    }
  }
 catch (  IOException exception) {
    throw new DockerException(exception);
  }
  try {
    final CloseableHttpClient client=(CloseableHttpClient)ApacheConnectorProvider.getHttpClient(noTimeoutClient);
    final CloseableHttpResponse response=client.execute(new HttpGet(resource.getUri()));
    return new EventStream(response,objectMapper());
  }
 catch (  IOException exception) {
    throw new DockerException(exception);
  }
}
Program: 111639
Project: 111639
Buggy source:
private String authRegistryHeader(final AuthRegistryConfig authRegistryConfig) throws DockerException {
  if (authRegistryConfig == null) {
    return "String_Node_Str";
  }
  try {
    String authRegistryJson=ObjectMapperProvider.objectMapper().writeValueAsString(authRegistryConfig);
    final String apiVersion=version().apiVersion();
    final int versionComparison=compareVersion(apiVersion,"String_Node_Str");
    if (versionComparison < 0) {
      authRegistryJson="String_Node_Str" + authRegistryJson + "String_Node_Str";
    }
 else     if (versionComparison == 0) {
      authRegistryJson="String_Node_Str" + authRegistryJson + "String_Node_Str";
    }
    log.debug("String_Node_Str",authRegistryJson);
    String authRegistryEncoded=Base64.encodeAsString(authRegistryJson);
    log.debug("String_Node_Str",authRegistryEncoded);
    return authRegistryEncoded;
  }
 catch (  JsonProcessingException|InterruptedException ex) {
    throw new DockerException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
private String authRegistryHeader(final AuthRegistryConfig authRegistryConfig) throws DockerException {
  if (authRegistryConfig == null) {
    return "String_Node_Str";
  }
  try {
    String authRegistryJson=ObjectMapperProvider.objectMapper().writeValueAsString(authRegistryConfig);
    final String apiVersion=version().apiVersion();
    final int versionComparison=compareVersion(apiVersion,"String_Node_Str");
    if (versionComparison < 0) {
      authRegistryJson="String_Node_Str" + authRegistryJson + "String_Node_Str";
    }
 else     if (versionComparison == 0) {
      authRegistryJson="String_Node_Str" + authRegistryJson + "String_Node_Str";
    }
    log.debug("String_Node_Str",authRegistryJson);
    final String authRegistryEncoded=Base64.encodeAsString(authRegistryJson);
    log.debug("String_Node_Str",authRegistryEncoded);
    return authRegistryEncoded;
  }
 catch (  JsonProcessingException|InterruptedException ex) {
    throw new DockerException("String_Node_Str",ex);
  }
}
Program: 111640
Project: 111640
Buggy source:
@Override public void copyToContainer(final Path directory,String containerId,String path) throws DockerException, InterruptedException, IOException {
  final WebTarget resource=resource().path("String_Node_Str").path(containerId).path("String_Node_Str").queryParam("String_Node_Str",true).queryParam("String_Node_Str",path);
  CompressedDirectory compressedDirectory=CompressedDirectory.create(directory);
  final InputStream fileStream=Files.newInputStream(compressedDirectory.file());
  request(PUT,String.class,resource,resource.request(APPLICATION_OCTET_STREAM_TYPE),Entity.entity(fileStream,"String_Node_Str"));
}

Fixed version (ground truth):
@Override public void copyToContainer(final Path directory,String containerId,String path) throws DockerException, InterruptedException, IOException {
  final WebTarget resource=resource().path("String_Node_Str").path(containerId).path("String_Node_Str").queryParam("String_Node_Str",true).queryParam("String_Node_Str",path);
  final CompressedDirectory compressedDirectory=CompressedDirectory.create(directory);
  final InputStream fileStream=Files.newInputStream(compressedDirectory.file());
  request(PUT,String.class,resource,resource.request(APPLICATION_OCTET_STREAM_TYPE),Entity.entity(fileStream,"String_Node_Str"));
}
Program: 111641
Project: 111641
Buggy source:
@Override public InputStream save(final String image,final AuthConfig authConfig) throws DockerException, IOException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path(image).path("String_Node_Str");
  return request(GET,InputStream.class,resource,resource.request(APPLICATION_JSON_TYPE).header("String_Node_Str",authHeader(authConfig)));
}

Fixed version (ground truth):
@Override public InputStream save(final String image,final AuthConfig authConfig) throws DockerException, IOException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(image).path("String_Node_Str");
  return request(GET,InputStream.class,resource,resource.request(APPLICATION_JSON_TYPE).header("String_Node_Str",authHeader(authConfig)));
}
Program: 111642
Project: 111642
Buggy source:
@Override public LogStream execStart(final String execId,final ExecStartParameter... params) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path(execId).path("String_Node_Str");
  final StringWriter writer=new StringWriter();
  try {
    final JsonGenerator generator=objectMapper().getFactory().createGenerator(writer);
    generator.writeStartObject();
    for (    ExecStartParameter param : params) {
      generator.writeBooleanField(param.getName(),true);
    }
    generator.writeEndObject();
    generator.close();
  }
 catch (  IOException e) {
    throw new DockerException(e);
  }
  try {
    return request(POST,LogStream.class,resource,resource.request("String_Node_Str"),Entity.json(writer.toString()));
  }
 catch (  DockerRequestException e) {
switch (e.status()) {
case 404:
      throw new ExecNotFoundException(execId);
default :
    throw e;
}
}
}

Fixed version (ground truth):
@Override public LogStream execStart(final String execId,final ExecStartParameter... params) throws DockerException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(execId).path("String_Node_Str");
  final StringWriter writer=new StringWriter();
  try {
    final JsonGenerator generator=objectMapper().getFactory().createGenerator(writer);
    generator.writeStartObject();
    for (    final ExecStartParameter param : params) {
      generator.writeBooleanField(param.getName(),true);
    }
    generator.writeEndObject();
    generator.close();
  }
 catch (  IOException e) {
    throw new DockerException(e);
  }
  try {
    return request(POST,LogStream.class,resource,resource.request("String_Node_Str"),Entity.json(writer.toString()));
  }
 catch (  DockerRequestException e) {
switch (e.status()) {
case 404:
      throw new ExecNotFoundException(execId);
default :
    throw e;
}
}
}
Program: 111643
Project: 111643
Buggy source:
@Override public void load(final String image,final InputStream imagePayload,final ProgressHandler handler) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path("String_Node_Str");
  resource=resource.queryParam("String_Node_Str","String_Node_Str").queryParam("String_Node_Str",image);
  LoadProgressHandler loadProgressHandler=new LoadProgressHandler(handler);
  Entity<InputStream> entity=Entity.entity(imagePayload,MediaType.APPLICATION_OCTET_STREAM);
  try (ProgressStream load=request(POST,ProgressStream.class,resource,resource.request(APPLICATION_JSON_TYPE).header("String_Node_Str",authHeader(authConfig)),entity)){
    load.tail(loadProgressHandler,POST,resource.getUri());
    tag(loadProgressHandler.getImageId(),image,true);
  }
 catch (  IOException e) {
    throw new DockerException(e);
  }
 finally {
    IOUtils.closeQuietly(imagePayload);
  }
}

Fixed version (ground truth):
@Override public void load(final String image,final InputStream imagePayload,final ProgressHandler handler) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path("String_Node_Str");
  resource=resource.queryParam("String_Node_Str","String_Node_Str").queryParam("String_Node_Str",image);
  final LoadProgressHandler loadProgressHandler=new LoadProgressHandler(handler);
  final Entity<InputStream> entity=Entity.entity(imagePayload,MediaType.APPLICATION_OCTET_STREAM);
  try (final ProgressStream load=request(POST,ProgressStream.class,resource,resource.request(APPLICATION_JSON_TYPE).header("String_Node_Str",authHeader(authConfig)),entity)){
    load.tail(loadProgressHandler,POST,resource.getUri());
    tag(loadProgressHandler.getImageId(),image,true);
  }
 catch (  IOException e) {
    throw new DockerException(e);
  }
 finally {
    IOUtils.closeQuietly(imagePayload);
  }
}
Program: 111644
Project: 111644
Buggy source:
@Override public String execCreate(final String containerId,final String[] cmd,final ExecCreateParam... params) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path(containerId).path("String_Node_Str");
  final StringWriter writer=new StringWriter();
  try {
    final JsonGenerator generator=objectMapper().getFactory().createGenerator(writer);
    generator.writeStartObject();
    for (    final ExecCreateParam param : params) {
      if (param.value().equals("String_Node_Str") || param.value().equals("String_Node_Str")) {
        generator.writeBooleanField(param.name(),Boolean.valueOf(param.value()));
      }
 else {
        generator.writeStringField(param.name(),param.value());
      }
    }
    generator.writeArrayFieldStart("String_Node_Str");
    for (    final String s : cmd) {
      generator.writeString(s);
    }
    generator.writeEndArray();
    generator.writeEndObject();
    generator.close();
  }
 catch (  IOException e) {
    throw new DockerException(e);
  }
  final String response;
  try {
    response=request(POST,String.class,resource,resource.request(APPLICATION_JSON_TYPE),Entity.json(writer.toString()));
  }
 catch (  DockerRequestException e) {
switch (e.status()) {
case 404:
      throw new ContainerNotFoundException(containerId);
default :
    throw e;
}
}
try {
JsonNode json=objectMapper().readTree(response);
return json.findValue("String_Node_Str").textValue();
}
 catch (IOException e) {
throw new DockerException(e);
}
}

Fixed version (ground truth):
@Override public String execCreate(final String containerId,final String[] cmd,final ExecCreateParam... params) throws DockerException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(containerId).path("String_Node_Str");
  final StringWriter writer=new StringWriter();
  try {
    final JsonGenerator generator=objectMapper().getFactory().createGenerator(writer);
    generator.writeStartObject();
    for (    final ExecCreateParam param : params) {
      if (param.value().equals("String_Node_Str") || param.value().equals("String_Node_Str")) {
        generator.writeBooleanField(param.name(),Boolean.valueOf(param.value()));
      }
 else {
        generator.writeStringField(param.name(),param.value());
      }
    }
    generator.writeArrayFieldStart("String_Node_Str");
    for (    final String s : cmd) {
      generator.writeString(s);
    }
    generator.writeEndArray();
    generator.writeEndObject();
    generator.close();
  }
 catch (  IOException e) {
    throw new DockerException(e);
  }
  final String response;
  try {
    response=request(POST,String.class,resource,resource.request(APPLICATION_JSON_TYPE),Entity.json(writer.toString()));
  }
 catch (  DockerRequestException e) {
switch (e.status()) {
case 404:
      throw new ContainerNotFoundException(containerId);
default :
    throw e;
}
}
try {
final JsonNode json=objectMapper().readTree(response);
return json.findValue("String_Node_Str").textValue();
}
 catch (IOException e) {
throw new DockerException(e);
}
}
Program: 111645
Project: 111645
Buggy source:
@Override public ExecState execInspect(final String execId) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path(execId).path("String_Node_Str");
  try {
    return request(GET,ExecState.class,resource,resource.request(APPLICATION_JSON_TYPE));
  }
 catch (  DockerRequestException e) {
switch (e.status()) {
case 404:
      throw new ExecNotFoundException(execId);
default :
    throw e;
}
}
}

Fixed version (ground truth):
@Override public ExecState execInspect(final String execId) throws DockerException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(execId).path("String_Node_Str");
  try {
    return request(GET,ExecState.class,resource,resource.request(APPLICATION_JSON_TYPE));
  }
 catch (  DockerRequestException e) {
switch (e.status()) {
case 404:
      throw new ExecNotFoundException(execId);
default :
    throw e;
}
}
}
Program: 111647
Project: 111647
Buggy source:
@Override public InputStream copyContainer(String containerId,String path) throws DockerException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(containerId).path("String_Node_Str");
  JsonNodeFactory nf=JsonNodeFactory.instance;
  final JsonNode params=nf.objectNode().set("String_Node_Str",nf.textNode(path));
  return request(POST,InputStream.class,resource,resource.request(APPLICATION_OCTET_STREAM_TYPE),Entity.json(params));
}

Fixed version (ground truth):
@Override public InputStream copyContainer(String containerId,String path) throws DockerException, InterruptedException {
  final WebTarget resource=resource().path("String_Node_Str").path(containerId).path("String_Node_Str");
  final JsonNodeFactory nf=JsonNodeFactory.instance;
  final JsonNode params=nf.objectNode().set("String_Node_Str",nf.textNode(path));
  return request(POST,InputStream.class,resource,resource.request(APPLICATION_OCTET_STREAM_TYPE),Entity.json(params));
}
Program: 111648
Project: 111648
Buggy source:
@Override public List<Container> listContainers(final ListContainersParam... params) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path("String_Node_Str");
  final Map<String,List<String>> filters=newHashMap();
  for (  ListContainersParam param : params) {
    if (param instanceof ListContainersFilterParam) {
      List<String> filterValueList;
      if (filters.containsKey(param.name())) {
        filterValueList=filters.get(param.name());
      }
 else {
        filterValueList=Lists.newArrayList();
      }
      filterValueList.add(param.value());
      filters.put(param.name(),filterValueList);
    }
 else {
      resource=resource.queryParam(urlEncode(param.name()),urlEncode(param.value()));
    }
  }
  if (!filters.isEmpty()) {
    resource=resource.queryParam("String_Node_Str",urlEncodeFilters(filters));
  }
  return request(GET,CONTAINER_LIST,resource,resource.request(APPLICATION_JSON_TYPE));
}

Fixed version (ground truth):
@Override public List<Container> listContainers(final ListContainersParam... params) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path("String_Node_Str");
  final Map<String,List<String>> filters=newHashMap();
  for (  final ListContainersParam param : params) {
    if (param instanceof ListContainersFilterParam) {
      List<String> filterValueList;
      if (filters.containsKey(param.name())) {
        filterValueList=filters.get(param.name());
      }
 else {
        filterValueList=Lists.newArrayList();
      }
      filterValueList.add(param.value());
      filters.put(param.name(),filterValueList);
    }
 else {
      resource=resource.queryParam(urlEncode(param.name()),urlEncode(param.value()));
    }
  }
  if (!filters.isEmpty()) {
    resource=resource.queryParam("String_Node_Str",urlEncodeFilters(filters));
  }
  return request(GET,CONTAINER_LIST,resource,resource.request(APPLICATION_JSON_TYPE));
}
Program: 111649
Project: 111649
Buggy source:
@Override public List<Image> listImages(final ListImagesParam... params) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path("String_Node_Str");
  final Map<String,List<String>> filters=newHashMap();
  for (  ListImagesParam param : params) {
    if (param instanceof ListImagesFilterParam) {
      List<String> filterValueList;
      if (filters.containsKey(param.name())) {
        filterValueList=filters.get(param.name());
      }
 else {
        filterValueList=Lists.newArrayList();
      }
      filterValueList.add(param.value());
      filters.put(param.name(),filterValueList);
    }
 else {
      resource=resource.queryParam(urlEncode(param.name()),urlEncode(param.value()));
    }
  }
  if (!filters.isEmpty()) {
    resource=resource.queryParam("String_Node_Str",urlEncodeFilters(filters));
  }
  return request(GET,IMAGE_LIST,resource,resource.request(APPLICATION_JSON_TYPE));
}

Fixed version (ground truth):
@Override public List<Image> listImages(final ListImagesParam... params) throws DockerException, InterruptedException {
  WebTarget resource=resource().path("String_Node_Str").path("String_Node_Str");
  final Map<String,List<String>> filters=newHashMap();
  for (  final ListImagesParam param : params) {
    if (param instanceof ListImagesFilterParam) {
      final List<String> filterValueList;
      if (filters.containsKey(param.name())) {
        filterValueList=filters.get(param.name());
      }
 else {
        filterValueList=Lists.newArrayList();
      }
      filterValueList.add(param.value());
      filters.put(param.name(),filterValueList);
    }
 else {
      resource=resource.queryParam(urlEncode(param.name()),urlEncode(param.value()));
    }
  }
  if (!filters.isEmpty()) {
    resource=resource.queryParam("String_Node_Str",urlEncodeFilters(filters));
  }
  return request(GET,IMAGE_LIST,resource,resource.request(APPLICATION_JSON_TYPE));
}
Program: 111650
Project: 111650
Buggy source:
public String readFully(){
  StringBuilder stringBuilder=new StringBuilder();
  while (hasNext()) {
    stringBuilder.append(UTF_8.decode(next().content()));
  }
  return stringBuilder.toString();
}

Fixed version (ground truth):
public String readFully(){
  final StringBuilder stringBuilder=new StringBuilder();
  while (hasNext()) {
    stringBuilder.append(UTF_8.decode(next().content()));
  }
  return stringBuilder.toString();
}
Program: 111651
Project: 111651
Buggy source:
/** 
 * Compares two version strings. <p> https://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java </p> Use this instead of String.compareTo() for a non-lexicographical comparison that works for version strings. e.g. "1.10".compareTo("1.6").
 * @param str1 a string of ordinal numbers separated by decimal points.
 * @param str2 a string of ordinal numbers separated by decimal points.
 * @return The result is a negative integer if str1 is _numerically_ less than str2. The result isa positive integer if str1 is _numerically_ greater than str2. The result is zero if the strings are _numerically_ equal. N.B. It does not work if "1.10" is supposed to be equal to "1.10.0".
 */
public static int compareVersion(String str1,String str2){
  String[] vals1=str1.split("String_Node_Str");
  String[] vals2=str2.split("String_Node_Str");
  int i=0;
  while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) {
    i++;
  }
  if (i < vals1.length && i < vals2.length) {
    int diff=Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i]));
    return Integer.signum(diff);
  }
 else {
    return Integer.signum(vals1.length - vals2.length);
  }
}

Fixed version (ground truth):
/** 
 * Compares two version strings. <p> https://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java </p> Use this instead of String.compareTo() for a non-lexicographical comparison that works for version strings. e.g. "1.10".compareTo("1.6").
 * @param str1 a string of ordinal numbers separated by decimal points.
 * @param str2 a string of ordinal numbers separated by decimal points.
 * @return The result is a negative integer if str1 is _numerically_ less than str2. The result isa positive integer if str1 is _numerically_ greater than str2. The result is zero if the strings are _numerically_ equal. N.B. It does not work if "1.10" is supposed to be equal to "1.10.0".
 */
public static int compareVersion(String str1,String str2){
  final String[] vals1=str1.split("String_Node_Str");
  final String[] vals2=str2.split("String_Node_Str");
  int i=0;
  while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) {
    i++;
  }
  if (i < vals1.length && i < vals2.length) {
    final int diff=Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i]));
    return Integer.signum(diff);
  }
 else {
    return Integer.signum(vals1.length - vals2.length);
  }
}
Program: 111652
Project: 111652
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  AttachedNetwork that=(AttachedNetwork)o;
  return Objects.equals(this.endpointId,that.endpointId) && Objects.equals(this.gateway,that.gateway) && Objects.equals(this.ipAddress,that.ipAddress)&& Objects.equals(this.ipPrefixLen,that.ipPrefixLen)&& Objects.equals(this.ipv6Gateway,that.ipv6Gateway)&& Objects.equals(this.globalIPv6Address,that.globalIPv6Address)&& Objects.equals(this.globalIPv6PrefixLen,that.globalIPv6PrefixLen)&& Objects.equals(this.macAddress,that.macAddress);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final AttachedNetwork that=(AttachedNetwork)o;
  return Objects.equals(this.endpointId,that.endpointId) && Objects.equals(this.gateway,that.gateway) && Objects.equals(this.ipAddress,that.ipAddress)&& Objects.equals(this.ipPrefixLen,that.ipPrefixLen)&& Objects.equals(this.ipv6Gateway,that.ipv6Gateway)&& Objects.equals(this.globalIPv6Address,that.globalIPv6Address)&& Objects.equals(this.globalIPv6PrefixLen,that.globalIPv6PrefixLen)&& Objects.equals(this.macAddress,that.macAddress);
}
Program: 111653
Project: 111653
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Node node=(Node)o;
  return Objects.equals(id,node.id) && Objects.equals(ip,node.ip) && Objects.equals(addr,node.addr)&& Objects.equals(name,node.name);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final Node node=(Node)o;
  return Objects.equals(id,node.id) && Objects.equals(ip,node.ip) && Objects.equals(addr,node.addr)&& Objects.equals(name,node.name);
}
Program: 111654
Project: 111654
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  ContainerStats other=(ContainerStats)obj;
  if (cpuStats == null) {
    if (other.cpuStats != null) {
      return false;
    }
  }
 else   if (!cpuStats.equals(other.cpuStats)) {
    return false;
  }
  if (memoryStats == null) {
    if (other.memoryStats != null) {
      return false;
    }
  }
 else   if (!memoryStats.equals(other.memoryStats)) {
    return false;
  }
  if (network == null) {
    if (other.network != null) {
      return false;
    }
  }
 else   if (!network.equals(other.network)) {
    return false;
  }
  if (precpuStats == null) {
    if (other.precpuStats != null) {
      return false;
    }
  }
 else   if (!precpuStats.equals(other.precpuStats)) {
    return false;
  }
  if (read == null) {
    if (other.read != null) {
      return false;
    }
  }
 else   if (!read.equals(other.read)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final ContainerStats other=(ContainerStats)obj;
  if (cpuStats == null) {
    if (other.cpuStats != null) {
      return false;
    }
  }
 else   if (!cpuStats.equals(other.cpuStats)) {
    return false;
  }
  if (memoryStats == null) {
    if (other.memoryStats != null) {
      return false;
    }
  }
 else   if (!memoryStats.equals(other.memoryStats)) {
    return false;
  }
  if (network == null) {
    if (other.network != null) {
      return false;
    }
  }
 else   if (!network.equals(other.network)) {
    return false;
  }
  if (precpuStats == null) {
    if (other.precpuStats != null) {
      return false;
    }
  }
 else   if (!precpuStats.equals(other.precpuStats)) {
    return false;
  }
  if (read == null) {
    if (other.read != null) {
      return false;
    }
  }
 else   if (!read.equals(other.read)) {
    return false;
  }
  return true;
}
Program: 111655
Project: 111655
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  CpuStats other=(CpuStats)obj;
  if (cpuUsage == null) {
    if (other.cpuUsage != null) {
      return false;
    }
  }
 else   if (!cpuUsage.equals(other.cpuUsage)) {
    return false;
  }
  if (systemCpuUsage == null) {
    if (other.systemCpuUsage != null) {
      return false;
    }
  }
 else   if (!systemCpuUsage.equals(other.systemCpuUsage)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final CpuStats other=(CpuStats)obj;
  if (cpuUsage == null) {
    if (other.cpuUsage != null) {
      return false;
    }
  }
 else   if (!cpuUsage.equals(other.cpuUsage)) {
    return false;
  }
  if (systemCpuUsage == null) {
    if (other.systemCpuUsage != null) {
      return false;
    }
  }
 else   if (!systemCpuUsage.equals(other.systemCpuUsage)) {
    return false;
  }
  return true;
}
Program: 111656
Project: 111656
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  CpuUsage other=(CpuUsage)obj;
  if (percpuUsage == null) {
    if (other.percpuUsage != null) {
      return false;
    }
  }
 else   if (!percpuUsage.equals(other.percpuUsage)) {
    return false;
  }
  if (totalUsage == null) {
    if (other.totalUsage != null) {
      return false;
    }
  }
 else   if (!totalUsage.equals(other.totalUsage)) {
    return false;
  }
  if (usageInKernelmode == null) {
    if (other.usageInKernelmode != null) {
      return false;
    }
  }
 else   if (!usageInKernelmode.equals(other.usageInKernelmode)) {
    return false;
  }
  if (usageInUsermode == null) {
    if (other.usageInUsermode != null) {
      return false;
    }
  }
 else   if (!usageInUsermode.equals(other.usageInUsermode)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final CpuUsage other=(CpuUsage)obj;
  if (percpuUsage == null) {
    if (other.percpuUsage != null) {
      return false;
    }
  }
 else   if (!percpuUsage.equals(other.percpuUsage)) {
    return false;
  }
  if (totalUsage == null) {
    if (other.totalUsage != null) {
      return false;
    }
  }
 else   if (!totalUsage.equals(other.totalUsage)) {
    return false;
  }
  if (usageInKernelmode == null) {
    if (other.usageInKernelmode != null) {
      return false;
    }
  }
 else   if (!usageInKernelmode.equals(other.usageInKernelmode)) {
    return false;
  }
  if (usageInUsermode == null) {
    if (other.usageInUsermode != null) {
      return false;
    }
  }
 else   if (!usageInUsermode.equals(other.usageInUsermode)) {
    return false;
  }
  return true;
}
Program: 111657
Project: 111657
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  RestartPolicy that=(RestartPolicy)o;
  if (name != null ? !name.equals(that.name) : that.name != null) {
    return false;
  }
  return maxRetryCount != null ? maxRetryCount.equals(that.maxRetryCount) : that.maxRetryCount == null;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final RestartPolicy that=(RestartPolicy)o;
  if (name != null ? !name.equals(that.name) : that.name != null) {
    return false;
  }
  return maxRetryCount != null ? maxRetryCount.equals(that.maxRetryCount) : that.maxRetryCount == null;
}
Program: 111658
Project: 111658
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Image that=(Image)o;
  return Objects.equals(this.created,that.created) && Objects.equals(this.id,that.id) && Objects.equals(this.parentId,that.parentId)&& Objects.equals(this.repoTags,that.repoTags)&& Objects.equals(this.size,that.size)&& Objects.equals(this.virtualSize,that.virtualSize)&& Objects.equals(this.labels,that.labels);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final Image that=(Image)o;
  return Objects.equals(this.created,that.created) && Objects.equals(this.id,that.id) && Objects.equals(this.parentId,that.parentId)&& Objects.equals(this.repoTags,that.repoTags)&& Objects.equals(this.size,that.size)&& Objects.equals(this.virtualSize,that.virtualSize)&& Objects.equals(this.labels,that.labels);
}
Program: 111659
Project: 111659
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Info info=(Info)o;
  if (containers != info.containers) {
    return false;
  }
  if (debug != null ? !debug.equals(info.debug) : info.debug != null) {
    return false;
  }
  if (eventsListener != info.eventsListener) {
    return false;
  }
  if (fileDescriptors != info.fileDescriptors) {
    return false;
  }
  if (goroutines != info.goroutines) {
    return false;
  }
  if (images != info.images) {
    return false;
  }
  if (executionDriver != null ? !executionDriver.equals(info.executionDriver) : info.executionDriver != null) {
    return false;
  }
  if (initPath != null ? !initPath.equals(info.initPath) : info.initPath != null) {
    return false;
  }
  if (kernelVersion != null ? !kernelVersion.equals(info.kernelVersion) : info.kernelVersion != null) {
    return false;
  }
  if (storageDriver != null ? !storageDriver.equals(info.storageDriver) : info.storageDriver != null) {
    return false;
  }
  if (memoryLimit != null ? !memoryLimit.equals(info.memoryLimit) : info.memoryLimit != null) {
    return false;
  }
  if (swapLimit != null ? !swapLimit.equals(info.swapLimit) : info.swapLimit != null) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final Info info=(Info)o;
  if (containers != info.containers) {
    return false;
  }
  if (debug != null ? !debug.equals(info.debug) : info.debug != null) {
    return false;
  }
  if (eventsListener != info.eventsListener) {
    return false;
  }
  if (fileDescriptors != info.fileDescriptors) {
    return false;
  }
  if (goroutines != info.goroutines) {
    return false;
  }
  if (images != info.images) {
    return false;
  }
  if (executionDriver != null ? !executionDriver.equals(info.executionDriver) : info.executionDriver != null) {
    return false;
  }
  if (initPath != null ? !initPath.equals(info.initPath) : info.initPath != null) {
    return false;
  }
  if (kernelVersion != null ? !kernelVersion.equals(info.kernelVersion) : info.kernelVersion != null) {
    return false;
  }
  if (storageDriver != null ? !storageDriver.equals(info.storageDriver) : info.storageDriver != null) {
    return false;
  }
  if (memoryLimit != null ? !memoryLimit.equals(info.memoryLimit) : info.memoryLimit != null) {
    return false;
  }
  if (swapLimit != null ? !swapLimit.equals(info.swapLimit) : info.swapLimit != null) {
    return false;
  }
  return true;
}
Program: 111660
Project: 111660
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Ipam that=(Ipam)o;
  return Objects.equals(this.driver,that.driver) && Objects.equals(this.config,that.config);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final Ipam that=(Ipam)o;
  return Objects.equals(this.driver,that.driver) && Objects.equals(this.config,that.config);
}
Program: 111661
Project: 111661
Buggy source:
public Builder config(final String subnet,final String ipRange,final String gateway){
  IpamConfig config=new IpamConfig();
  config.subnet(subnet);
  config.ipRange(ipRange);
  config.gateway(gateway);
  configs.add(config);
  return this;
}

Fixed version (ground truth):
public Builder config(final String subnet,final String ipRange,final String gateway){
  final IpamConfig config=new IpamConfig();
  config.subnet(subnet);
  config.ipRange(ipRange);
  config.gateway(gateway);
  configs.add(config);
  return this;
}
Program: 111662
Project: 111662
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  IpamConfig that=(IpamConfig)o;
  return Objects.equals(this.subnet,that.subnet) && Objects.equals(this.ipRange,that.ipRange) && Objects.equals(this.gateway,that.gateway);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final IpamConfig that=(IpamConfig)o;
  return Objects.equals(this.subnet,that.subnet) && Objects.equals(this.ipRange,that.ipRange) && Objects.equals(this.gateway,that.gateway);
}
Program: 111663
Project: 111663
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  MemoryStats other=(MemoryStats)obj;
  if (failcnt == null) {
    if (other.failcnt != null) {
      return false;
    }
  }
 else   if (!failcnt.equals(other.failcnt)) {
    return false;
  }
  if (limit == null) {
    if (other.limit != null) {
      return false;
    }
  }
 else   if (!limit.equals(other.limit)) {
    return false;
  }
  if (maxUsage == null) {
    if (other.maxUsage != null) {
      return false;
    }
  }
 else   if (!maxUsage.equals(other.maxUsage)) {
    return false;
  }
  if (usage == null) {
    if (other.usage != null) {
      return false;
    }
  }
 else   if (!usage.equals(other.usage)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final MemoryStats other=(MemoryStats)obj;
  if (failcnt == null) {
    if (other.failcnt != null) {
      return false;
    }
  }
 else   if (!failcnt.equals(other.failcnt)) {
    return false;
  }
  if (limit == null) {
    if (other.limit != null) {
      return false;
    }
  }
 else   if (!limit.equals(other.limit)) {
    return false;
  }
  if (maxUsage == null) {
    if (other.maxUsage != null) {
      return false;
    }
  }
 else   if (!maxUsage.equals(other.maxUsage)) {
    return false;
  }
  if (usage == null) {
    if (other.usage != null) {
      return false;
    }
  }
 else   if (!usage.equals(other.usage)) {
    return false;
  }
  return true;
}
Program: 111664
Project: 111664
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Network that=(Network)o;
  return Objects.equals(this.name,that.name) && Objects.equals(this.id,that.id) && Objects.equals(this.scope,that.scope)&& Objects.equals(this.driver,that.driver)&& Objects.equals(this.options,that.options);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final Network that=(Network)o;
  return Objects.equals(this.name,that.name) && Objects.equals(this.id,that.id) && Objects.equals(this.scope,that.scope)&& Objects.equals(this.driver,that.driver)&& Objects.equals(this.options,that.options);
}
Program: 111665
Project: 111665
Buggy source:
private static String startAuthedRegistry(final DockerClient client) throws Exception {
  final Map<String,List<PortBinding>> ports=Collections.singletonMap("String_Node_Str",Collections.singletonList(PortBinding.of("String_Node_Str",5000)));
  final HostConfig hostConfig=HostConfig.builder().portBindings(ports).binds(ImmutableList.of(Resources.getResource("String_Node_Str").getPath() + "String_Node_Str",Resources.getResource("String_Node_Str").getPath() + "String_Node_Str")).build();
  final ContainerConfig containerConfig=ContainerConfig.builder().image(REGISTRY_IMAGE).hostConfig(hostConfig).env(ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")).build();
  return startAndAwaitContainer(client,containerConfig,REGISTRY_NAME);
}

Fixed version (ground truth):
private static String startAuthedRegistry(final DockerClient client) throws Exception {
  final Map<String,List<PortBinding>> ports=Collections.singletonMap("String_Node_Str",Collections.singletonList(PortBinding.of("String_Node_Str",5000)));
  final HostConfig hostConfig=HostConfig.builder().portBindings(ports).binds(ImmutableList.of(Resources.getResource("String_Node_Str").getPath() + "String_Node_Str",Resources.getResource("String_Node_Str").getPath() + "String_Node_Str")).build();
  final ContainerConfig containerConfig=ContainerConfig.builder().image(REGISTRY_IMAGE).hostConfig(hostConfig).env(ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")).build();
  return startAndAwaitContainer(client,containerConfig,REGISTRY_NAME);
}
Program: 111666
Project: 111666
Buggy source:
public X509HostnameVerifier hostnameVerifier(){
  return SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;
}

Fixed version (ground truth):
public HostnameVerifier hostnameVerifier(){
  return NoopHostnameVerifier.INSTANCE;
}
Program: 111667
Project: 111667
Buggy source:
@Test public void testContainerWithCpuQuota() throws Exception {
  assumeTrue("String_Node_Str" + "String_Node_Str" + sut.version().apiVersion(),versionCompare(sut.version().apiVersion(),"String_Node_Str") >= 0);
  assumeFalse(CIRCLECI);
  sut.pull(BUSYBOX_LATEST);
  final boolean privileged=true;
  final boolean publishAllPorts=true;
  final String dns="String_Node_Str";
  final HostConfig expected=HostConfig.builder().privileged(privileged).publishAllPorts(publishAllPorts).dns(dns).cpuQuota((long)50000).build();
  final ContainerConfig config=ContainerConfig.builder().image(BUSYBOX_LATEST).hostConfig(expected).build();
  final String name=randomName();
  final ContainerCreation creation=sut.createContainer(config,name);
  final String id=creation.id();
  sut.startContainer(id);
  final HostConfig actual=sut.inspectContainer(id).hostConfig();
  assertThat(actual.privileged(),equalTo(expected.privileged()));
  assertThat(actual.publishAllPorts(),equalTo(expected.publishAllPorts()));
  assertThat(actual.dns(),equalTo(expected.dns()));
  assertThat(actual.cpuQuota(),equalTo(expected.cpuQuota()));
}

Fixed version (ground truth):
@Test public void testContainerWithCpuQuota() throws Exception {
  assumeTrue("String_Node_Str" + "String_Node_Str" + sut.version().apiVersion(),compareVersion(sut.version().apiVersion(),"String_Node_Str") >= 0);
  assumeFalse(CIRCLECI);
  sut.pull(BUSYBOX_LATEST);
  final boolean privileged=true;
  final boolean publishAllPorts=true;
  final String dns="String_Node_Str";
  final HostConfig expected=HostConfig.builder().privileged(privileged).publishAllPorts(publishAllPorts).dns(dns).cpuQuota((long)50000).build();
  final ContainerConfig config=ContainerConfig.builder().image(BUSYBOX_LATEST).hostConfig(expected).build();
  final String name=randomName();
  final ContainerCreation creation=sut.createContainer(config,name);
  final String id=creation.id();
  sut.startContainer(id);
  final HostConfig actual=sut.inspectContainer(id).hostConfig();
  assertThat(actual.privileged(),equalTo(expected.privileged()));
  assertThat(actual.publishAllPorts(),equalTo(expected.publishAllPorts()));
  assertThat(actual.dns(),equalTo(expected.dns()));
  assertThat(actual.cpuQuota(),equalTo(expected.cpuQuota()));
}
Program: 111668
Project: 111668
Buggy source:
/** 
 * Show exited containers.
 * @return ListContainersParam
 */
public static ListContainersParam exitedContainers() throws UnsupportedEncodingException {
  return create("String_Node_Str",URLEncoder.encode("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Show exited containers.
 * @return ListContainersParam
 */
public static ListContainersParam exitedContainers(){
  try {
    return create("String_Node_Str",URLEncoder.encode("String_Node_Str","String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
    throw Throwables.propagate(e);
  }
}
Program: 111669
Project: 111669
Buggy source:
/** 
 * Returns the specified credential from the specified path to the docker file. This method is package-local so we can test it.
 * @return a {@link Builder}
 * @throws IOException
 */
@VisibleForTesting static Builder fromDockerConfig(final Path configPath,final String serverAddress) throws IOException {
  return parseDockerConfig(configPath,serverAddress);
}

Fixed version (ground truth):
/** 
 * Returns the specified credential from the specified path to the docker file. This method is package-local so we can test it.
 * @param configPath The path to the config file
 * @param serverAddress A string representing the server address
 * @return a {@link Builder}
 * @throws IOException
 */
@VisibleForTesting static Builder fromDockerConfig(final Path configPath,final String serverAddress) throws IOException {
  return parseDockerConfig(configPath,serverAddress);
}
Program: 111670
Project: 111670
Buggy source:
/** 
 * Provide certificates to secure the connection to Docker.
 */
public Builder dockerCertificates(final DockerCertificates dockerCertificates){
  this.dockerCertificates=dockerCertificates;
  return this;
}

Fixed version (ground truth):
/** 
 * Provide certificates to secure the connection to Docker.
 * @param dockerCertificates DockerCertificates object
 * @return Builder
 */
public Builder dockerCertificates(final DockerCertificates dockerCertificates){
  this.dockerCertificates=dockerCertificates;
  return this;
}