nus-yam/ex-repair huggingface dataset:
Program: 60544
Project: 60544
Buggy source:
public ConnInstanceTO getConnInstanceTO(final ConnInstance connInstance){
  ConnInstanceTO connInstanceTO=new ConnInstanceTO();
  connInstanceTO.setId(connInstance.getId() == null ? 0L : connInstance.getId().longValue());
  ConfigurationProperties properties=ConnIdBundleManager.getConfigurationProperties(ConnIdBundleManager.getConnectorInfo(connInstance.getLocation(),connInstance.getBundleName(),connInstance.getVersion(),connInstance.getConnectorName()));
  BeanUtils.copyProperties(connInstance,connInstanceTO,IGNORE_PROPERTIES);
  final Map<String,ConnConfProperty> connInstanceToConfMap=connInstanceTO.getConfigurationMap();
  for (  String propName : properties.getPropertyNames()) {
    ConfigurationProperty configurationProperty=properties.getProperty(propName);
    if (connInstanceToConfMap.containsKey(propName)) {
      connInstanceToConfMap.get(propName).getSchema().setDisplayName(configurationProperty.getDisplayName(propName));
    }
 else {
      ConnConfPropSchema connConfPropSchema=new ConnConfPropSchema();
      connConfPropSchema.setName(configurationProperty.getName());
      connConfPropSchema.setDisplayName(configurationProperty.getDisplayName(propName));
      connConfPropSchema.setHelpMessage(configurationProperty.getHelpMessage(propName));
      connConfPropSchema.setRequired(configurationProperty.isRequired());
      connConfPropSchema.setType(configurationProperty.getType().getName());
      connConfPropSchema.setOrder(((ConfigurationPropertyImpl)configurationProperty).getOrder());
      connConfPropSchema.setConfidential(configurationProperty.isConfidential());
      connConfPropSchema.setDefaultValue(configurationProperty.getValue());
      ConnConfProperty property=new ConnConfProperty();
      property.setSchema(connConfPropSchema);
      connInstanceTO.addConfiguration(property);
    }
  }
  return connInstanceTO;
}

Fixed version (ground truth):
public ConnInstanceTO getConnInstanceTO(final ConnInstance connInstance){
  ConnInstanceTO connInstanceTO=new ConnInstanceTO();
  connInstanceTO.setId(connInstance.getId() == null ? 0L : connInstance.getId().longValue());
  ConfigurationProperties properties=ConnIdBundleManager.getConfigurationProperties(ConnIdBundleManager.getConnectorInfo(connInstance.getLocation(),connInstance.getBundleName(),connInstance.getVersion(),connInstance.getConnectorName()));
  BeanUtils.copyProperties(connInstance,connInstanceTO,IGNORE_PROPERTIES);
  final Map<String,ConnConfProperty> connInstanceToConfMap=connInstanceTO.getConfigurationMap();
  for (  String propName : properties.getPropertyNames()) {
    ConnConfPropSchema schema=buildConnConfPropSchema(properties.getProperty(propName));
    ConnConfProperty property;
    if (connInstanceToConfMap.containsKey(propName)) {
      property=connInstanceToConfMap.get(propName);
    }
 else {
      property=new ConnConfProperty();
      connInstanceTO.addConfiguration(property);
    }
    property.setSchema(schema);
  }
  return connInstanceTO;
}
Program: 60545
Project: 60545
Buggy source:
private static <T>T getObjectCXF(final Response response,final Class<T> type,final Object serviceProxy){
  String location=response.getLocation().toString();
  WebClient webClient=WebClient.fromClient(WebClient.client(serviceProxy));
  webClient.to(location,false);
  return webClient.get(type);
}

Fixed version (ground truth):
private static <T>T getObjectCXF(final Response response,final Class<T> type,final Object serviceProxy){
  final String location=response.getLocation().toString();
  final Client client=WebClient.client(serviceProxy);
  final WebClient webClient=WebClient.fromClient(client);
  webClient.accept(client.getHeaders().getFirst("String_Node_Str")).to(location,false);
  webClient.to(location,false);
  return webClient.get(type);
}
Program: 60546
Project: 60546
Buggy source:
/** 
 * Propagation execution failure message setter.
 * @param failureReason
 */
public void setFailureReason(final String failureReason){
  this.failureReason=failureReason;
}

Fixed version (ground truth):
/** 
 * Propagation execution failure message setter.
 * @param failureReason describes why this propagation failed
 */
public void setFailureReason(final String failureReason){
  this.failureReason=failureReason;
}
Program: 60548
Project: 60548
Buggy source:
/** 
 * Convenience method for removing entire attribute instead removing each value in an AttributeMod object.
 * @param attribute (schema) of attribute to be removed.
 * @return true on success.
 */
public boolean addAttributeToBeRemoved(String attribute){
  return attributesToBeRemoved.add(attribute);
}

Fixed version (ground truth):
/** 
 * Convenience method for removing entire attribute instead removing each value in an AttributeMod object
 * @param name (schema) of attribute to be removed.
 * @return true on success.
 */
public boolean addAttributeToBeRemoved(String attribute){
  return attributesToBeRemoved.add(attribute);
}
Program: 60549
Project: 60549
Buggy source:
/** 
 * Convenience method for removing entire attribute instead removing each value in an AttributeMod object.
 * @param attribute (schema) of attribute to be removed.
 * @return true on success.
 */
public boolean removeAttributeToBeRemoved(String attribute){
  return attributesToBeRemoved.remove(attribute);
}

Fixed version (ground truth):
/** 
 * Convenience method for removing entire attribute instead removing each value in an AttributeMod object
 * @param name (schema) of attribute to be removed.
 * @return true on success.
 */
public boolean removeAttributeToBeRemoved(String attribute){
  return attributesToBeRemoved.remove(attribute);
}
Program: 60550
Project: 60550
Buggy source:
public void setVirtualAttributes(final List<AttributeTO> virtualAttributes){
  this.virtualAttributes.clear();
  if (virtualAttributes != null && !virtualAttributes.isEmpty()) {
    this.virtualAttributes.addAll(virtualAttributes);
  }
}

Fixed version (ground truth):
public void setVirtualAttributes(final List<AttributeTO> virtualAttributes){
  this.virtualAttributes=virtualAttributes;
}
Program: 60551
Project: 60551
Buggy source:
public void setDerivedAttributes(final List<AttributeTO> derivedAttributes){
  this.derivedAttributes.clear();
  if (derivedAttributes != null && !derivedAttributes.isEmpty()) {
    this.derivedAttributes.addAll(derivedAttributes);
  }
}

Fixed version (ground truth):
public void setDerivedAttributes(final List<AttributeTO> derivedAttributes){
  this.derivedAttributes=derivedAttributes;
}
Program: 60553
Project: 60553
Buggy source:
@Test public void delete(){
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  assertTrue(selenium.getConfirmation().matches("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void delete(){
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  assertTrue(selenium.getConfirmation().matches("String_Node_Str"));
}
Program: 60554
Project: 60554
Buggy source:
@Test public void clickAround(){
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str" + "String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str" + "String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str" + "String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
}

Fixed version (ground truth):
@Test public void clickAround(){
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForPageToLoad("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str" + "String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str" + "String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.waitForCondition("String_Node_Str" + "String_Node_Str","String_Node_Str");
  selenium.click("String_Node_Str");
  selenium.click("String_Node_Str");
}
Program: 60555
Project: 60555
Buggy source:
@Transactional(readOnly=true) @Override public void load(){
  CurrentLocale.set(Locale.ENGLISH);
  List<ConnectorInfo> connInfos=ConnIdBundleManager.getConnManager().getConnectorInfos();
  if (LOG.isDebugEnabled()) {
    for (    ConnectorInfo connInfo : connInfos) {
      LOG.debug("String_Node_Str",connInfo.getConnectorDisplayName());
    }
  }
  int connectors=0;
  for (  ExternalResource resource : resourceDAO.findAll()) {
    LOG.info("String_Node_Str",resource,resource.getConnector());
    try {
      registerConnector(resource);
      connectors++;
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",resource,resource.getConnector(),e);
    }
  }
  LOG.info("String_Node_Str",connectors);
}

Fixed version (ground truth):
@Transactional(readOnly=true) @Override public void load(){
  CurrentLocale.set(Locale.ENGLISH);
  if (LOG.isDebugEnabled()) {
    List<ConnectorInfo> connInfos=ConnIdBundleManager.getConnManager().getConnectorInfos();
    for (    ConnectorInfo connInfo : connInfos) {
      LOG.debug("String_Node_Str",connInfo.getConnectorDisplayName());
    }
  }
  int connectors=0;
  for (  ExternalResource resource : resourceDAO.findAll()) {
    LOG.info("String_Node_Str",resource,resource.getConnector());
    try {
      registerConnector(resource);
      connectors++;
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",resource,resource.getConnector(),e);
    }
  }
  LOG.info("String_Node_Str",connectors);
}
Program: 60556
Project: 60556
Buggy source:
protected Response handleStream(final String url){
  final AuthScope scope=((PreemptiveAuthHttpRequestFactory)getRestTemplate().getRequestFactory()).getAuthScope();
  final HttpHost targetHost=new HttpHost(scope.getHost(),scope.getPort(),scope.getScheme());
  final BasicHttpContext localcontext=new BasicHttpContext();
  final AuthCache authCache=new BasicAuthCache();
  authCache.put(targetHost,new BasicScheme());
  localcontext.setAttribute(ClientContext.AUTH_CACHE,authCache);
  final HttpGet getMethod=new HttpGet(url);
  try {
    final HttpResponse httpResponse=((PreemptiveAuthHttpRequestFactory)getRestTemplate().getRequestFactory()).getHttpClient().execute(targetHost,getMethod,localcontext);
    Response response;
    if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
      HttpEntity entity=httpResponse.getEntity();
      response=Response.ok(entity.getContent(),entity.getContentType().getValue()).location(getMethod.getURI()).header(SyncopeConstants.CONTENT_DISPOSITION_HEADER,httpResponse.getLastHeader(SyncopeConstants.CONTENT_DISPOSITION_HEADER).getValue()).build();
    }
 else {
      response=Response.noContent().status(httpResponse.getStatusLine().getStatusCode()).location(getMethod.getURI()).build();
    }
    return response;
  }
 catch (  IOException e) {
    throw new InternalServerErrorException(e);
  }
}

Fixed version (ground truth):
protected Response handleStream(final String url){
  final AuthScope scope=((PreemptiveAuthHttpRequestFactory)getRestTemplate().getRequestFactory()).getAuthScope();
  final HttpHost targetHost=new HttpHost(scope.getHost(),scope.getPort(),scope.getScheme());
  final BasicHttpContext localcontext=new BasicHttpContext();
  final AuthCache authCache=new BasicAuthCache();
  authCache.put(targetHost,new BasicScheme());
  localcontext.setAttribute(ClientContext.AUTH_CACHE,authCache);
  final HttpGet getMethod=new HttpGet(url);
  try {
    final HttpResponse httpResponse=((PreemptiveAuthHttpRequestFactory)getRestTemplate().getRequestFactory()).getHttpClient().execute(targetHost,getMethod,localcontext);
    Response response;
    if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
      HttpEntity entity=httpResponse.getEntity();
      response=Response.ok(entity.getContent(),entity.getContentType().getValue()).header(SyncopeConstants.CONTENT_DISPOSITION_HEADER,httpResponse.getLastHeader(SyncopeConstants.CONTENT_DISPOSITION_HEADER).getValue()).build();
    }
 else {
      response=Response.noContent().status(httpResponse.getStatusLine().getStatusCode()).build();
    }
    return response;
  }
 catch (  IOException e) {
    throw new InternalServerErrorException(e);
  }
}
Program: 60557
Project: 60557
Buggy source:
@Override public Response dbExport(){
  return Response.ok(new StreamingOutput(){
    @Override public void write(    final OutputStream os) throws IOException {
      configurationController.dbExportInternal(os);
    }
  }
).build();
}

Fixed version (ground truth):
@Override public Response dbExport(){
  StreamingOutput sout=new StreamingOutput(){
    @Override public void write(    final OutputStream os) throws IOException {
      PrintStream ps=new PrintStream(os);
      ps.println("String_Node_Str");
      configurationController.dbExportInternal(os);
    }
  }
;
  return Response.ok(sout).type(MediaType.TEXT_XML).header(SyncopeConstants.CONTENT_DISPOSITION_HEADER,"String_Node_Str" + ImportExport.CONTENT_FILE).build();
}
Program: 60558
Project: 60558
Buggy source:
@Override public void write(final OutputStream os) throws IOException {
  configurationController.dbExportInternal(os);
}

Fixed version (ground truth):
@Override public void write(final OutputStream os) throws IOException {
  PrintStream ps=new PrintStream(os);
  ps.println("String_Node_Str");
  configurationController.dbExportInternal(os);
}
Program: 60559
Project: 60559
Buggy source:
@Override public Response exportExecutionResult(final Long executionId,final ReportExecExportFormat fmt){
  final ReportExecExportFormat format=(fmt == null) ? ReportExecExportFormat.XML : fmt;
  final ReportExec reportExec=reportController.getAndCheckReportExecInternal(executionId);
  return Response.ok(new StreamingOutput(){
    @Override public void write(    final OutputStream os) throws IOException {
      reportController.exportExecutionResultInternal(os,reportExec,format);
    }
  }
).build();
}

Fixed version (ground truth):
@Override public Response exportExecutionResult(final Long executionId,final ReportExecExportFormat fmt){
  final ReportExecExportFormat format=(fmt == null) ? ReportExecExportFormat.XML : fmt;
  final ReportExec reportExec=reportController.getAndCheckReportExecInternal(executionId);
  StreamingOutput sout=new StreamingOutput(){
    @Override public void write(    final OutputStream os) throws IOException {
      reportController.exportExecutionResultInternal(os,reportExec,format);
    }
  }
;
  String disposition="String_Node_Str" + reportExec.getReport().getName() + "String_Node_Str"+ format.name().toLowerCase();
  return Response.ok(sout).header(SyncopeConstants.CONTENT_DISPOSITION_HEADER,disposition).build();
}
Program: 60560
Project: 60560
Buggy source:
@Test public void checkFailedLogins(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(7L);
  AttributeTO testAttributeTO=new AttributeTO();
  testAttributeTO.setSchema("String_Node_Str");
  testAttributeTO.addValue("String_Node_Str");
  membershipTO.addAttribute(testAttributeTO);
  userTO.addMembership(membershipTO);
  userTO=createUser(userTO);
  assertNotNull(userTO);
  long userId=userTO.getId();
  UserService userService2=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  assertEquals(0,getFailedLogins(userService2,userId));
  UserService userService3=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  assertReadFails(userService3,userId);
  assertReadFails(userService3,userId);
  super.resetRestTemplate();
  assertEquals(2,getFailedLogins(userService,userId));
  UserService userService4=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  assertEquals(0,getFailedLogins(userService4,userId));
}

Fixed version (ground truth):
@Test public void checkFailedLogins(){
  CXFAuthenticator.addAuthenticator();
  Authenticator.setDefault(new CXFPatchedAuthenticator());
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(7L);
  AttributeTO testAttributeTO=new AttributeTO();
  testAttributeTO.setSchema("String_Node_Str");
  testAttributeTO.addValue("String_Node_Str");
  membershipTO.addAttribute(testAttributeTO);
  userTO.addMembership(membershipTO);
  userTO=createUser(userTO);
  assertNotNull(userTO);
  long userId=userTO.getId();
  UserService userService2=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  assertEquals(0,getFailedLogins(userService2,userId));
  UserService userService3=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  assertReadFails(userService3,userId);
  assertReadFails(userService3,userId);
  super.resetRestTemplate();
  assertEquals(2,getFailedLogins(userService,userId));
  UserService userService4=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  assertEquals(0,getFailedLogins(userService4,userId));
}
Program: 60561
Project: 60561
Buggy source:
@Test public void dbExport() throws IOException {
  Response response=configurationService.dbExport();
  assertNotNull(response);
  assertEquals(HttpStatus.OK.value(),response.getStatus());
  assertNotNull(response.getLocation());
  assertTrue(response.getHeaderString(HttpHeaders.CONTENT_TYPE).startsWith(MediaType.TEXT_XML));
  assertNotNull(response.getHeaderString(SyncopeConstants.CONTENT_DISPOSITION_HEADER));
  Object entity=response.getEntity();
  assertTrue(entity instanceof InputStream);
  assertFalse(IOUtils.toString((InputStream)entity,"String_Node_Str").isEmpty());
}

Fixed version (ground truth):
@Test public void dbExport() throws IOException {
  Response response=configurationService.dbExport();
  assertNotNull(response);
  assertEquals(HttpStatus.OK.value(),response.getStatus());
  String contentType=response.getHeaderString(HttpHeaders.CONTENT_TYPE);
  assertTrue(contentType.contains("String_Node_Str"));
  String contentDisposition=response.getHeaderString(SyncopeConstants.CONTENT_DISPOSITION_HEADER);
  assertNotNull(contentDisposition);
  Object entity=response.getEntity();
  assertTrue(entity instanceof InputStream);
  String configExport=IOUtils.toString((InputStream)entity,"String_Node_Str");
  assertFalse(configExport.isEmpty());
  assertTrue(configExport.length() > 1000);
}
Program: 60562
Project: 60562
Buggy source:
private void checkExport(final Long execId,final ReportExecExportFormat fmt) throws IOException {
  final Response response=reportService.exportExecutionResult(execId,fmt);
  assertNotNull(response);
  assertEquals(HttpStatus.OK.value(),response.getStatus());
  assertNotNull(response.getLocation());
  assertNotNull(response.getHeaderString(SyncopeConstants.CONTENT_DISPOSITION_HEADER));
  assertTrue(response.getHeaderString(SyncopeConstants.CONTENT_DISPOSITION_HEADER).endsWith("String_Node_Str" + fmt.name().toLowerCase()));
  Object entity=response.getEntity();
  assertTrue(entity instanceof InputStream);
  assertFalse(IOUtils.toString((InputStream)entity,"String_Node_Str").isEmpty());
}

Fixed version (ground truth):
private void checkExport(final Long execId,final ReportExecExportFormat fmt) throws IOException {
  final Response response=reportService.exportExecutionResult(execId,fmt);
  assertNotNull(response);
  assertEquals(HttpStatus.OK.value(),response.getStatus());
  assertNotNull(response.getHeaderString(SyncopeConstants.CONTENT_DISPOSITION_HEADER));
  assertTrue(response.getHeaderString(SyncopeConstants.CONTENT_DISPOSITION_HEADER).endsWith("String_Node_Str" + fmt.name().toLowerCase()));
  Object entity=response.getEntity();
  assertTrue(entity instanceof InputStream);
  assertFalse(IOUtils.toString((InputStream)entity,"String_Node_Str").isEmpty());
}
Program: 60563
Project: 60563
Buggy source:
public ConfigurationTestITCaseJAXRS(){
  super();
  setEnabledCXF(true);
}

Fixed version (ground truth):
public ConfigurationTestITCaseJAXRS(){
  super();
  setContentType(CONTENT_TYPE_XML);
  setEnabledCXF(true);
}
Program: 60564
Project: 60564
Buggy source:
@Override public Response create(final TaskTO taskTO){
  TaskTO createdTask;
  if (taskTO instanceof SyncTaskTO || taskTO instanceof SchedTaskTO) {
    createdTask=taskController.createSchedTaskInternal((SchedTaskTO)taskTO);
  }
 else {
    throw new BadRequestException();
  }
  URI location=uriInfo.getAbsolutePathBuilder().path(createdTask.getId() + "String_Node_Str").build();
  return Response.created(location).header(SyncopeConstants.REST_HEADER_ID,createdTask.getId()).build();
}

Fixed version (ground truth):
@Override public Response create(final TaskTO taskTO){
  TaskTO createdTask;
  if (taskTO instanceof SyncTaskTO || taskTO instanceof SchedTaskTO) {
    createdTask=taskController.createSchedTaskInternal((SchedTaskTO)taskTO);
  }
 else {
    throw new BadRequestException();
  }
  TaskType taskType=getTaskType(taskTO.getClass());
  URI location=uriInfo.getAbsolutePathBuilder().path(taskType.toString() + "String_Node_Str" + createdTask.getId()).build();
  return Response.created(location).header(SyncopeConstants.REST_HEADER_ID,createdTask.getId()).build();
}
Program: 60565
Project: 60565
Buggy source:
public UserTestITCaseJAXRS(){
  super();
  setEnabledCXF(true);
}

Fixed version (ground truth):
public UserTestITCaseJAXRS(){
  super();
  setEnabledCXF(true);
  setContentType(CONTENT_TYPE_XML);
}
Program: 60566
Project: 60566
Buggy source:
@Override public Set<String> getReportletConfClasses(){
  List<String> confClasses=Arrays.asList(getRestTemplate().getForObject(baseUrl + "String_Node_Str",String[].class));
  return new HashSet<String>(confClasses);
}

Fixed version (ground truth):
@Override public ReportletConfClasses getReportletConfClasses(){
  List<String> confClasses=Arrays.asList(getRestTemplate().getForObject(baseUrl + "String_Node_Str",String[].class));
  return new ReportletConfClasses(confClasses);
}
Program: 60567
Project: 60567
Buggy source:
/** 
 * @return Returns a list of all reportletConfClasses
 */
@GET @Path("String_Node_Str") Set<String> getReportletConfClasses();

Fixed version (ground truth):
/** 
 * @return Returns a list of all reportletConfClasses
 */
@GET @Path("String_Node_Str") ReportletConfClasses getReportletConfClasses();
Program: 60568
Project: 60568
Buggy source:
public List<String> getReportletConfClasses(){
  List<String> reportletClasses=null;
  try {
    Set<String> reportletClassesSet=getService(ReportService.class).getReportletConfClasses();
    reportletClasses=new LinkedList<String>(reportletClassesSet);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    LOG.error("String_Node_Str",e);
  }
  return reportletClasses;
}

Fixed version (ground truth):
public List<String> getReportletConfClasses(){
  try {
    ReportletConfClasses reportletConfClasses=getService(ReportService.class).getReportletConfClasses();
    return reportletConfClasses.getConfClasses();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    LOG.error("String_Node_Str",e);
    return new ArrayList<String>();
  }
}
Program: 60569
Project: 60569
Buggy source:
@Override public Set<String> getReportletConfClasses(){
  return reportController.getReportletConfClassesInternal();
}

Fixed version (ground truth):
@Override public ReportletConfClasses getReportletConfClasses(){
  return new ReportletConfClasses(reportController.getReportletConfClassesInternal());
}
Program: 60570
Project: 60570
Buggy source:
@Test public void getReportletClasses(){
  Set<String> reportletClasses=reportService.getReportletConfClasses();
  assertNotNull(reportletClasses);
  assertFalse(reportletClasses.isEmpty());
}

Fixed version (ground truth):
@Test public void getReportletClasses(){
  ReportletConfClasses reportletClasses=reportService.getReportletConfClasses();
  assertNotNull(reportletClasses);
  assertFalse(reportletClasses.getConfClasses().isEmpty());
}
Program: 60571
Project: 60571
Buggy source:
@GET @Path("String_Node_Str") UserTO read(@MatrixParam("String_Node_Str") String username);

Fixed version (ground truth):
@GET @Path("String_Node_Str") UserTO read(@PathParam("String_Node_Str") String username);
Program: 60572
Project: 60572
Buggy source:
@Test(expected=SyncopeClientCompositeErrorException.class) public void createWithoutExtAttr(){
  String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(102L);
  MappingTO mapping=new MappingTO();
  MappingItemTO item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserId);
  item.setAccountid(true);
  mapping.setAccountIdItem(item);
  item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserSchema);
  item.setIntAttrName("String_Node_Str");
  mapping.addItem(item);
  resourceTO.setUmapping(mapping);
  resourceService.create(resourceTO);
}

Fixed version (ground truth):
@Test(expected=SyncopeClientCompositeErrorException.class) public void createWithoutExtAttr(){
  String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(102L);
  MappingTO mapping=new MappingTO();
  MappingItemTO item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserId);
  item.setAccountid(true);
  mapping.setAccountIdItem(item);
  item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserSchema);
  item.setIntAttrName("String_Node_Str");
  mapping.addItem(item);
  resourceTO.setUmapping(mapping);
  createResource(resourceService,resourceTO);
}
Program: 60573
Project: 60573
Buggy source:
@Test public void createWithInvalidMapping(){
  String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(102L);
  MappingTO mapping=new MappingTO();
  MappingItemTO item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserId);
  item.setAccountid(true);
  mapping.setAccountIdItem(item);
  item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserSchema);
  item.setExtAttrName("String_Node_Str");
  mapping.addItem(item);
  resourceTO.setUmapping(mapping);
  Throwable t=null;
  try {
    resourceService.create(resourceTO);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    t=e;
    SyncopeClientException requiredValueMissing=e.getException(SyncopeClientExceptionType.RequiredValuesMissing);
    assertNotNull(requiredValueMissing);
    assertNotNull(requiredValueMissing.getElements());
    assertEquals(1,requiredValueMissing.getElements().size());
    assertEquals("String_Node_Str",requiredValueMissing.getElements().iterator().next());
  }
  assertNotNull(t);
}

Fixed version (ground truth):
@Test public void createWithInvalidMapping(){
  String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(102L);
  MappingTO mapping=new MappingTO();
  MappingItemTO item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserId);
  item.setAccountid(true);
  mapping.setAccountIdItem(item);
  item=new MappingItemTO();
  item.setIntMappingType(IntMappingType.UserSchema);
  item.setExtAttrName("String_Node_Str");
  mapping.addItem(item);
  resourceTO.setUmapping(mapping);
  try {
    createResource(resourceService,resourceTO);
    fail("String_Node_Str");
  }
 catch (  SyncopeClientCompositeErrorException e) {
    SyncopeClientException requiredValueMissing=e.getException(SyncopeClientExceptionType.RequiredValuesMissing);
    assertNotNull(requiredValueMissing);
    assertNotNull(requiredValueMissing.getElements());
    assertEquals(1,requiredValueMissing.getElements().size());
    assertEquals("String_Node_Str",requiredValueMissing.getElements().iterator().next());
  }
}
Program: 60574
Project: 60574
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>T setupCredentials(final T proxy,final String username,final String password){
  if (proxy instanceof SpringServiceProxy) {
    SpringServiceProxy service=(SpringServiceProxy)proxy;
    if (username == null && password == null) {
      service.setRestTemplate(getAnonymousRestTemplate());
    }
 else {
      setupRestTemplate(username,password);
    }
    return proxy;
  }
 else {
    restClientFactory.setUsername(username);
    restClientFactory.setPassword(password);
    restClientFactory.setServiceClass(proxy.getClass());
    T serviceProxy=(T)restClientFactory.create(proxy.getClass());
    setupContentType(WebClient.client(serviceProxy));
    return serviceProxy;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>T setupCredentials(final T proxy,final Class<?> serviceInterface,final String username,final String password){
  if (proxy instanceof SpringServiceProxy) {
    SpringServiceProxy service=(SpringServiceProxy)proxy;
    if (username == null && password == null) {
      service.setRestTemplate(getAnonymousRestTemplate());
    }
 else {
      setupRestTemplate(username,password);
    }
    return proxy;
  }
 else {
    restClientFactory.setUsername(username);
    restClientFactory.setPassword(password);
    restClientFactory.setServiceClass(serviceInterface);
    T serviceProxy=(T)restClientFactory.create(serviceInterface);
    setupContentType(WebClient.client(serviceProxy));
    return serviceProxy;
  }
}
Program: 60576
Project: 60576
Buggy source:
@Test public void testUserRead(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(7L);
  AttributeTO testAttributeTO=new AttributeTO();
  testAttributeTO.setSchema("String_Node_Str");
  testAttributeTO.addValue("String_Node_Str");
  membershipTO.addAttribute(testAttributeTO);
  userTO.addMembership(membershipTO);
  userTO=createUser(userTO);
  assertNotNull(userTO);
  UserService userService2=setupCredentials(userService,userTO.getUsername(),"String_Node_Str");
  UserTO readUserTO=userService2.read(1L);
  assertNotNull(readUserTO);
  UserService userService3=setupCredentials(userService,"String_Node_Str",ADMIN_PWD);
  SyncopeClientException exception=null;
  try {
    userService3.read(1L);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    exception=e.getException(SyncopeClientExceptionType.UnauthorizedRole);
  }
  assertNotNull(exception);
  super.resetRestTemplate();
}

Fixed version (ground truth):
@Test public void testUserRead(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(7L);
  AttributeTO testAttributeTO=new AttributeTO();
  testAttributeTO.setSchema("String_Node_Str");
  testAttributeTO.addValue("String_Node_Str");
  membershipTO.addAttribute(testAttributeTO);
  userTO.addMembership(membershipTO);
  userTO=createUser(userTO);
  assertNotNull(userTO);
  UserService userService2=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  UserTO readUserTO=userService2.read(1L);
  assertNotNull(readUserTO);
  UserService userService3=setupCredentials(userService,UserService.class,"String_Node_Str",ADMIN_PWD);
  SyncopeClientException exception=null;
  try {
    userService3.read(1L);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    exception=e.getException(SyncopeClientExceptionType.UnauthorizedRole);
  }
  assertNotNull(exception);
  super.resetRestTemplate();
}
Program: 60577
Project: 60577
Buggy source:
@Test public void issueSYNCOPE48(){
  RoleTO parentRole=new RoleTO();
  parentRole.setName("String_Node_Str" + getUUIDString());
  parentRole.addEntitlement("String_Node_Str");
  parentRole.addEntitlement("String_Node_Str");
  parentRole.setParent(1L);
  Response response=roleService.create(parentRole);
  parentRole=getObject(response,RoleTO.class,roleService);
  assertNotNull(parentRole);
  RoleTO childRole=new RoleTO();
  childRole.setName("String_Node_Str");
  childRole.setParent(parentRole.getId());
  response=roleService.create(childRole);
  childRole=getObject(response,RoleTO.class,roleService);
  assertNotNull(childRole);
  UserTO role1Admin=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  role1Admin.setPassword("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(childRole.getId());
  role1Admin.addMembership(membershipTO);
  role1Admin=createUser(role1Admin);
  assertNotNull(role1Admin);
  UserService userService2=setupCredentials(userService,role1Admin.getUsername(),"String_Node_Str");
  UserTO role1User=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  membershipTO=new MembershipTO();
  membershipTO.setRoleId(1L);
  role1User.addMembership(membershipTO);
  response=userService2.create(role1User);
  assertNotNull(response);
  role1User=response.readEntity(UserTO.class);
  assertNotNull(role1User);
}

Fixed version (ground truth):
@Test public void issueSYNCOPE48(){
  RoleTO parentRole=new RoleTO();
  parentRole.setName("String_Node_Str" + getUUIDString());
  parentRole.addEntitlement("String_Node_Str");
  parentRole.addEntitlement("String_Node_Str");
  parentRole.setParent(1L);
  Response response=roleService.create(parentRole);
  parentRole=getObject(response,RoleTO.class,roleService);
  assertNotNull(parentRole);
  RoleTO childRole=new RoleTO();
  childRole.setName("String_Node_Str");
  childRole.setParent(parentRole.getId());
  response=roleService.create(childRole);
  childRole=getObject(response,RoleTO.class,roleService);
  assertNotNull(childRole);
  UserTO role1Admin=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  role1Admin.setPassword("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(childRole.getId());
  role1Admin.addMembership(membershipTO);
  role1Admin=createUser(role1Admin);
  assertNotNull(role1Admin);
  UserService userService2=setupCredentials(userService,UserService.class,role1Admin.getUsername(),"String_Node_Str");
  UserTO role1User=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  membershipTO=new MembershipTO();
  membershipTO.setRoleId(1L);
  role1User.addMembership(membershipTO);
  response=userService2.create(role1User);
  assertNotNull(response);
  role1User=response.readEntity(UserTO.class);
  assertNotNull(role1User);
}
Program: 60579
Project: 60579
Buggy source:
@Test public void testUserSearch(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(7L);
  AttributeTO testAttributeTO=new AttributeTO();
  testAttributeTO.setSchema("String_Node_Str");
  testAttributeTO.addValue("String_Node_Str");
  membershipTO.addAttribute(testAttributeTO);
  userTO.addMembership(membershipTO);
  userTO=createUser(userTO);
  assertNotNull(userTO);
  UserService userService2=setupCredentials(userService,userTO.getUsername(),"String_Node_Str");
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNOTNULL);
  isNullCond.setSchema("String_Node_Str");
  NodeCond searchCondition=NodeCond.getLeafCond(isNullCond);
  List<UserTO> matchedUsers=userService2.search(searchCondition);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  Set<Long> userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertTrue(userIds.contains(1L));
  UserService userService3=setupCredentials(userService,"String_Node_Str","String_Node_Str");
  matchedUsers=userService3.search(searchCondition);
  assertNotNull(matchedUsers);
  userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertFalse(userIds.contains(1L));
  super.resetRestTemplate();
}

Fixed version (ground truth):
@Test public void testUserSearch() throws InvalidSearchConditionException {
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(7L);
  AttributeTO testAttributeTO=new AttributeTO();
  testAttributeTO.setSchema("String_Node_Str");
  testAttributeTO.addValue("String_Node_Str");
  membershipTO.addAttribute(testAttributeTO);
  userTO.addMembership(membershipTO);
  userTO=createUser(userTO);
  assertNotNull(userTO);
  UserService userService2=setupCredentials(userService,UserService.class,userTO.getUsername(),"String_Node_Str");
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNOTNULL);
  isNullCond.setSchema("String_Node_Str");
  NodeCond searchCondition=NodeCond.getLeafCond(isNullCond);
  List<UserTO> matchedUsers=userService2.search(searchCondition);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  Set<Long> userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertTrue(userIds.contains(1L));
  UserService userService3=setupCredentials(userService,UserService.class,"String_Node_Str","String_Node_Str");
  matchedUsers=userService3.search(searchCondition);
  assertNotNull(matchedUsers);
  userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertFalse(userIds.contains(1L));
  super.resetRestTemplate();
}
Program: 60581
Project: 60581
Buggy source:
@Test public void selfRead(){
  UserTO userTO=userService.read(1L);
  assertNotNull(userTO);
  assertTrue(userTO.getMembershipMap().containsKey(1L));
  assertFalse(userTO.getMembershipMap().containsKey(3L));
  RoleService roleService2=setupCredentials(roleService,"String_Node_Str",ADMIN_PWD);
  SyncopeClientException exception=null;
  try {
    roleService2.selfRead(3L);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    exception=e.getException(SyncopeClientExceptionType.UnauthorizedRole);
  }
  assertNotNull(exception);
  RoleTO roleTO=roleService2.selfRead(1L);
  assertNotNull(roleTO);
  assertNotNull(roleTO.getAttributes());
  assertFalse(roleTO.getAttributes().isEmpty());
}

Fixed version (ground truth):
@Test public void selfRead(){
  UserTO userTO=userService.read(1L);
  assertNotNull(userTO);
  assertTrue(userTO.getMembershipMap().containsKey(1L));
  assertFalse(userTO.getMembershipMap().containsKey(3L));
  RoleService roleService2=setupCredentials(roleService,RoleService.class,"String_Node_Str",ADMIN_PWD);
  SyncopeClientException exception=null;
  try {
    roleService2.selfRead(3L);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    exception=e.getException(SyncopeClientExceptionType.UnauthorizedRole);
  }
  assertNotNull(exception);
  RoleTO roleTO=roleService2.selfRead(1L);
  assertNotNull(roleTO);
  assertNotNull(roleTO.getAttributes());
  assertFalse(roleTO.getAttributes().isEmpty());
}
Program: 60582
Project: 60582
Buggy source:
@Test public void updateAsRoleOwner(){
  RoleTO roleTO=roleService.read(7L);
  RoleMod roleMod=new RoleMod();
  roleMod.setId(roleTO.getId());
  roleMod.setName("String_Node_Str");
  RoleService roleService2=setupCredentials(roleService,"String_Node_Str",ADMIN_PWD);
  try {
    roleService2.update(roleMod.getId(),roleMod);
    fail();
  }
 catch (  HttpStatusCodeException e) {
    assertEquals(HttpStatus.FORBIDDEN,e.getStatusCode());
  }
  RoleService roleService3=setupCredentials(roleService,"String_Node_Str",ADMIN_PWD);
  roleTO=roleService3.update(roleMod.getId(),roleMod);
  assertEquals("String_Node_Str",roleTO.getName());
}

Fixed version (ground truth):
@Test public void updateAsRoleOwner(){
  RoleTO roleTO=roleService.read(7L);
  RoleMod roleMod=new RoleMod();
  roleMod.setId(roleTO.getId());
  roleMod.setName("String_Node_Str");
  RoleService roleService2=setupCredentials(roleService,RoleService.class,"String_Node_Str",ADMIN_PWD);
  try {
    roleService2.update(roleMod.getId(),roleMod);
    fail();
  }
 catch (  HttpStatusCodeException e) {
    assertEquals(HttpStatus.FORBIDDEN,e.getStatusCode());
  }
  RoleService roleService3=setupCredentials(roleService,RoleService.class,"String_Node_Str",ADMIN_PWD);
  roleTO=roleService3.update(roleMod.getId(),roleMod);
  assertEquals("String_Node_Str",roleTO.getName());
}
Program: 60583
Project: 60583
Buggy source:
@Test public void searchByUsernameAndId(){
  final AttributableCond usernameLeafCond=new AttributableCond(AttributableCond.Type.EQ);
  usernameLeafCond.setSchema("String_Node_Str");
  usernameLeafCond.setExpression("String_Node_Str");
  final AttributableCond idRightCond=new AttributableCond(AttributableCond.Type.LT);
  idRightCond.setSchema("String_Node_Str");
  idRightCond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(usernameLeafCond),NodeCond.getLeafCond(idRightCond));
  assertTrue(searchCondition.isValid());
  final List<UserTO> matchingUsers=userService.search(searchCondition);
  assertNotNull(matchingUsers);
  assertEquals(1,matchingUsers.size());
  assertEquals("String_Node_Str",matchingUsers.iterator().next().getUsername());
  assertEquals(1L,matchingUsers.iterator().next().getId());
}

Fixed version (ground truth):
@Test public void searchByUsernameAndId() throws InvalidSearchConditionException {
  final AttributableCond usernameLeafCond=new AttributableCond(AttributableCond.Type.EQ);
  usernameLeafCond.setSchema("String_Node_Str");
  usernameLeafCond.setExpression("String_Node_Str");
  final AttributableCond idRightCond=new AttributableCond(AttributableCond.Type.LT);
  idRightCond.setSchema("String_Node_Str");
  idRightCond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(usernameLeafCond),NodeCond.getLeafCond(idRightCond));
  assertTrue(searchCondition.isValid());
  final List<UserTO> matchingUsers=userService.search(searchCondition);
  assertNotNull(matchingUsers);
  assertEquals(1,matchingUsers.size());
  assertEquals("String_Node_Str",matchingUsers.iterator().next().getUsername());
  assertEquals(1L,matchingUsers.iterator().next().getId());
}
Program: 60584
Project: 60584
Buggy source:
@Test public void searchByRolenameAndId(){
  final AttributableCond rolenameLeafCond=new AttributableCond(AttributableCond.Type.EQ);
  rolenameLeafCond.setSchema("String_Node_Str");
  rolenameLeafCond.setExpression("String_Node_Str");
  final AttributableCond idRightCond=new AttributableCond(AttributableCond.Type.LT);
  idRightCond.setSchema("String_Node_Str");
  idRightCond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(rolenameLeafCond),NodeCond.getLeafCond(idRightCond));
  assertTrue(searchCondition.isValid());
  final List<RoleTO> matchingRoles=roleService.search(searchCondition);
  assertNotNull(matchingRoles);
  assertEquals(1,matchingRoles.size());
  assertEquals("String_Node_Str",matchingRoles.iterator().next().getName());
  assertEquals(1L,matchingRoles.iterator().next().getId());
}

Fixed version (ground truth):
@Test public void searchByRolenameAndId() throws InvalidSearchConditionException {
  final AttributableCond rolenameLeafCond=new AttributableCond(AttributableCond.Type.EQ);
  rolenameLeafCond.setSchema("String_Node_Str");
  rolenameLeafCond.setExpression("String_Node_Str");
  final AttributableCond idRightCond=new AttributableCond(AttributableCond.Type.LT);
  idRightCond.setSchema("String_Node_Str");
  idRightCond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(rolenameLeafCond),NodeCond.getLeafCond(idRightCond));
  assertTrue(searchCondition.isValid());
  final List<RoleTO> matchingRoles=roleService.search(searchCondition);
  assertNotNull(matchingRoles);
  assertEquals(1,matchingRoles.size());
  assertEquals("String_Node_Str",matchingRoles.iterator().next().getName());
  assertEquals(1L,matchingRoles.iterator().next().getId());
}
Program: 60585
Project: 60585
Buggy source:
@Test public void searchByEntitlement(){
  final EntitlementCond userListCond=new EntitlementCond();
  userListCond.setExpression("String_Node_Str");
  final EntitlementCond userReadcond=new EntitlementCond();
  userReadcond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(userListCond),NodeCond.getLeafCond(userReadcond));
  assertTrue(searchCondition.isValid());
  final List<RoleTO> matchingRoles=roleService.search(searchCondition);
  assertNotNull(matchingRoles);
  assertFalse(matchingRoles.isEmpty());
}

Fixed version (ground truth):
@Test public void searchByEntitlement() throws InvalidSearchConditionException {
  final EntitlementCond userListCond=new EntitlementCond();
  userListCond.setExpression("String_Node_Str");
  final EntitlementCond userReadcond=new EntitlementCond();
  userReadcond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(userListCond),NodeCond.getLeafCond(userReadcond));
  assertTrue(searchCondition.isValid());
  final List<RoleTO> matchingRoles=roleService.search(searchCondition);
  assertNotNull(matchingRoles);
  assertFalse(matchingRoles.isEmpty());
}