nus-yam/ex-repair huggingface dataset:
Program: 16671
Project: 16671
Buggy source:
private void setupExplodedWar() throws MojoExecutionException {
  getLog().info("String_Node_Str" + hostedWebapp);
  if (copyWebapp && !warSourceDirectory.getAbsolutePath().equals(hostedWebapp.getAbsolutePath())) {
    try {
      String excludes=StringUtils.join(DEFAULTEXCLUDES,"String_Node_Str");
      FileUtils.copyDirectory(warSourceDirectory,hostedWebapp,"String_Node_Str",excludes);
    }
 catch (    IOException e) {
      throw new MojoExecutionException("String_Node_Str" + hostedWebapp,e);
    }
  }
  File classes=new File(hostedWebapp,"String_Node_Str");
  classes.mkdirs();
  if (!buildOutputDirectory.getAbsolutePath().equals(classes.getAbsolutePath())) {
    getLog().warn("String_Node_Str" + "String_Node_Str");
    try {
      FileUtils.copyDirectoryStructure(buildOutputDirectory,classes);
    }
 catch (    IOException e) {
      throw new MojoExecutionException("String_Node_Str" + classes,e);
    }
  }
  File lib=new File(hostedWebapp,"String_Node_Str");
  lib.mkdirs();
  Collection<Artifact> artifacts=getProjectRuntimeArtifacts();
  for (  Artifact artifact : artifacts) {
    try {
      if (!artifact.getFile().isDirectory()) {
        FileUtils.copyFileToDirectory(artifact.getFile(),lib);
      }
    }
 catch (    IOException e) {
      throw new MojoExecutionException("String_Node_Str" + artifact,e);
    }
  }
}

Fixed version (ground truth):
private void setupExplodedWar() throws MojoExecutionException {
  getLog().info("String_Node_Str" + hostedWebapp);
  if (copyWebapp && !warSourceDirectory.getAbsolutePath().equals(hostedWebapp.getAbsolutePath())) {
    try {
      copyDirectoryStructureIfModified(warSourceDirectory,hostedWebapp);
    }
 catch (    IOException e) {
      throw new MojoExecutionException("String_Node_Str" + hostedWebapp,e);
    }
  }
  File classes=new File(hostedWebapp,"String_Node_Str");
  classes.mkdirs();
  if (!buildOutputDirectory.getAbsolutePath().equals(classes.getAbsolutePath())) {
    getLog().warn("String_Node_Str" + "String_Node_Str");
    try {
      FileUtils.copyDirectoryStructure(buildOutputDirectory,classes);
    }
 catch (    IOException e) {
      throw new MojoExecutionException("String_Node_Str" + classes,e);
    }
  }
  File lib=new File(hostedWebapp,"String_Node_Str");
  lib.mkdirs();
  Collection<Artifact> artifacts=getProjectRuntimeArtifacts();
  for (  Artifact artifact : artifacts) {
    try {
      if (!artifact.getFile().isDirectory()) {
        FileUtils.copyFileToDirectory(artifact.getFile(),lib);
      }
    }
 catch (    IOException e) {
      throw new MojoExecutionException("String_Node_Str" + artifact,e);
    }
  }
}
Program: 16672
Project: 16672
Buggy source:
public boolean containsKey(final Object key){
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  for (  final Entry<String,String> e : data) {
    if (key.equals(e.getKey())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean containsKey(final Object key){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  final Entry<String,String> e : data) {
    if (key.equals(e.getKey())) {
      return true;
    }
  }
  return false;
}
Program: 16673
Project: 16673
Buggy source:
public boolean containsValue(final Object value){
  if (value == null) {
    throw new NullPointerException("String_Node_Str");
  }
  for (  final Entry<String,String> e : data) {
    if (value.equals(e.getValue())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean containsValue(final Object value){
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  final Entry<String,String> e : data) {
    if (value.equals(e.getValue())) {
      return true;
    }
  }
  return false;
}
Program: 16674
Project: 16674
Buggy source:
public UrlParameterMultimap remove(final String key,final String value){
  if (key == null || value == null) {
    throw new NullPointerException("String_Node_Str");
  }
  for (  final Entry<String,String> e : data) {
    if (key.equals(e.getKey()) && value.equals(e.getValue())) {
      data.remove(e);
    }
  }
  return this;
}

Fixed version (ground truth):
public UrlParameterMultimap remove(final String key,final String value){
  if (key == null || value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  final Entry<String,String> e : data) {
    if (key.equals(e.getKey()) && value.equals(e.getValue())) {
      data.remove(e);
    }
  }
  return this;
}
Program: 16675
Project: 16675
Buggy source:
public static UrlBuilder fromString(final String url,final Charset inputEncoding){
  if (url.isEmpty()) {
    return new UrlBuilder();
  }
  final Matcher m=URI_PATTERN.matcher(url);
  String protocol=null, hostName=null, path=null, anchor=null;
  Integer port=null;
  Map<String,List<String>> queryParameters=null;
  if (m.find()) {
    protocol=m.group(2);
    if (m.group(4) != null) {
      final Matcher n=AUTHORITY_PATTERN.matcher(m.group(4));
      if (n.find()) {
        hostName=IDN.toUnicode(n.group(1));
        if (n.group(3) != null) {
          port=Integer.parseInt(n.group(3));
        }
      }
    }
    path=decodePath(m.group(5),inputEncoding);
    queryParameters=decodeQueryParameters(m.group(7),inputEncoding);
    anchor=m.group(9);
  }
  return of(inputEncoding,DEFAULT_ENCODING,protocol,hostName,port,path,queryParameters,anchor);
}

Fixed version (ground truth):
public static UrlBuilder fromString(final String url,final Charset inputEncoding){
  if (url.isEmpty()) {
    return new UrlBuilder();
  }
  final Matcher m=URI_PATTERN.matcher(url);
  String protocol=null, hostName=null, path=null, anchor=null;
  Integer port=null;
  final Map<String,List<String>> queryParameters;
  if (m.find()) {
    protocol=m.group(2);
    if (m.group(4) != null) {
      final Matcher n=AUTHORITY_PATTERN.matcher(m.group(4));
      if (n.find()) {
        hostName=IDN.toUnicode(n.group(1));
        if (n.group(3) != null) {
          port=Integer.parseInt(n.group(3));
        }
      }
    }
    path=decodePath(m.group(5),inputEncoding);
    queryParameters=decodeQueryParameters(m.group(7),inputEncoding);
    anchor=m.group(9);
  }
 else {
    queryParameters=emptyMap();
  }
  return of(inputEncoding,DEFAULT_ENCODING,protocol,hostName,port,path,queryParameters,anchor);
}
Program: 16676
Project: 16676
Buggy source:
/** 
 * Construct a UrlBuilder from a   {@link java.net.URI}.
 */
public static UrlBuilder fromUri(final URI uri){
  return of(DEFAULT_ENCODING,DEFAULT_ENCODING,uri.getScheme(),uri.getUserInfo(),uri.getHost(),uri.getPort() == -1 ? null : uri.getPort(),uri.getRawPath(),decodeQueryParameters(uri.getRawQuery(),DEFAULT_ENCODING),uri.getFragment());
}

Fixed version (ground truth):
/** 
 * Construct a UrlBuilder from a   {@link java.net.URI}.
 */
public static UrlBuilder fromUri(final URI uri){
  return of(DEFAULT_ENCODING,DEFAULT_ENCODING,uri.getScheme(),uri.getUserInfo(),uri.getHost(),uri.getPort() == -1 ? null : uri.getPort(),urlDecode(uri.getRawPath(),DEFAULT_ENCODING),decodeQueryParameters(uri.getRawQuery(),DEFAULT_ENCODING),uri.getFragment());
}
Program: 16677
Project: 16677
Buggy source:
/** 
 * Construct a UrlBuilder from a full or partial URL string. When percent-decoding the query parameters, assume that they were encoded with <b>inputEncoding</b>.
 * @throws NumberFormatException if the input contains a invalid percent-encoding sequence (%ax) or a non-numeric port
 */
public static UrlBuilder fromString(final String url,final Charset inputEncoding){
  if (url == null || url.isEmpty()) {
    return new UrlBuilder();
  }
  final Matcher m=URI_PATTERN.matcher(url);
  String scheme=null, userInfo=null, hostName=null, path=null, fragment=null;
  Integer port=null;
  final Map<String,List<String>> queryParameters;
  if (m.find()) {
    scheme=m.group(2);
    if (m.group(4) != null) {
      final Matcher n=AUTHORITY_PATTERN.matcher(m.group(4));
      if (n.find()) {
        if (n.group(2) != null) {
          userInfo=n.group(2);
        }
        if (n.group(3) != null) {
          hostName=IDN.toUnicode(n.group(3));
        }
        if (n.group(4) != null) {
          port=Integer.parseInt(n.group(4));
        }
      }
    }
    path=decodePath(m.group(5),inputEncoding);
    queryParameters=decodeQueryParameters(m.group(7),inputEncoding);
    fragment=m.group(9);
  }
 else {
    queryParameters=emptyMap();
  }
  return of(inputEncoding,DEFAULT_ENCODING,scheme,userInfo,hostName,port,path,queryParameters,fragment);
}

Fixed version (ground truth):
/** 
 * Construct a UrlBuilder from a full or partial URL string. When percent-decoding the query parameters, assume that they were encoded with <b>inputEncoding</b>.
 * @throws NumberFormatException if the input contains a invalid percent-encoding sequence (%ax) or a non-numeric port
 */
public static UrlBuilder fromString(final String url,final Charset inputEncoding){
  if (url == null || url.isEmpty()) {
    return new UrlBuilder();
  }
  final Matcher m=URI_PATTERN.matcher(url);
  String scheme=null, userInfo=null, hostName=null, path=null, fragment=null;
  Integer port=null;
  final Map<String,List<String>> queryParameters;
  if (m.find()) {
    scheme=m.group(2);
    if (m.group(4) != null) {
      final Matcher n=AUTHORITY_PATTERN.matcher(m.group(4));
      if (n.find()) {
        if (n.group(2) != null) {
          userInfo=n.group(2);
        }
        if (n.group(3) != null) {
          hostName=IDN.toUnicode(n.group(3));
        }
        if (n.group(5) != null) {
          port=Integer.parseInt(n.group(5));
        }
      }
    }
    path=decodePath(m.group(5),inputEncoding);
    queryParameters=decodeQueryParameters(m.group(7),inputEncoding);
    fragment=m.group(9);
  }
 else {
    queryParameters=emptyMap();
  }
  return of(inputEncoding,DEFAULT_ENCODING,scheme,userInfo,hostName,port,path,queryParameters,fragment);
}
Program: 16678
Project: 16678
Buggy source:
/** 
 * Find all resources, and return the full collection (plain list not paginated)<br/> REST webservice published : GET /?page=no
 * @return OK http status code if the request has been correctly processed, with the list of all resource enclosed in the body. Be carefull, this list should be big since it will return ALL resources. In this case, consider using paginated findAll method instead.
 */
@RequestMapping(method=RequestMethod.GET,params="String_Node_Str",produces="String_Node_Str") @ResponseBody Iterable<T> findAll();

Fixed version (ground truth):
/** 
 * Find all resources, and return the full collection (plain list not paginated)<br/> REST webservice published : GET /?page=no
 * @return OK http status code if the request has been correctly processed, with the list of all resource enclosed in the body.Be careful, this list should be big since it will return ALL resources. In this case, consider using paginated findAll method instead.
 */
@RequestMapping(method=RequestMethod.GET,params="String_Node_Str") @ResponseBody Iterable<T> findAll();
Program: 16679
Project: 16679
Buggy source:
@Test(expectedExceptions={NotImplementedClientException.class}) public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response r=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  Assertions.assertThat(r).isNotNull();
  Assertions.assertThat(r.getStatus()).isEqualTo(Http.NOT_IMPLEMENTED);
}

Fixed version (ground truth):
@Test public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  List<Sample> samples=response.resource(new TypeReference<List<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.size()).isEqualTo(2);
  Assertions.assertThat(samples.get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16680
Project: 16680
Buggy source:
@Test(expectedExceptions={NotImplementedClientException.class}) public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response r=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  Assertions.assertThat(r).isNotNull();
  Assertions.assertThat(r.getStatus()).isEqualTo(Http.NOT_IMPLEMENTED);
}

Fixed version (ground truth):
@Test public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  List<Sample> samples=response.resource(new TypeReference<List<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.size()).isEqualTo(2);
  Assertions.assertThat(samples.get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16682
Project: 16682
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Page<T> findPaginated(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer page,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer size){
  Assert.isTrue(page > 0,"String_Node_Str");
  return this.repository.findAll(new PageRequest(page - 1,size));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Page<T> findPaginated(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer page,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer size,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") String direction,@RequestParam(value="String_Node_Str",required=false) String properties){
  Assert.isTrue(page > 0,"String_Node_Str");
  Assert.isTrue(direction.isEmpty() || direction.equalsIgnoreCase(Sort.Direction.ASC.toString()) || direction.equalsIgnoreCase(Sort.Direction.DESC.toString()),"String_Node_Str");
  if (direction.isEmpty()) {
    return this.repository.findAll(new PageRequest(page - 1,size));
  }
 else {
    Assert.notNull(properties);
    return this.repository.findAll(new PageRequest(page - 1,size,new Sort(Sort.Direction.fromString(direction.toUpperCase()),properties.split("String_Node_Str"))));
  }
}
Program: 16683
Project: 16683
Buggy source:
/** 
 * Find all resources, and return a paginated collection<br/> REST webservice published : GET /search?page=0&size=20
 * @param page   Page number starting from 0. default to 0
 * @param size   Number of resources by pages. default to 10
 * @return OK http status code if the request has been correctly processed, with the a paginated collection of all resource enclosed in the body.
 */
@RequestMapping(method=RequestMethod.GET) @ResponseBody Page<T> findPaginated(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer page,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer size);

Fixed version (ground truth):
/** 
 * Find all resources, and return a paginated and optionaly sorted collection<br/> REST webservice published : GET /search?page=0&size=20 or GET /search?page=0&size=20&direction=desc&properties=name
 * @param page   Page number starting from 0. default to 0
 * @param size   Number of resources by pages. default to 10
 * @param direction Optional sort direction, could be "asc" or "desc"
 * @param properties Ordered list of comma separeted properies used for sorting resulats. At least one property should be provided if direction is specified
 * @return OK http status code if the request has been correctly processed, with the a paginated collection of all resource enclosed in the body.
 */
@RequestMapping(method=RequestMethod.GET) @ResponseBody Page<T> findPaginated(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer page,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer size,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") String direction,@RequestParam(value="String_Node_Str",required=false) String properties);
Program: 16684
Project: 16684
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Page<T> findPaginated(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer page,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer size){
  Assert.isTrue(page > 0,"String_Node_Str");
  return this.service.findAll(new PageRequest(page - 1,size));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Page<T> findPaginated(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer page,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") Integer size,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") String direction,@RequestParam(value="String_Node_Str",required=false) String properties){
  Assert.isTrue(page > 0,"String_Node_Str");
  Assert.isTrue(direction.isEmpty() || direction.equalsIgnoreCase(Sort.Direction.ASC.toString()) || direction.equalsIgnoreCase(Sort.Direction.DESC.toString()),"String_Node_Str");
  if (direction.isEmpty()) {
    return this.service.findAll(new PageRequest(page - 1,size));
  }
 else {
    Assert.notNull(properties);
    return this.service.findAll(new PageRequest(page - 1,size,new Sort(Sort.Direction.fromString(direction.toUpperCase()),properties.split("String_Node_Str"))));
  }
}
Program: 16685
Project: 16685
Buggy source:
@Test public void testSample(){
  Sample sample=this.request("String_Node_Str").getJson().resource(Sample.class);
  Assertions.assertThat(sample).isNotNull();
  Assertions.assertThat(sample.getName()).isEqualTo("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSample(){
  Sample sample=this.request("String_Node_Str").jsonGet().resource(Sample.class);
  Assertions.assertThat(sample).isNotNull();
  Assertions.assertThat(sample.getName()).isEqualTo("String_Node_Str");
}
Program: 16686
Project: 16686
Buggy source:
@Test(expectedExceptions=ConflictClientException.class) public void testEntityExistsException(){
  this.request("String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions=ConflictClientException.class) public void testEntityExistsException(){
  this.request("String_Node_Str").jsonGet();
}
Program: 16687
Project: 16687
Buggy source:
@Test(expectedExceptions=BadRequestClientException.class) public void testIllegalArgumentException(){
  this.request("String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions=BadRequestClientException.class) public void testIllegalArgumentException(){
  this.request("String_Node_Str").jsonGet();
}
Program: 16688
Project: 16688
Buggy source:
@Test(expectedExceptions=InternalServerErrorClientException.class) public void testException(){
  this.request("String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions=InternalServerErrorClientException.class) public void testException(){
  this.request("String_Node_Str").jsonGet();
}
Program: 16689
Project: 16689
Buggy source:
@Test(expectedExceptions=NotAcceptableClientException.class) public void testHttpMediaTypeNotAcceptableException(){
  this.request("String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions=NotAcceptableClientException.class) public void testHttpMediaTypeNotAcceptableException(){
  this.request("String_Node_Str").jsonGet();
}
Program: 16690
Project: 16690
Buggy source:
@Test(expectedExceptions=InternalServerErrorClientException.class) public void testRuntimeException(){
  this.request("String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions=InternalServerErrorClientException.class) public void testRuntimeException(){
  this.request("String_Node_Str").jsonGet();
}
Program: 16691
Project: 16691
Buggy source:
@Test(expectedExceptions=InternalServerErrorClientException.class) public void testClientException(){
  this.request("String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions=InternalServerErrorClientException.class) public void testClientException(){
  this.request("String_Node_Str").jsonGet();
}
Program: 16692
Project: 16692
Buggy source:
@Test(expectedExceptions=NotFoundClientException.class) public void testEntityNotFoundException(){
  this.request("String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions=NotFoundClientException.class) public void testEntityNotFoundException(){
  this.request("String_Node_Str").jsonGet();
}
Program: 16693
Project: 16693
Buggy source:
@Test public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getJson();
  List<Sample> samples=response.resource(new TypeReference<List<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.size()).isEqualTo(2);
  Assertions.assertThat(samples.get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").jsonGet();
  List<Sample> samples=response.resource(new TypeReference<List<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.size()).isEqualTo(2);
  Assertions.assertThat(samples.get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16694
Project: 16694
Buggy source:
@Test public void testFindAllResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").getJson();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindAllResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").jsonGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16695
Project: 16695
Buggy source:
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getJson();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").jsonGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16696
Project: 16696
Buggy source:
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").jsonGet();
}
Program: 16697
Project: 16697
Buggy source:
@Test public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getJson();
  List<Sample> samples=response.resource(new TypeReference<List<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.size()).isEqualTo(2);
  Assertions.assertThat(samples.get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").jsonGet();
  List<Sample> samples=response.resource(new TypeReference<List<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.size()).isEqualTo(2);
  Assertions.assertThat(samples.get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16698
Project: 16698
Buggy source:
@Test public void testFindAllResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").getJson();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindAllResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").jsonGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16699
Project: 16699
Buggy source:
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getJson();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").jsonGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16700
Project: 16700
Buggy source:
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getJson();
}

Fixed version (ground truth):
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").jsonGet();
}
Program: 16701
Project: 16701
Buggy source:
@Test(expectedExceptions={NotImplementedClientException.class}) public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response r=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getXml();
  Assertions.assertThat(r).isNotNull();
  Assertions.assertThat(r.getStatus()).isEqualTo(Http.NOT_IMPLEMENTED);
}

Fixed version (ground truth):
@Test(expectedExceptions={NotImplementedClientException.class}) public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response r=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  Assertions.assertThat(r).isNotNull();
  Assertions.assertThat(r.getStatus()).isEqualTo(Http.NOT_IMPLEMENTED);
}
Program: 16702
Project: 16702
Buggy source:
@Test public void testFindAllResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").getXml();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindAllResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").xmlGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16703
Project: 16703
Buggy source:
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getXml();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16704
Project: 16704
Buggy source:
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getXml();
}

Fixed version (ground truth):
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
}
Program: 16705
Project: 16705
Buggy source:
@Test(expectedExceptions={NotImplementedClientException.class}) public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response r=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getXml();
  Assertions.assertThat(r).isNotNull();
  Assertions.assertThat(r.getStatus()).isEqualTo(Http.NOT_IMPLEMENTED);
}

Fixed version (ground truth):
@Test(expectedExceptions={NotImplementedClientException.class}) public void testFindAllResourcesUnpaginated(){
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").jsonPost(new Sample("String_Node_Str"));
  Response r=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  Assertions.assertThat(r).isNotNull();
  Assertions.assertThat(r.getStatus()).isEqualTo(Http.NOT_IMPLEMENTED);
}
Program: 16706
Project: 16706
Buggy source:
@Test public void testFindAllResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").getXml();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindAllResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").xmlGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16707
Project: 16707
Buggy source:
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getXml();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFindPaginatedResources(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  Response response=this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
  Page<Sample> samples=response.resource(new TypeReference<Page<Sample>>(){
  }
);
  Assertions.assertThat(samples).isNotNull();
  Assertions.assertThat(samples.getContent()).isNotNull();
  Assertions.assertThat(samples.getContent().size()).isEqualTo(2);
  Assertions.assertThat(samples.getTotalPages()).isEqualTo(1);
  Assertions.assertThat(samples.getTotalElements()).isEqualTo(2);
  Assertions.assertThat(samples.getContent().get(0).getName()).isIn("String_Node_Str","String_Node_Str");
  Assertions.assertThat(samples.getContent().get(1).getName()).isIn("String_Node_Str","String_Node_Str");
}
Program: 16708
Project: 16708
Buggy source:
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").getXml();
}

Fixed version (ground truth):
@Test(expectedExceptions={BadRequestClientException.class}) public void testFindPaginatedResourcesReturnsBadRequestForAnInvalidPageNumber(){
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").xmlPost(new Sample("String_Node_Str"));
  this.request("String_Node_Str").setQueryParameter("String_Node_Str","String_Node_Str").xmlGet();
}
Program: 16709
Project: 16709
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public T findById(@PathVariable ID id){
  T entity=this.repository.findOne(id);
  if (entity == null) {
    throw new NotFoundException();
  }
  return entity;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T findById(@PathVariable ID id){
  T entity=(T)this.repository.findOne(id);
  if (entity == null) {
    throw new NotFoundException();
  }
  return entity;
}
Program: 16710
Project: 16710
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public T create(@RequestBody T resource){
  return this.repository.save(resource);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T create(@RequestBody T resource){
  return (T)this.repository.save(resource);
}
Program: 16711
Project: 16711
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public T update(@PathVariable ID id,@RequestBody T resource){
  Assert.notNull(id,"String_Node_Str");
  Serializable entityId=this.getIdFromResource(resource);
  if ((entityId == null) || (!id.equals(entityId))) {
    throw new IllegalArgumentException("String_Node_Str" + id + "String_Node_Str");
  }
  T retreivedEntity=this.repository.findOne(id);
  if (retreivedEntity == null) {
    throw new NotFoundException();
  }
  return this.repository.save(resource);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T update(@PathVariable ID id,@RequestBody T resource){
  Assert.notNull(id,"String_Node_Str");
  T retreivedResource=(T)this.findById(id);
  if (retreivedResource == null) {
    throw new NotFoundException();
  }
  return (T)this.repository.save(resource);
}
Program: 16712
Project: 16712
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void delete(@PathVariable ID id){
  this.repository.delete(id);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void delete(@PathVariable ID id){
  T resource=(T)this.findById(id);
  this.repository.delete(resource);
}
Program: 16713
Project: 16713
Buggy source:
/** 
 * {@inheritDoc}
 */
public T findById(@PathVariable ID id){
  T entity=this.service.findById(id);
  if (entity == null) {
    throw new NotFoundException();
  }
  return entity;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T findById(@PathVariable ID id){
  T resource=(T)this.service.findById(id);
  if (resource == null) {
    throw new NotFoundException();
  }
  return resource;
}
Program: 16714
Project: 16714
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public T create(@RequestBody T entity){
  return this.service.create(entity);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T create(@RequestBody T resource){
  return (T)this.service.create(resource);
}
Program: 16715
Project: 16715
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public T update(@PathVariable ID id,@RequestBody T resource){
  Assert.notNull(id,"String_Node_Str");
  Serializable entityId=this.getIdFromResource(resource);
  if ((entityId == null) || (!id.equals(entityId))) {
    throw new IllegalArgumentException();
  }
  T retreivedEntity=this.service.findById(id);
  if (retreivedEntity == null) {
    throw new NotFoundException();
  }
  return this.service.update(resource);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T update(@PathVariable ID id,@RequestBody T resource){
  Assert.notNull(id,"String_Node_Str");
  T retreivedResource=this.findById(id);
  if (retreivedResource == null) {
    throw new NotFoundException();
  }
  return (T)this.service.update(resource);
}
Program: 16716
Project: 16716
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void delete(@PathVariable ID id){
  this.service.delete(id);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void delete(@PathVariable ID id){
  T resource=this.findById(id);
  this.service.delete(resource);
}
Program: 16717
Project: 16717
Buggy source:
@Override @Inject public void setRepository(WebSampleResourceRepository repository){
  this.repository=repository;
}

Fixed version (ground truth):
@Override @Inject public void setRepository(SampleResourceRepository repository){
  this.repository=repository;
}