nus-yam/ex-repair huggingface dataset:
Program: 60586
Project: 60586
Buggy source:
@Test public void searchByRelationshipAttributableCond(){
  final AttributableCond userOwnerCond=new AttributableCond(AttributableCond.Type.EQ);
  userOwnerCond.setSchema("String_Node_Str");
  userOwnerCond.setExpression("String_Node_Str");
  final AttributableCond ppolicyCond=new AttributableCond(AttributableCond.Type.ISNOTNULL);
  ppolicyCond.setSchema("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(userOwnerCond),NodeCond.getLeafCond(ppolicyCond));
  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(6L,matchingRoles.iterator().next().getId());
}

Fixed version (ground truth):
@Test public void searchByRelationshipAttributableCond() throws InvalidSearchConditionException {
  final AttributableCond userOwnerCond=new AttributableCond(AttributableCond.Type.EQ);
  userOwnerCond.setSchema("String_Node_Str");
  userOwnerCond.setExpression("String_Node_Str");
  final AttributableCond ppolicyCond=new AttributableCond(AttributableCond.Type.ISNOTNULL);
  ppolicyCond.setSchema("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(userOwnerCond),NodeCond.getLeafCond(ppolicyCond));
  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(6L,matchingRoles.iterator().next().getId());
}
Program: 60587
Project: 60587
Buggy source:
@Test public void searchUser(){
  AttributeCond fullnameLeafCond1=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond1.setSchema("String_Node_Str");
  fullnameLeafCond1.setExpression("String_Node_Str");
  AttributeCond fullnameLeafCond2=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond2.setSchema("String_Node_Str");
  fullnameLeafCond2.setExpression("String_Node_Str");
  NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1),NodeCond.getLeafCond(fullnameLeafCond2));
  assertTrue(searchCondition.isValid());
  List<UserTO> matchedUsers=userService.search(searchCondition);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  for (  UserTO user : matchedUsers) {
    assertNotNull(user);
  }
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNULL);
  isNullCond.setSchema("String_Node_Str");
  searchCondition=NodeCond.getLeafCond(isNullCond);
  matchedUsers=userService.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(2L));
  assertTrue(userIds.contains(3L));
}

Fixed version (ground truth):
@Test public void searchUser() throws InvalidSearchConditionException {
  AttributeCond fullnameLeafCond1=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond1.setSchema("String_Node_Str");
  fullnameLeafCond1.setExpression("String_Node_Str");
  AttributeCond fullnameLeafCond2=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond2.setSchema("String_Node_Str");
  fullnameLeafCond2.setExpression("String_Node_Str");
  NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1),NodeCond.getLeafCond(fullnameLeafCond2));
  assertTrue(searchCondition.isValid());
  List<UserTO> matchedUsers=userService.search(searchCondition);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  for (  UserTO user : matchedUsers) {
    assertNotNull(user);
  }
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNULL);
  isNullCond.setSchema("String_Node_Str");
  searchCondition=NodeCond.getLeafCond(isNullCond);
  matchedUsers=userService.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(2L));
  assertTrue(userIds.contains(3L));
}
Program: 60588
Project: 60588
Buggy source:
@Test public void searchUserByResourceName(){
  ResourceCond ws2=new ResourceCond();
  ws2.setResourceName("String_Node_Str");
  ResourceCond ws1=new ResourceCond();
  ws1.setResourceName("String_Node_Str");
  NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getNotLeafCond(ws2),NodeCond.getLeafCond(ws1));
  assertTrue(searchCondition.isValid());
  List<UserTO> matchedUsers=userService.search(searchCondition);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  Set<Long> userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertEquals(1,userIds.size());
  assertTrue(userIds.contains(2L));
}

Fixed version (ground truth):
@Test public void searchUserByResourceName() throws InvalidSearchConditionException {
  ResourceCond ws2=new ResourceCond();
  ws2.setResourceName("String_Node_Str");
  ResourceCond ws1=new ResourceCond();
  ws1.setResourceName("String_Node_Str");
  NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getNotLeafCond(ws2),NodeCond.getLeafCond(ws1));
  assertTrue(searchCondition.isValid());
  List<UserTO> matchedUsers=userService.search(searchCondition);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  Set<Long> userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertEquals(1,userIds.size());
  assertTrue(userIds.contains(2L));
}
Program: 60589
Project: 60589
Buggy source:
@Test public void searchCount(){
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNULL);
  isNullCond.setSchema("String_Node_Str");
  NodeCond searchCond=NodeCond.getLeafCond(isNullCond);
  Integer count=userService.searchCount(searchCond);
  assertNotNull(count);
  assertTrue(count > 0);
}

Fixed version (ground truth):
@Test public void searchCount() throws InvalidSearchConditionException {
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNULL);
  isNullCond.setSchema("String_Node_Str");
  NodeCond searchCond=NodeCond.getLeafCond(isNullCond);
  Integer count=userService.searchCount(searchCond);
  assertNotNull(count);
  assertTrue(count > 0);
}
Program: 60590
Project: 60590
Buggy source:
@Test public void paginatedSearch(){
  AttributeCond fullnameLeafCond1=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond1.setSchema("String_Node_Str");
  fullnameLeafCond1.setExpression("String_Node_Str");
  AttributeCond fullnameLeafCond2=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond2.setSchema("String_Node_Str");
  fullnameLeafCond2.setExpression("String_Node_Str");
  NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1),NodeCond.getLeafCond(fullnameLeafCond2));
  assertTrue(searchCondition.isValid());
  List<UserTO> matchedUsers=userService.search(searchCondition,1,2);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  for (  UserTO user : matchedUsers) {
    assertNotNull(user);
  }
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNULL);
  isNullCond.setSchema("String_Node_Str");
  searchCondition=NodeCond.getLeafCond(isNullCond);
  matchedUsers=userService.search(searchCondition,1,2);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  Set<Long> userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertEquals(2,userIds.size());
}

Fixed version (ground truth):
@Test public void paginatedSearch() throws InvalidSearchConditionException {
  AttributeCond fullnameLeafCond1=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond1.setSchema("String_Node_Str");
  fullnameLeafCond1.setExpression("String_Node_Str");
  AttributeCond fullnameLeafCond2=new AttributeCond(AttributeCond.Type.LIKE);
  fullnameLeafCond2.setSchema("String_Node_Str");
  fullnameLeafCond2.setExpression("String_Node_Str");
  NodeCond searchCondition=NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1),NodeCond.getLeafCond(fullnameLeafCond2));
  assertTrue(searchCondition.isValid());
  List<UserTO> matchedUsers=userService.search(searchCondition,1,2);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  for (  UserTO user : matchedUsers) {
    assertNotNull(user);
  }
  AttributeCond isNullCond=new AttributeCond(AttributeCond.Type.ISNULL);
  isNullCond.setSchema("String_Node_Str");
  searchCondition=NodeCond.getLeafCond(isNullCond);
  matchedUsers=userService.search(searchCondition,1,2);
  assertNotNull(matchedUsers);
  assertFalse(matchedUsers.isEmpty());
  Set<Long> userIds=new HashSet<Long>(matchedUsers.size());
  for (  UserTO user : matchedUsers) {
    userIds.add(user.getId());
  }
  assertEquals(2,userIds.size());
}
Program: 60591
Project: 60591
Buggy source:
@Test public void searchByBooleanAttributableCond(){
  final AttributableCond cond=new AttributableCond(AttributableCond.Type.EQ);
  cond.setSchema("String_Node_Str");
  cond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getLeafCond(cond);
  final List<RoleTO> matchingRoles=roleService.search(searchCondition);
  assertNotNull(matchingRoles);
  assertFalse(matchingRoles.isEmpty());
}

Fixed version (ground truth):
@Test public void searchByBooleanAttributableCond() throws InvalidSearchConditionException {
  final AttributableCond cond=new AttributableCond(AttributableCond.Type.EQ);
  cond.setSchema("String_Node_Str");
  cond.setExpression("String_Node_Str");
  final NodeCond searchCondition=NodeCond.getLeafCond(cond);
  final List<RoleTO> matchingRoles=roleService.search(searchCondition);
  assertNotNull(matchingRoles);
  assertFalse(matchingRoles.isEmpty());
}
Program: 60595
Project: 60595
Buggy source:
@Test public void delete(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  String initialPassword=userTO.getPassword();
  userTO=createUser(userTO);
  assertNotNull(userTO);
  try {
    createUserRequest(new UserRequestTO(userTO.getId()));
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    assertNotNull(e.getException(SyncopeClientExceptionType.UnauthorizedRole));
  }
  UserRequestService userRequestService2=setupCredentials(userRequestService,userTO.getUsername(),initialPassword);
  Response response=userRequestService2.create(new UserRequestTO(userTO.getId()));
  assertNotNull(response);
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  super.resetRestTemplate();
  UserTO actual=userService.read(userTO.getId());
  assertNotNull(actual);
  userService.delete(userTO.getId());
  try {
    userService.read(userTO.getId());
    fail();
  }
 catch (  HttpStatusCodeException e) {
    assertEquals(HttpStatus.NOT_FOUND,e.getStatusCode());
  }
}

Fixed version (ground truth):
@Test public void delete(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  String initialPassword=userTO.getPassword();
  userTO=createUser(userTO);
  assertNotNull(userTO);
  try {
    createUserRequest(new UserRequestTO(userTO.getId()));
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    assertNotNull(e.getException(SyncopeClientExceptionType.UnauthorizedRole));
  }
  UserRequestService userRequestService2=setupCredentials(userRequestService,UserRequestService.class,userTO.getUsername(),initialPassword);
  Response response=userRequestService2.create(new UserRequestTO(userTO.getId()));
  assertNotNull(response);
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  super.resetRestTemplate();
  UserTO actual=userService.read(userTO.getId());
  assertNotNull(actual);
  userService.delete(userTO.getId());
  try {
    userService.read(userTO.getId());
    fail();
  }
 catch (  HttpStatusCodeException e) {
    assertEquals(HttpStatus.NOT_FOUND,e.getStatusCode());
  }
}
Program: 60596
Project: 60596
Buggy source:
@Test public void selfRead(){
  UserService userService2=setupCredentials(userService,"String_Node_Str",ADMIN_PWD);
  try {
    userService2.read(1L);
    fail();
  }
 catch (  HttpClientErrorException e) {
    assertEquals(HttpStatus.FORBIDDEN,e.getStatusCode());
  }
  UserTO userTO=userService2.readSelf();
  assertEquals("String_Node_Str",userTO.getUsername());
}

Fixed version (ground truth):
@Test public void selfRead(){
  UserService userService2=setupCredentials(userService,UserService.class,"String_Node_Str",ADMIN_PWD);
  try {
    userService2.read(1L);
    fail();
  }
 catch (  HttpClientErrorException e) {
    assertEquals(HttpStatus.FORBIDDEN,e.getStatusCode());
  }
  UserTO userTO=userService2.readSelf();
  assertEquals("String_Node_Str",userTO.getUsername());
}
Program: 60598
Project: 60598
Buggy source:
@Test public void createWithException(){
  PasswordPolicyTO policy=new PasswordPolicyTO(true);
  policy.setSpecification(new PasswordPolicySpec());
  policy.setDescription("String_Node_Str");
  System.out.println(policy.getType());
  Throwable t=null;
  try {
    policyService.create(PolicyType.PASSWORD,policy);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException sccee) {
    t=sccee.getException(SyncopeClientExceptionType.InvalidPasswordPolicy);
  }
  assertNotNull(t);
}

Fixed version (ground truth):
@Test public void createWithException(){
  PasswordPolicyTO policy=new PasswordPolicyTO(true);
  policy.setSpecification(new PasswordPolicySpec());
  policy.setDescription("String_Node_Str");
  System.out.println(policy.getType());
  try {
    createPolicy(policyService,PolicyType.PASSWORD,policy);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException sccee) {
    assertNotNull(sccee.getException(SyncopeClientExceptionType.InvalidPasswordPolicy));
  }
}
Program: 60599
Project: 60599
Buggy source:
@Test public void createMissingDescription(){
  SyncPolicyTO policy=new SyncPolicyTO();
  policy.setSpecification(new SyncPolicySpec());
  Throwable t=null;
  try {
    policyService.create(PolicyType.SYNC,policy);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException sccee) {
    t=sccee.getException(SyncopeClientExceptionType.InvalidSyncPolicy);
  }
  assertNotNull(t);
}

Fixed version (ground truth):
@Test public void createMissingDescription(){
  SyncPolicyTO policy=new SyncPolicyTO();
  policy.setSpecification(new SyncPolicySpec());
  try {
    createPolicy(policyService,PolicyType.SYNC,policy);
    fail();
  }
 catch (  SyncopeClientCompositeErrorException sccee) {
    assertNotNull(sccee.getException(SyncopeClientExceptionType.InvalidSyncPolicy));
  }
}
Program: 60600
Project: 60600
Buggy source:
@Test public void create(){
  SyncPolicyTO policy=buildSyncPolicyTO();
  Response response=policyService.create(PolicyType.SYNC,policy);
  SyncPolicyTO policyTO=getObject(response,SyncPolicyTO.class,policyService);
  assertNotNull(policyTO);
  assertEquals(PolicyType.SYNC,policyTO.getType());
}

Fixed version (ground truth):
@Test public void create(){
  SyncPolicyTO policy=buildSyncPolicyTO();
  Response response=createPolicy(policyService,PolicyType.SYNC,policy);
  SyncPolicyTO policyTO=getObject(response,SyncPolicyTO.class,policyService);
  assertNotNull(policyTO);
  assertEquals(PolicyType.SYNC,policyTO.getType());
}
Program: 60601
Project: 60601
Buggy source:
@Test public void update(){
  PasswordPolicyTO globalPolicy=policyService.read(PolicyType.PASSWORD,2L);
  PasswordPolicyTO policy=new PasswordPolicyTO();
  policy.setDescription("String_Node_Str");
  policy.setSpecification(globalPolicy.getSpecification());
  Response response=policyService.create(PolicyType.PASSWORD,policy);
  policy=getObject(response,PasswordPolicyTO.class,policyService);
  policy=policyService.read(PolicyType.PASSWORD,policy.getId());
  assertNotNull("String_Node_Str",policy);
  PasswordPolicySpec policySpec=policy.getSpecification();
  policySpec.setMaxLength(22);
  policy.setSpecification(policySpec);
  policyService.update(PolicyType.PASSWORD,policy.getId(),policy);
  policy=policyService.read(PolicyType.PASSWORD,policy.getId());
  assertNotNull(policy);
  assertEquals(PolicyType.PASSWORD,policy.getType());
  assertEquals(22,policy.getSpecification().getMaxLength());
  assertEquals(8,policy.getSpecification().getMinLength());
}

Fixed version (ground truth):
@Test public void update(){
  PasswordPolicyTO globalPolicy=policyService.read(PolicyType.PASSWORD,2L);
  PasswordPolicyTO policy=new PasswordPolicyTO();
  policy.setDescription("String_Node_Str");
  policy.setSpecification(globalPolicy.getSpecification());
  Response response=createPolicy(policyService,PolicyType.PASSWORD,policy);
  policy=getObject(response,PasswordPolicyTO.class,policyService);
  policy=policyService.read(PolicyType.PASSWORD,policy.getId());
  assertNotNull("String_Node_Str",policy);
  PasswordPolicySpec policySpec=policy.getSpecification();
  policySpec.setMaxLength(22);
  policy.setSpecification(policySpec);
  policyService.update(PolicyType.PASSWORD,policy.getId(),policy);
  policy=policyService.read(PolicyType.PASSWORD,policy.getId());
  assertNotNull(policy);
  assertEquals(PolicyType.PASSWORD,policy.getType());
  assertEquals(22,policy.getSpecification().getMaxLength());
  assertEquals(8,policy.getSpecification().getMinLength());
}
Program: 60602
Project: 60602
Buggy source:
@Test public void delete(){
  SyncPolicyTO policy=buildSyncPolicyTO();
  Response response=policyService.create(PolicyType.SYNC,policy);
  SyncPolicyTO policyTO=getObject(response,SyncPolicyTO.class,policyService);
  assertNotNull(policyTO);
  policyService.delete(PolicyType.SYNC,policyTO.getId());
  Throwable t=null;
  try {
    policyService.read(PolicyType.SYNC,policyTO.getId());
  }
 catch (  SyncopeClientCompositeErrorException e) {
    t=e;
  }
  assertNotNull(t);
}

Fixed version (ground truth):
@Test public void delete(){
  SyncPolicyTO policy=buildSyncPolicyTO();
  Response response=createPolicy(policyService,PolicyType.SYNC,policy);
  SyncPolicyTO policyTO=getObject(response,SyncPolicyTO.class,policyService);
  assertNotNull(policyTO);
  policyService.delete(PolicyType.SYNC,policyTO.getId());
  Throwable t=null;
  try {
    policyService.read(PolicyType.SYNC,policyTO.getId());
  }
 catch (  SyncopeClientCompositeErrorException e) {
    t=e;
  }
  assertNotNull(t);
}
Program: 60603
Project: 60603
Buggy source:
@Test public void selfRead(){
  UserService userService2=setupCredentials(userService,UserService.class,"String_Node_Str",ADMIN_PWD);
  try {
    userService2.read(1L);
    fail();
  }
 catch (  HttpClientErrorException e) {
    assertEquals(HttpStatus.FORBIDDEN,e.getStatusCode());
  }
  UserTO userTO=userService2.readSelf();
  assertEquals("String_Node_Str",userTO.getUsername());
}

Fixed version (ground truth):
@Test public void selfRead(){
  UserService userService2=setupCredentials(userService,UserService.class,"String_Node_Str",ADMIN_PWD);
  try {
    userService2.read(1L);
    fail();
  }
 catch (  HttpClientErrorException e) {
    assertEquals(HttpStatus.FORBIDDEN,e.getStatusCode());
  }
catch (  AccessControlException e) {
    assertNotNull(e);
  }
  UserTO userTO=userService2.readSelf();
  assertEquals("String_Node_Str",userTO.getUsername());
}
Program: 60604
Project: 60604
Buggy source:
@Override public Response create(final UserRequestTO userRequestTO){
  UserRequestTO outUserRequestTO=null;
  if (userRequestTO.getType() == UserRequestType.CREATE) {
    outUserRequestTO=userRequestController.create(userRequestTO.getUserTO());
  }
 else   if (userRequestTO.getType() == UserRequestType.UPDATE) {
    outUserRequestTO=userRequestController.update(userRequestTO.getUserMod());
  }
 else   if (userRequestTO.getType() == UserRequestType.DELETE) {
    userRequestController.delete(userRequestTO.getUserId());
  }
  URI location=uriInfo.getAbsolutePathBuilder().path("String_Node_Str" + outUserRequestTO.getId()).build();
  return Response.created(location).header(SyncopeConstants.REST_HEADER_ID,outUserRequestTO.getId()).build();
}

Fixed version (ground truth):
@Override public Response create(final UserRequestTO userRequestTO){
  UserRequestTO outUserRequestTO=null;
  if (userRequestTO.getType() == UserRequestType.CREATE) {
    outUserRequestTO=userRequestController.create(userRequestTO.getUserTO());
  }
 else   if (userRequestTO.getType() == UserRequestType.UPDATE) {
    outUserRequestTO=userRequestController.update(userRequestTO.getUserMod());
  }
 else   if (userRequestTO.getType() == UserRequestType.DELETE) {
    outUserRequestTO=userRequestController.delete(userRequestTO.getUserId());
  }
  URI location=uriInfo.getAbsolutePathBuilder().path("String_Node_Str" + outUserRequestTO.getId()).build();
  return Response.created(location).header(SyncopeConstants.REST_HEADER_ID,outUserRequestTO.getId()).build();
}
Program: 60608
Project: 60608
Buggy source:
/** 
 * Check if the configured user workflow adapter is Activiti's.
 * @return whether Activiti is configured for workflow or not
 */
public static boolean isActivitiEnabledForUsers(){
  return uwfAdapterClassName != null && uwfAdapterClassName.equals(ActivitiUserWorkflowAdapter.class.getName());
}

Fixed version (ground truth):
/** 
 * Check if the configured user workflow adapter is Activiti's.
 * @return whether Activiti is configured for user workflow or not
 */
public static boolean isActivitiEnabledForUsers(){
  return uwfAdapterClassName != null && uwfAdapterClassName.equals(ActivitiUserWorkflowAdapter.class.getName());
}
Program: 60609
Project: 60609
Buggy source:
@Test public void testGetRoleTasks(){
  List<String> tasks=workflowService.getDefinedTasks(ROLE_TYPE);
  assertNotNull(tasks);
  assertTrue(tasks.size() > 0);
}

Fixed version (ground truth):
@Test public void testGetRoleTasks(){
  List<String> tasks=workflowService.getDefinedTasks(ROLE_TYPE);
  assertNotNull(tasks);
  assertFalse(tasks.isEmpty());
}
Program: 60610
Project: 60610
Buggy source:
@Test @Ignore public void testUpdateUserDefinition(){
  WorkflowDefinitionTO definition=workflowService.getDefinition(USER_TYPE);
  assertNotNull(definition);
  String newID=(definition.getId() != null) ? definition.getId() + "String_Node_Str" : "String_Node_Str";
  definition.setId(newID);
  workflowService.updateDefinition(USER_TYPE,definition);
  WorkflowDefinitionTO newDefinition=workflowService.getDefinition(USER_TYPE);
  assertEquals(newID,newDefinition.getId());
}

Fixed version (ground truth):
@Test public void testUpdateUserDefinition(){
  Assume.assumeTrue(SpringContextInitializer.isActivitiEnabledForUsers());
  WorkflowDefinitionTO definition=workflowService.getDefinition(USER_TYPE);
  assertNotNull(definition);
  workflowService.updateDefinition(USER_TYPE,definition);
  WorkflowDefinitionTO newDefinition=workflowService.getDefinition(USER_TYPE);
  assertNotNull(newDefinition);
}
Program: 60611
Project: 60611
Buggy source:
@Test public void testGetUserTasks(){
  List<String> tasks=workflowService.getDefinedTasks(USER_TYPE);
  assertNotNull(tasks);
  assertTrue(tasks.size() > 0);
}

Fixed version (ground truth):
@Test public void testGetUserTasks(){
  List<String> tasks=workflowService.getDefinedTasks(USER_TYPE);
  assertNotNull(tasks);
  assertFalse(tasks.isEmpty());
}
Program: 60612
Project: 60612
Buggy source:
@Test @Ignore public void testUpdateRoleDefinition(){
  WorkflowDefinitionTO definition=workflowService.getDefinition(ROLE_TYPE);
  assertNotNull(definition);
  String newID=(definition.getId() != null) ? definition.getId() + "String_Node_Str" : "String_Node_Str";
  definition.setId(newID);
  workflowService.updateDefinition(ROLE_TYPE,definition);
  WorkflowDefinitionTO newDefinition=workflowService.getDefinition(ROLE_TYPE);
  assertEquals(newID,newDefinition.getId());
}

Fixed version (ground truth):
@Test public void testUpdateRoleDefinition(){
  Assume.assumeTrue(SpringContextInitializer.isActivitiEnabledForRoles());
  WorkflowDefinitionTO definition=workflowService.getDefinition(ROLE_TYPE);
  assertNotNull(definition);
  workflowService.updateDefinition(ROLE_TYPE,definition);
  WorkflowDefinitionTO newDefinition=workflowService.getDefinition(ROLE_TYPE);
  assertNotNull(newDefinition);
}
Program: 60613
Project: 60613
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public RoleTO create(final HttpServletResponse response,@RequestBody final RoleTO roleTO) throws UnauthorizedRoleException, WorkflowException, NotFoundException, PropagationException {
  LOG.debug("String_Node_Str",roleTO);
  Set<Long> allowedRoleIds=EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
  if (roleTO.getParent() != 0 && !allowedRoleIds.contains(roleTO.getParent())) {
    throw new UnauthorizedRoleException(roleTO.getParent());
  }
  WorkflowResult<Long> created=rwfAdapter.create(roleTO);
  Authentication auth=SecurityContextHolder.getContext().getAuthentication();
  List<GrantedAuthority> authorities=new ArrayList<GrantedAuthority>(auth.getAuthorities());
  authorities.add(new SimpleGrantedAuthority(EntitlementUtil.getEntitlementNameFromRoleId(created.getResult())));
  Authentication newAuth=new UsernamePasswordAuthenticationToken(auth.getPrincipal(),auth.getCredentials(),authorities);
  SecurityContextHolder.getContext().setAuthentication(newAuth);
  List<PropagationTask> tasks=propagationManager.getRoleCreateTaskIds(created,roleTO.getVirtualAttributes());
  final List<PropagationTO> propagations=new ArrayList<PropagationTO>();
  taskExecutor.execute(tasks,new DefaultPropagationHandler(connObjectUtil,propagations));
  final RoleTO savedTO=dataBinder.getRoleTO(created.getResult());
  savedTO.setPropagationTOs(propagations);
  LOG.debug("String_Node_Str",savedTO);
  auditManager.audit(Category.role,RoleSubCategory.create,Result.success,"String_Node_Str" + savedTO.getId());
  response.setStatus(HttpServletResponse.SC_CREATED);
  return savedTO;
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public RoleTO create(final HttpServletResponse response,@RequestBody final RoleTO roleTO) throws UnauthorizedRoleException, WorkflowException, NotFoundException, PropagationException {
  LOG.debug("String_Node_Str",roleTO);
  Set<Long> allowedRoleIds=EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
  if (roleTO.getParent() != 0 && !allowedRoleIds.contains(roleTO.getParent())) {
    throw new UnauthorizedRoleException(roleTO.getParent());
  }
  WorkflowResult<Long> created=rwfAdapter.create(roleTO);
  EntitlementUtil.extendAuthContext(created.getResult());
  List<PropagationTask> tasks=propagationManager.getRoleCreateTaskIds(created,roleTO.getVirtualAttributes());
  final List<PropagationTO> propagations=new ArrayList<PropagationTO>();
  taskExecutor.execute(tasks,new DefaultPropagationHandler(connObjectUtil,propagations));
  final RoleTO savedTO=dataBinder.getRoleTO(created.getResult());
  savedTO.setPropagationTOs(propagations);
  LOG.debug("String_Node_Str",savedTO);
  auditManager.audit(Category.role,RoleSubCategory.create,Result.success,"String_Node_Str" + savedTO.getId());
  response.setStatus(HttpServletResponse.SC_CREATED);
  return savedTO;
}
Program: 60615
Project: 60615
Buggy source:
@Test public void derAttrFromSpecialAttrs(){
  UDerSchema sderived=new UDerSchema();
  sderived.setName("String_Node_Str");
  sderived.setExpression("String_Node_Str");
  sderived=derSchemaDAO.save(sderived);
  derSchemaDAO.flush();
  UDerSchema actual=derSchemaDAO.find("String_Node_Str",UDerSchema.class);
  assertNotNull("String_Node_Str",actual);
  assertEquals(sderived,actual);
  SyncopeUser owner=userDAO.find(3L);
  assertNotNull("String_Node_Str",owner);
  UDerAttr derAttr=new UDerAttr();
  derAttr.setOwner(owner);
  derAttr.setDerivedSchema(sderived);
  derAttr=derAttrDAO.save(derAttr);
  derAttrDAO.flush();
  derAttr=derAttrDAO.find(derAttr.getId(),UDerAttr.class);
  assertNotNull("String_Node_Str",derAttr);
  String value=derAttr.getValue(owner.getAttributes());
  assertNotNull(value);
  assertFalse(value.isEmpty());
  assertTrue(value.startsWith("String_Node_Str"));
  assertTrue(value.endsWith("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void derAttrFromSpecialAttrs(){
  UDerSchema sderived=new UDerSchema();
  sderived.setName("String_Node_Str");
  sderived.setExpression("String_Node_Str");
  sderived=derSchemaDAO.save(sderived);
  derSchemaDAO.flush();
  UDerSchema actual=derSchemaDAO.find("String_Node_Str",UDerSchema.class);
  assertNotNull("String_Node_Str",actual);
  assertEquals(sderived,actual);
  SyncopeUser owner=userDAO.find(3L);
  assertNotNull("String_Node_Str",owner);
  UDerAttr derAttr=new UDerAttr();
  derAttr.setOwner(owner);
  derAttr.setDerivedSchema(sderived);
  derAttr=derAttrDAO.save(derAttr);
  derAttrDAO.flush();
  derAttr=derAttrDAO.find(derAttr.getId(),UDerAttr.class);
  assertNotNull("String_Node_Str",derAttr);
  String value=derAttr.getValue(owner.getAttributes());
  assertNotNull(value);
  assertFalse(value.isEmpty());
  System.out.println("String_Node_Str" + value);
  assertTrue(value.startsWith("String_Node_Str"));
  assertTrue(value.endsWith("String_Node_Str"));
}
Program: 60617
Project: 60617
Buggy source:
@Override protected void onUpdate(final AjaxRequestTarget target){
  prefMan.set(getWebRequest(),(WebResponse)getResponse(),Constants.PREF_NOTIFICATION_TASKS_PAGINATOR_ROWS,String.valueOf(paginatorRows));
  table.setItemsPerPage(paginatorRows);
  target.add(container);
}

Fixed version (ground truth):
@Override protected void onUpdate(final AjaxRequestTarget target){
  prefMan.set(getWebRequest(),(WebResponse)getResponse(),Constants.PREF_NOTIFICATION_TASKS_PAGINATOR_ROWS,String.valueOf(paginatorRows));
  table=Tasks.updateTaskTable(columns,new TasksProvider(restClient,paginatorRows,getId(),NotificationTaskTO.class),container,table == null ? 0 : table.getCurrentPage());
  target.add(container);
}
Program: 60619
Project: 60619
Buggy source:
@Override protected void onUpdate(final AjaxRequestTarget target){
  prefMan.set(getWebRequest(),(WebResponse)getResponse(),Constants.PREF_PROPAGATION_TASKS_PAGINATOR_ROWS,String.valueOf(paginatorRows));
  table.setItemsPerPage(paginatorRows);
  target.add(container);
}

Fixed version (ground truth):
@Override protected void onUpdate(final AjaxRequestTarget target){
  prefMan.set(getWebRequest(),(WebResponse)getResponse(),Constants.PREF_PROPAGATION_TASKS_PAGINATOR_ROWS,String.valueOf(paginatorRows));
  table=Tasks.updateTaskTable(columns,new TasksProvider(restClient,paginatorRows,getId(),PropagationTaskTO.class),container,table == null ? 0 : table.getCurrentPage());
  target.add(container);
}
Program: 60620
Project: 60620
Buggy source:
private void updateResultTable(final boolean create){
  rows=preferences.getPaginatorRows(getRequest(),Constants.PREF_USERS_PAGINATOR_ROWS);
  dataProvider=new UserDataProvider(userRestClient,rows,filtered);
  dataProvider.setSearchCond(filter);
  final int currentPage=resultTable != null ? (create ? resultTable.getPageCount() - 1 : resultTable.getCurrentPage()) : 0;
  resultTable=new AjaxFallbackDefaultDataTable<UserTO>("String_Node_Str",getColumns(),dataProvider,rows);
  resultTable.setCurrentPage(currentPage);
  resultTable.setOutputMarkupId(true);
  container.addOrReplace(resultTable);
}

Fixed version (ground truth):
private void updateResultTable(final boolean create,final int rows){
  dataProvider=new UserDataProvider(userRestClient,rows,filtered);
  dataProvider.setSearchCond(filter);
  final int currentPage=resultTable != null ? (create ? resultTable.getPageCount() - 1 : resultTable.getCurrentPage()) : 0;
  resultTable=new AjaxFallbackDefaultDataTable<UserTO>("String_Node_Str",getColumns(),dataProvider,rows);
  resultTable.setCurrentPage(currentPage);
  resultTable.setOutputMarkupId(true);
  container.addOrReplace(resultTable);
}
Program: 60621
Project: 60621
Buggy source:
private void setWindowClosedReloadCallback(final ModalWindow window){
  window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
    private static final long serialVersionUID=8804221891699487139L;
    @Override public void onClose(    final AjaxRequestTarget target){
      final EventDataWrapper data=new EventDataWrapper();
      data.setTarget(target);
      send(getParent(),Broadcast.BREADTH,data);
      if (page.isModalResult()) {
        page.setModalResult(false);
        getSession().info(getString("String_Node_Str"));
        target.add(feedbackPanel);
      }
    }
  }
);
}

Fixed version (ground truth):
private void setWindowClosedReloadCallback(final ModalWindow window){
  window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
    private static final long serialVersionUID=8804221891699487139L;
    @Override public void onClose(    final AjaxRequestTarget target){
      final EventDataWrapper data=new EventDataWrapper();
      data.setTarget(target);
      data.setRows(rows);
      send(getParent(),Broadcast.BREADTH,data);
      if (page.isModalResult()) {
        page.setModalResult(false);
        getSession().info(getString("String_Node_Str"));
        target.add(feedbackPanel);
      }
    }
  }
);
}
Program: 60622
Project: 60622
Buggy source:
@Override public void onClose(final AjaxRequestTarget target){
  final EventDataWrapper data=new EventDataWrapper();
  data.setTarget(target);
  send(getParent(),Broadcast.BREADTH,data);
  if (page.isModalResult()) {
    page.setModalResult(false);
    getSession().info(getString("String_Node_Str"));
    target.add(feedbackPanel);
  }
}

Fixed version (ground truth):
@Override public void onClose(final AjaxRequestTarget target){
  final EventDataWrapper data=new EventDataWrapper();
  data.setTarget(target);
  data.setRows(rows);
  send(getParent(),Broadcast.BREADTH,data);
  if (page.isModalResult()) {
    page.setModalResult(false);
    getSession().info(getString("String_Node_Str"));
    target.add(feedbackPanel);
  }
}
Program: 60624
Project: 60624
Buggy source:
@Override public void onEvent(final IEvent<?> event){
  if (event.getPayload() instanceof EventDataWrapper) {
    final EventDataWrapper data=(EventDataWrapper)event.getPayload();
    final AjaxRequestTarget target=data.getTarget();
    updateResultTable(data.isCreate());
    target.add(container);
  }
}

Fixed version (ground truth):
@Override public void onEvent(final IEvent<?> event){
  if (event.getPayload() instanceof EventDataWrapper) {
    final EventDataWrapper data=(EventDataWrapper)event.getPayload();
    if (data.getRows() < 1) {
      updateResultTable(data.isCreate());
    }
 else {
      updateResultTable(data.isCreate(),data.getRows());
    }
    data.getTarget().add(container);
  }
}
Program: 60625
Project: 60625
Buggy source:
@Override protected void onUpdate(final AjaxRequestTarget target){
  preferences.set(getRequest(),getResponse(),Constants.PREF_USERS_PAGINATOR_ROWS,String.valueOf(rows));
  final EventDataWrapper data=new EventDataWrapper();
  data.setTarget(target);
  send(getParent(),Broadcast.BREADTH,data);
}

Fixed version (ground truth):
@Override protected void onUpdate(final AjaxRequestTarget target){
  preferences.set(getRequest(),getResponse(),Constants.PREF_USERS_PAGINATOR_ROWS,String.valueOf(rows));
  final EventDataWrapper data=new EventDataWrapper();
  data.setTarget(target);
  data.setRows(rows);
  send(getParent(),Broadcast.BREADTH,data);
}
Program: 60626
Project: 60626
Buggy source:
@Override protected List<String> load(){
  final List<String> resourceNames=new ArrayList<String>();
  for (  ResourceTO resourceTO : resourceRestClient.getAllResources()) {
    resourceNames.add(resourceTO.getName());
  }
  return resourceNames;
}

Fixed version (ground truth):
@Override protected Object load(){
  final List<String> resourceNames=new ArrayList<String>();
  for (  ResourceTO resourceTO : client.getAllResources()) {
    resourceNames.add(resourceTO.getName());
  }
  return resourceNames;
}
Program: 60627
Project: 60627
Buggy source:
public <T extends AbstractAttributableTO>ResourcesPanel(final String id,final T entityTO){
  super(id);
  final AjaxPalettePanel resourcesPalette=new AjaxPalettePanel("String_Node_Str",new PropertyModel(entityTO,"String_Node_Str"),new ListModel<String>(allResources.getObject()));
  add(resourcesPalette);
}

Fixed version (ground truth):
public <T extends AbstractAttributableTO>ResourcesPanel(final String id,final T entityTO){
  super(id);
  final IModel<List<String>> allResources=new allResourcesModel(resourceRestClient);
  final AjaxPalettePanel resourcesPalette=new AjaxPalettePanel("String_Node_Str",new PropertyModel(entityTO,"String_Node_Str"),new ListModel<String>(allResources.getObject()));
  add(resourcesPalette);
}
Program: 60628
Project: 60628
Buggy source:
@Test public void findAll(){
  List<TaskExec> list=taskExecDAO.findAll(PropagationTask.class);
  assertEquals(1,list.size());
  list=taskExecDAO.findAll(SchedTask.class);
  assertEquals(0,list.size());
  list=taskExecDAO.findAll(SyncTask.class);
  assertEquals(0,list.size());
  list=taskExecDAO.findAll(NotificationTask.class);
  assertEquals(0,list.size());
}

Fixed version (ground truth):
@Test public void findAll(){
  List<TaskExec> list=taskExecDAO.findAll(PropagationTask.class);
  assertEquals(1,list.size());
  list=taskExecDAO.findAll(SchedTask.class);
  assertEquals(0,list.size());
  list=taskExecDAO.findAll(SyncTask.class);
  assertEquals(0,list.size());
  list=taskExecDAO.findAll(NotificationTask.class);
  assertEquals(1,list.size());
}
Program: 60631
Project: 60631
Buggy source:
/** 
 * Get all attribute types from a selected attribute type.
 * @param entity entity.
 * @return all attribute types.
 */
private List<IntMappingType> getAttributeTypes(final Entity entity){
  final List<IntMappingType> res=new ArrayList<IntMappingType>();
  if (entity != null) {
    final EnumSet types=IntMappingType.getAttributeTypes(Entity.valueOf(entity.toString()));
    for (    Object type : types) {
      res.add(IntMappingType.valueOf(type.toString()));
    }
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Get all attribute types from a selected attribute type.
 * @param entity entity.
 * @return all attribute types.
 */
private List<IntMappingType> getAttributeTypes(final AttributableType entity){
  final List<IntMappingType> res=new ArrayList<IntMappingType>();
  if (entity != null) {
    final EnumSet types=IntMappingType.getAttributeTypes(AttributableType.valueOf(entity.toString()));
    for (    Object type : types) {
      res.add(IntMappingType.valueOf(type.toString()));
    }
  }
  return res;
}
Program: 60639
Project: 60639
Buggy source:
private void filterProperties(final Set<ConnConfProperty> properties){
  for (  ConnConfProperty property : properties) {
    final List parsed=new ArrayList();
    for (    Object obj : property.getValues()) {
      if (obj != null && !obj.toString().isEmpty()) {
        parsed.add(obj);
      }
    }
    property.setValues(parsed);
  }
}

Fixed version (ground truth):
private Set<ConnConfProperty> filterProperties(final Set<ConnConfProperty> properties){
  Set<ConnConfProperty> newProperties=new HashSet<ConnConfProperty>();
  for (  ConnConfProperty property : properties) {
    ConnConfProperty prop=new ConnConfProperty();
    prop.setSchema(property.getSchema());
    prop.setOverridable(property.isOverridable());
    final List parsed=new ArrayList();
    for (    Object obj : property.getValues()) {
      if (obj != null && !obj.toString().isEmpty()) {
        parsed.add(obj);
      }
    }
    prop.setValues(parsed);
    newProperties.add(prop);
  }
  return newProperties;
}
Program: 60641
Project: 60641
Buggy source:
public void setName(String name){
  this.name=name;
}

Fixed version (ground truth):
public void setName(final String name){
  this.name=name;
}
Program: 60642
Project: 60642
Buggy source:
public String getLevel(){
  return level;
}

Fixed version (ground truth):
public LoggerLevel getLevel(){
  return level;
}
Program: 60643
Project: 60643
Buggy source:
public void setLevel(String level){
  this.level=level;
}

Fixed version (ground truth):
public void setLevel(final LoggerLevel level){
  this.level=level;
}
Program: 60644
Project: 60644
Buggy source:
@Override public LoggerLevel getObject(){
  return LoggerLevel.valueOf(item.getModelObject().getLevel());
}

Fixed version (ground truth):
@Override public LoggerLevel getObject(){
  return item.getModelObject().getLevel();
}
Program: 60645
Project: 60645
Buggy source:
@Override public void setObject(final LoggerLevel object){
  item.getModelObject().setLevel(object.toString());
}

Fixed version (ground truth):
@Override public void setObject(final LoggerLevel object){
  item.getModelObject().setLevel(object);
}
Program: 60646
Project: 60646
Buggy source:
@Override protected void populateItem(final ListItem<LoggerTO> item){
  item.add(new Label("String_Node_Str"));
  DropDownChoice<LoggerLevel> level=new DropDownChoice<LoggerLevel>("String_Node_Str");
  level.setModel(new IModel<LoggerLevel>(){
    private static final long serialVersionUID=-2350428186089596562L;
    @Override public LoggerLevel getObject(){
      return LoggerLevel.valueOf(item.getModelObject().getLevel());
    }
    @Override public void setObject(    final LoggerLevel object){
      item.getModelObject().setLevel(object.toString());
    }
    @Override public void detach(){
    }
  }
);
  level.setChoices(Arrays.asList(LoggerLevel.values()));
  level.setOutputMarkupId(true);
  level.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      boolean result=getId().equals("String_Node_Str") ? confRestClient.setLoggerLevel(item.getModelObject().getName(),item.getModelObject().getLevel()) : consoleLoggerController.setLoggerLevel(item.getModelObject().getName(),item.getModelObject().getLevel());
      if (result) {
        info(getString("String_Node_Str"));
      }
 else {
        info(getString("String_Node_Str"));
      }
      target.add(feedbackPanel);
    }
  }
);
  item.add(level);
}

Fixed version (ground truth):
@Override protected void populateItem(final ListItem<LoggerTO> item){
  item.add(new Label("String_Node_Str"));
  DropDownChoice<LoggerLevel> level=new DropDownChoice<LoggerLevel>("String_Node_Str");
  level.setModel(new IModel<LoggerLevel>(){
    private static final long serialVersionUID=-2350428186089596562L;
    @Override public LoggerLevel getObject(){
      return item.getModelObject().getLevel();
    }
    @Override public void setObject(    final LoggerLevel object){
      item.getModelObject().setLevel(object);
    }
    @Override public void detach(){
    }
  }
);
  level.setChoices(Arrays.asList(LoggerLevel.values()));
  level.setOutputMarkupId(true);
  level.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      boolean result=getId().equals("String_Node_Str") ? confRestClient.setLoggerLevel(item.getModelObject().getName(),item.getModelObject().getLevel()) : consoleLoggerController.setLoggerLevel(item.getModelObject().getName(),item.getModelObject().getLevel());
      if (result) {
        info(getString("String_Node_Str"));
      }
 else {
        info(getString("String_Node_Str"));
      }
      target.add(feedbackPanel);
    }
  }
);
  item.add(level);
}
Program: 60647
Project: 60647
Buggy source:
public List<LoggerTO> getLoggers(){
  LoggerContext lc=(LoggerContext)LoggerFactory.getILoggerFactory();
  List<LoggerTO> result=new ArrayList<LoggerTO>(lc.getLoggerList().size());
  LoggerTO loggerTO;
  for (  Logger logger : lc.getLoggerList()) {
    if (logger.getLevel() != null) {
      loggerTO=new LoggerTO();
      loggerTO.setName(logger.getName());
      loggerTO.setLevel(logger.getLevel().toString());
      result.add(loggerTO);
    }
  }
  return result;
}

Fixed version (ground truth):
public List<LoggerTO> getLoggers(){
  LoggerContext lc=(LoggerContext)LoggerFactory.getILoggerFactory();
  List<LoggerTO> result=new ArrayList<LoggerTO>(lc.getLoggerList().size());
  LoggerTO loggerTO;
  for (  Logger logger : lc.getLoggerList()) {
    if (logger.getLevel() != null) {
      loggerTO=new LoggerTO();
      loggerTO.setName(logger.getName());
      loggerTO.setLevel(LoggerLevel.fromLevel(logger.getLevel()));
      result.add(loggerTO);
    }
  }
  return result;
}
Program: 60648
Project: 60648
Buggy source:
public boolean setLoggerLevel(final String name,final String level){
  LoggerContext lc=(LoggerContext)LoggerFactory.getILoggerFactory();
  Logger logger=lc.getLogger(name);
  if (logger != null) {
    logger.setLevel(Level.valueOf(level));
  }
  return logger != null;
}

Fixed version (ground truth):
public boolean setLoggerLevel(final String name,final LoggerLevel level){
  LoggerContext lc=(LoggerContext)LoggerFactory.getILoggerFactory();
  Logger logger=lc.getLogger(name);
  if (logger != null) {
    logger.setLevel(level.getLevel());
  }
  return logger != null;
}
Program: 60649
Project: 60649
Buggy source:
/** 
 * Get all stored configurations.
 * @return ConfigurationTOs
 */
public List<ConfigurationTO> getAllConfigurations() throws SyncopeClientCompositeErrorException {
  List<ConfigurationTO> configurations=null;
  configurations=Arrays.asList(restTemplate.getForObject(baseURL + "String_Node_Str",ConfigurationTO[].class));
  return configurations;
}

Fixed version (ground truth):
/** 
 * Get all stored configurations.
 * @return ConfigurationTOs
 */
public List<ConfigurationTO> getAllConfigurations(){
  return Arrays.asList(restTemplate.getForObject(baseURL + "String_Node_Str",ConfigurationTO[].class));
}
Program: 60650
Project: 60650
Buggy source:
/** 
 * Load an existent configuration.
 * @return ConfigurationTO object if the configuration exists,null otherwise
 */
public ConfigurationTO readConfiguration(String key) throws SyncopeClientCompositeErrorException {
  ConfigurationTO configurationTO=restTemplate.getForObject(baseURL + "String_Node_Str",ConfigurationTO.class,key);
  return configurationTO;
}

Fixed version (ground truth):
public ConfigurationTO readConfiguration(String key){
  return restTemplate.getForObject(baseURL + "String_Node_Str",ConfigurationTO.class,key);
}
Program: 60651
Project: 60651
Buggy source:
/** 
 * Deelete a configuration by key.
 */
public void deleteConfiguration(String key) throws SyncopeClientCompositeErrorException {
  restTemplate.delete(baseURL + "String_Node_Str",key);
}

Fixed version (ground truth):
/** 
 * Deelete a configuration by key.
 */
public void deleteConfiguration(final String key){
  restTemplate.delete(baseURL + "String_Node_Str",key);
}
Program: 60652
Project: 60652
Buggy source:
/** 
 * Update an existent configuration.
 * @param configurationTO
 * @return true if the operation ends succesfully, false otherwise
 */
public boolean updateConfiguration(ConfigurationTO configurationTO){
  ConfigurationTO newConfigurationTO=null;
  try {
    newConfigurationTO=restTemplate.postForObject(baseURL + "String_Node_Str",configurationTO,ConfigurationTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    LOG.error("String_Node_Str",e);
    return false;
  }
  return (configurationTO.equals(newConfigurationTO)) ? true : false;
}

Fixed version (ground truth):
/** 
 * Update an existent configuration.
 * @param configurationTO
 * @return true if the operation ends succesfully, false otherwise
 */
public boolean updateConfiguration(ConfigurationTO configurationTO){
  ConfigurationTO newConfigurationTO=null;
  try {
    newConfigurationTO=restTemplate.postForObject(baseURL + "String_Node_Str",configurationTO,ConfigurationTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    LOG.error("String_Node_Str",e);
    return false;
  }
  return configurationTO.equals(newConfigurationTO);
}