| Chunk |
|---|
| Conflicting content |
|---|
boolean saveGroupUser(GroupUser groupUser); <<<<<<< HEAD /** * Removes the current user from the given group. * @param group * @return true if successful, false otherwise */ boolean removeCurrentUserFromGroup(Group group); /** * Removes the given user from the given group. * @param group * @param user * @return */ boolean removeUserFromGroup(Group group, User user); /** * Removes the current user from the given group in the database. * This method cascades the deletion to the GroupUser table, removing * any entries that belongs to the given group. * @param group * @return true if successful, false otherwise */ boolean removeGroup(Group group); ======= void close(); >>>>>>> 4573608c2ae2073750bed57c6a1fcc08ba531037 } |
| Solution content |
|---|
boolean saveGroupUser(GroupUser groupUser); /** * Removes the current user from the given group. * @param group * @return true if successful, false otherwise */ boolean removeCurrentUserFromGroup(Group group); /** * Removes the given user from the given group. * @param group * @param user * @return */ boolean removeUserFromGroup(Group group, User user); /** * Removes the current user from the given group in the database. * This method cascades the deletion to the GroupUser table, removing * any entries that belongs to the given group. * @param group * @return true if successful, false otherwise */ boolean removeGroup(Group group); void close(); } |
| File |
|---|
| UserModel.java |
| Developer's decision |
|---|
| Concatenation |
| Kind of conflict |
|---|
| Comment |
| Method interface |
| Chunk |
|---|
| Conflicting content |
|---|
if (group.getKey() == null) {
// new group
<<<<<<< HEAD
return entityManager.persist(group);
=======
if(searchGroupByName(group.getName())!=null){
return false;
}
if(entityManager.persist(group)){
//add current user to group
GroupUser grUser = new GroupUser();
grUser.setGroup(group);
grUser.setUser(group.getOwner());
if(saveGroupUser(grUser))
return true;
else{
//not able to add user to group
entityManager.delete(group);
return false;
}
}else
return false; //group not saved
>>>>>>> 4573608c2ae2073750bed57c6a1fcc08ba531037
} else {
// look for group
Group g = getGroup(group.getKey()); |
| Solution content |
|---|
if (group.getKey() == null) {
// new group
return entityManager.persist(group);
} else {
// look for group
Group g = getGroup(group.getKey()); |
| File |
|---|
| UserModelImpl.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method invocation |
| Return statement |
| Chunk |
|---|
| Conflicting content |
|---|
return entityManager.persist(groupUser);
}
<<<<<<< HEAD
@Override
public boolean removeCurrentUserFromGroup(Group group) {
return removeUserFromGroup(group, getCurrentUser());
}
@Override
public boolean removeGroup(Group group) {
verifyEM(entityManager);
verifyEntity(group);
if(!removeGroupUserFromGroup(group)){
return false;
} else {
return entityManager.delete(group);
}
}
/**
* Removes every entry in GroupsUser from the given group.
* @param group
* @return true if successful, false otherwise
*/
private boolean removeGroupUserFromGroup(Group group){
verifyEM(entityManager);
verifyEntity(group);
List |
| Solution content |
|---|
* @return true if successful, false otherwise
return entityManager.persist(groupUser);
}
@Override
public boolean removeCurrentUserFromGroup(Group group) {
return removeUserFromGroup(group, getCurrentUser());
}
@Override
public boolean removeGroup(Group group) {
verifyEM(entityManager);
verifyEntity(group);
if(!removeGroupUserFromGroup(group)){
return false;
} else {
return entityManager.delete(group);
}
}
/**
* Removes every entry in GroupsUser from the given group.
* @param group
*/
private boolean removeGroupUserFromGroup(Group group){
verifyEM(entityManager);
verifyEntity(group);
List |
| File |
|---|
| UserModelImpl.java |
| Developer's decision |
|---|
| Concatenation |
| Kind of conflict |
|---|
| Annotation |
| Attribute |
| Comment |
| For statement |
| Method declaration |
| Method invocation |
| Method signature |
| Return statement |
| Variable |