Program: 102543
Project: 102543
Buggy source:
/** 
 * Get the identity and its associated profile by the activity ID.
 * @param uriInfo the uri request uri
 * @param portalContainerName The associated portal container name.
 * @param identityId The specified  ID of identity.
 * @param format The expected returned format.
 * @anchor SOCref.DevRef.RestService_APIs_v1alpha3.IdentityResources.Notes.Get
 * @authentication
 * @request {code} GET: http://cloud-workspaces.com/rest/private/api/social/v1-alpha3/portal/identity/123456789.json {code}
 * @response {code:json} { "id" : "123456789", "providerId": "organization", "remoteId": "demo", "profile": { "fullName": "Demo Gtn", "avatarUrl": "http://cloud-workspaces.com/profile/avatar/demo.jpg" } } {code}
 * @return a response object
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getIdentityById(@Context UriInfo uriInfo,@PathParam("String_Node_Str") String portalContainerName,@PathParam("String_Node_Str") String identityId,@PathParam("String_Node_Str") String format){
  RestChecker.checkAuthenticatedRequest();
  RestChecker.checkValidPortalContainerName(portalContainerName);
  if (identityId == null || identityId.equals("String_Node_Str")) {
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
  }
  MediaType mediaType=RestChecker.checkSupportedFormat(format,SUPPORTED_FORMAT);
  IdentityManager identityManager=Util.getIdentityManager(portalContainerName);
  try {
    Identity identity=identityManager.getIdentity(identityId,true);
    IdentityRestOut resultIdentity=new IdentityRestOut(identity);
    Util.buildAbsoluteAvatarURL(resultIdentity);
    return Util.getResponse(resultIdentity,uriInfo,mediaType,Response.Status.OK);
  }
 catch (  UndeclaredThrowableException undeclaredThrowableException) {
    if (undeclaredThrowableException.getCause() instanceof IdentityStorageException) {
      throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
 else {
      throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
    }
  }
catch (  Exception e) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}

Fixed version (ground truth):
/** 
 * Get the identity and its associated profile by the activity ID.
 * @param uriInfo The uri request uri.
 * @param portalContainerName The associated portal container name.
 * @param identityId The specified  ID of identity.
 * @param format The expected returned format.
 * @anchor SOCref.DevRef.RestService_APIs_v1alpha3.IdentityResources.Notes.Get
 * @authentication
 * @request {code} GET: http://cloud-workspaces.com/rest/private/api/social/v1-alpha3/portal/identity/123456789.json {code}
 * @response {code:json} { "id" : "123456789", "providerId": "organization", "remoteId": "demo", "profile": { "fullName": "Demo Gtn", "avatarUrl": "http://cloud-workspaces.com/profile/avatar/demo.jpg" } } {code}
 * @return a response object
 */
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getIdentityById(@Context UriInfo uriInfo,@PathParam("String_Node_Str") String portalContainerName,@PathParam("String_Node_Str") String identityId,@PathParam("String_Node_Str") String format){
  RestChecker.checkAuthenticatedRequest();
  RestChecker.checkValidPortalContainerName(portalContainerName);
  if (identityId == null || identityId.equals("String_Node_Str")) {
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
  }
  MediaType mediaType=RestChecker.checkSupportedFormat(format,SUPPORTED_FORMAT);
  IdentityManager identityManager=Util.getIdentityManager(portalContainerName);
  try {
    Identity identity=identityManager.getIdentity(identityId,true);
    IdentityRestOut resultIdentity=new IdentityRestOut(identity);
    Util.buildAbsoluteAvatarURL(resultIdentity);
    return Util.getResponse(resultIdentity,uriInfo,mediaType,Response.Status.OK);
  }
 catch (  UndeclaredThrowableException undeclaredThrowableException) {
    if (undeclaredThrowableException.getCause() instanceof IdentityStorageException) {
      throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
 else {
      throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
    }
  }
catch (  Exception e) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
}