Program: 102465
Project: 102465
Buggy source:
/** 
 * Gets a set of information of the target user. The returned information of the user includes full name, position avatar, link to profile and relationship status with the current user who sends request.
 * @param uriInfo The requested URI information.
 * @param securityContext The security context of the system.
 * @param userId The Id of a specific user.
 * @param format The format of the returned result, for example, JSON, or XML.
 * @param currentUserName The current user name who sends request.
 * @param updatedType The type of connection action shown on the pop-up.
 * @return The detailed information of a user.
 * @throws Exception
 * @LevelAPI Platform
 * @anchor PeopleRestService.getPeopleInfo
 */
@GET @Path("String_Node_Str") public Response getPeopleInfo(@Context UriInfo uriInfo,@Context SecurityContext securityContext,@PathParam("String_Node_Str") String userId,@PathParam("String_Node_Str") String format,@QueryParam("String_Node_Str") String currentUserName,@QueryParam("String_Node_Str") String updatedType) throws Exception {
  if (format.indexOf('.') > 0) {
    userId=new StringBuffer(userId).append("String_Node_Str").append(format.substring(0,format.lastIndexOf('.'))).toString();
    format=format.substring(format.lastIndexOf('.') + 1);
  }
  String[] mediaTypes=new String[]{"String_Node_Str","String_Node_Str"};
  format=ArrayUtils.contains(mediaTypes,format) ? format : mediaTypes[0];
  if (currentUserName == null || currentUserName.trim().isEmpty()) {
    currentUserName=getUserId(securityContext,uriInfo);
  }
  MediaType mediaType=Util.getMediaType(format,mediaTypes);
  PeopleInfo peopleInfo=new PeopleInfo(NO_INFO);
  Identity identity=getIdentityManager().getOrCreateIdentity(OrganizationIdentityProvider.NAME,userId,false);
  Identity currentIdentity=getIdentityManager().getOrCreateIdentity(OrganizationIdentityProvider.NAME,currentUserName,false);
  if (identity != null) {
    peopleInfo.setFullName(identity.getProfile().getFullName());
    peopleInfo.setPosition(StringEscapeUtils.unescapeHtml(identity.getProfile().getPosition()));
    peopleInfo.setDeleted(identity.isDeleted());
    Profile userProfile=identity.getProfile();
    String avatarURL=userProfile.getAvatarUrl();
    if (avatarURL == null) {
      avatarURL=LinkProvider.PROFILE_DEFAULT_AVATAR_URL;
    }
    peopleInfo.setAvatarURL(avatarURL);
    String userType=ConversationState.getCurrent().getIdentity().getUserId();
    boolean isAnonymous=IdentityConstants.ANONIM.equals(userType) || securityContext.getUserPrincipal() == null;
    if (!isAnonymous) {
      peopleInfo.setProfileUrl(LinkProvider.getUserActivityUri(identity.getRemoteId()));
      peopleInfo.setRelationshipType(NO_ACTION);
      String relationshipType=null;
      if (currentUserName != null && !userId.equals(currentUserName)) {
        Relationship relationship=getRelationshipManager().get(currentIdentity,identity);
        if (currentIdentity != null) {
          if (updatedType != null) {
            if (currentIdentity != null) {
              if (ACCEPT_ACTION.equals(updatedType)) {
                getRelationshipManager().confirm(currentIdentity,identity);
              }
 else               if (DENY_ACTION.equals(updatedType)) {
                getRelationshipManager().deny(currentIdentity,identity);
              }
 else               if (REVOKE_ACTION.equals(updatedType)) {
                getRelationshipManager().deny(currentIdentity,identity);
              }
 else               if (INVITE_ACTION.equals(updatedType)) {
                getRelationshipManager().inviteToConnect(currentIdentity,identity);
              }
 else               if (REMOVE_ACTION.equals(updatedType)) {
                getRelationshipManager().delete(getRelationshipManager().get(currentIdentity,identity));
              }
            }
          }
          relationshipType=getRelationshipType(relationship,currentIdentity);
          peopleInfo.setRelationshipType(relationshipType);
        }
      }
      if (CONFIRMED_STATUS.equals(relationshipType)) {
        String activityTitle=getLatestActivityTitle(identity,currentIdentity);
        if (activityTitle != null) {
          peopleInfo.setActivityTitle(StringEscapeUtils.unescapeHtml(activityTitle));
        }
      }
    }
  }
  return Util.getResponse(peopleInfo,uriInfo,mediaType,Response.Status.OK);
}

Fixed version (ground truth):
/** 
 * Gets a set of information of the target user. The returned information of the user includes full name, position avatar, link to profile and relationship status with the current user who sends request.
 * @param uriInfo The requested URI information.
 * @param securityContext The security context of the system.
 * @param userId The Id of a specific user.
 * @param format The format of the returned result, for example, JSON, or XML.
 * @param currentUserName The current user name who sends request.
 * @param updatedType The type of connection action shown on the pop-up.
 * @return The detailed information of a user.
 * @throws Exception
 * @LevelAPI Platform
 * @anchor PeopleRestService.getPeopleInfo
 */
@GET @Path("String_Node_Str") public Response getPeopleInfo(@Context UriInfo uriInfo,@Context SecurityContext securityContext,@PathParam("String_Node_Str") String userId,@PathParam("String_Node_Str") String format,@QueryParam("String_Node_Str") String currentUserName,@QueryParam("String_Node_Str") String updatedType) throws Exception {
  if (format.indexOf('.') > 0) {
    userId=new StringBuffer(userId).append("String_Node_Str").append(format.substring(0,format.lastIndexOf('.'))).toString();
    format=format.substring(format.lastIndexOf('.') + 1);
  }
  String[] mediaTypes=new String[]{"String_Node_Str","String_Node_Str"};
  format=ArrayUtils.contains(mediaTypes,format) ? format : mediaTypes[0];
  if (currentUserName == null || currentUserName.trim().isEmpty()) {
    currentUserName=getUserId(securityContext,uriInfo);
  }
  MediaType mediaType=Util.getMediaType(format,mediaTypes);
  PeopleInfo peopleInfo=new PeopleInfo(NO_INFO);
  Identity identity=getIdentityManager().getOrCreateIdentity(OrganizationIdentityProvider.NAME,userId,false);
  Identity currentIdentity=getIdentityManager().getOrCreateIdentity(OrganizationIdentityProvider.NAME,currentUserName,false);
  if (identity != null) {
    peopleInfo.setFullName(identity.getProfile().getFullName());
    peopleInfo.setPosition(StringEscapeUtils.unescapeHtml(identity.getProfile().getPosition()));
    peopleInfo.setDeleted(identity.isDeleted());
    Profile userProfile=identity.getProfile();
    String avatarURL=userProfile.getAvatarUrl();
    if (avatarURL == null) {
      avatarURL=LinkProvider.PROFILE_DEFAULT_AVATAR_URL;
    }
    peopleInfo.setAvatarURL(avatarURL);
    String userType=ConversationState.getCurrent().getIdentity().getUserId();
    boolean isAnonymous=IdentityConstants.ANONIM.equals(userType) || securityContext.getUserPrincipal() == null || !userType.equals(currentIdentity.getRemoteId());
    if (!isAnonymous) {
      peopleInfo.setProfileUrl(LinkProvider.getUserActivityUri(identity.getRemoteId()));
      peopleInfo.setRelationshipType(NO_ACTION);
      String relationshipType=null;
      if (currentUserName != null && !userId.equals(currentUserName)) {
        Relationship relationship=getRelationshipManager().get(currentIdentity,identity);
        if (currentIdentity != null) {
          if (updatedType != null) {
            if (currentIdentity != null) {
              if (ACCEPT_ACTION.equals(updatedType)) {
                getRelationshipManager().confirm(currentIdentity,identity);
              }
 else               if (DENY_ACTION.equals(updatedType)) {
                getRelationshipManager().deny(currentIdentity,identity);
              }
 else               if (REVOKE_ACTION.equals(updatedType)) {
                getRelationshipManager().deny(currentIdentity,identity);
              }
 else               if (INVITE_ACTION.equals(updatedType)) {
                getRelationshipManager().inviteToConnect(currentIdentity,identity);
              }
 else               if (REMOVE_ACTION.equals(updatedType)) {
                getRelationshipManager().delete(getRelationshipManager().get(currentIdentity,identity));
              }
            }
          }
          relationshipType=getRelationshipType(relationship,currentIdentity);
          peopleInfo.setRelationshipType(relationshipType);
        }
      }
      if (CONFIRMED_STATUS.equals(relationshipType)) {
        String activityTitle=getLatestActivityTitle(identity,currentIdentity);
        if (activityTitle != null) {
          peopleInfo.setActivityTitle(StringEscapeUtils.unescapeHtml(activityTitle));
        }
      }
    }
  }
  return Util.getResponse(peopleInfo,uriInfo,mediaType,Response.Status.OK);
}