Program: 69945
Project: 69945
Buggy source:
public boolean addToRoom(ViteroBooking booking,Identity identity,GroupRole role) throws VmsNotAvailableException {
  try {
    int userId=getVmsUserId(identity,true);
    if (userId < 0) {
      return false;
    }
    try {
      updateVmsUser(identity,userId);
      storePortrait(identity,userId);
    }
 catch (    Exception e) {
      logError("String_Node_Str" + identity.getName(),e);
    }
    GroupServiceStub groupWs=getGroupWebService();
    GroupServiceStub.AddUserToGroupRequest addRequest=new GroupServiceStub.AddUserToGroupRequest();
    GroupServiceStub.Groupiduserid groupuserId=new GroupServiceStub.Groupiduserid();
    groupuserId.setGroupid(booking.getGroupId());
    groupuserId.setUserid(userId);
    addRequest.setAddUserToGroupRequest(groupuserId);
    groupWs.addUserToGroup(addRequest);
    if (role != null) {
      groupWs=getGroupWebService();
      GroupServiceStub.ChangeGroupRoleRequest roleRequest=new GroupServiceStub.ChangeGroupRoleRequest();
      roleRequest.setGroupid(booking.getGroupId());
      roleRequest.setUserid(userId);
      roleRequest.setRole(role.getVmsValue());
      groupWs.changeGroupRole(roleRequest);
    }
    return true;
  }
 catch (  AxisFault f) {
    ErrorCode code=handleAxisFault(f);
switch (code) {
case userDoesntExist:
      logError("String_Node_Str",f);
    break;
case userNotAttachedToCustomer:
  logError("String_Node_Str",f);
break;
case groupDoesntExist:
logError("String_Node_Str",f);
break;
case invalidAttribut:
logError("String_Node_Str",f);
break;
default :
logAxisError("String_Node_Str",f);
}
return false;
}
catch (RemoteException e) {
logError("String_Node_Str",e);
return false;
}
}

Fixed version (ground truth):
public boolean addToRoom(ViteroBooking booking,Identity identity,GroupRole role) throws VmsNotAvailableException {
  try {
    GetUserInfo userInfo=getVmsUserId(identity,true);
    int userId=userInfo.getUserId();
    if (userId < 0) {
      return false;
    }
    if (!userInfo.isCreated()) {
      try {
        updateVmsUser(identity,userId);
      }
 catch (      Exception e) {
        logError("String_Node_Str" + identity.getName(),e);
      }
    }
    GroupServiceStub groupWs=getGroupWebService();
    GroupServiceStub.AddUserToGroupRequest addRequest=new GroupServiceStub.AddUserToGroupRequest();
    GroupServiceStub.Groupiduserid groupuserId=new GroupServiceStub.Groupiduserid();
    groupuserId.setGroupid(booking.getGroupId());
    groupuserId.setUserid(userId);
    addRequest.setAddUserToGroupRequest(groupuserId);
    groupWs.addUserToGroup(addRequest);
    if (role != null) {
      groupWs=getGroupWebService();
      GroupServiceStub.ChangeGroupRoleRequest roleRequest=new GroupServiceStub.ChangeGroupRoleRequest();
      roleRequest.setGroupid(booking.getGroupId());
      roleRequest.setUserid(userId);
      roleRequest.setRole(role.getVmsValue());
      groupWs.changeGroupRole(roleRequest);
    }
    return true;
  }
 catch (  AxisFault f) {
    ErrorCode code=handleAxisFault(f);
switch (code) {
case userDoesntExist:
      logError("String_Node_Str",f);
    break;
case userNotAttachedToCustomer:
  logError("String_Node_Str",f);
break;
case groupDoesntExist:
logError("String_Node_Str",f);
break;
case invalidAttribut:
logError("String_Node_Str",f);
break;
default :
logAxisError("String_Node_Str",f);
}
return false;
}
catch (RemoteException e) {
logError("String_Node_Str",e);
return false;
}
}