Program: 64044
Project: 64044
Buggy source:
/** 
 * Rest update bidirectional relationship.
 * @param context the context
 * @param objectId the object id
 * @param type the type
 * @param relationshipName the relationship name
 * @param newValue the new value
 * @param persistenceUnit the persistence unit
 * @param mediaType the media type
 * @param partner the partner
 * @param sendLinks the send links
 * @return the string
 * @throws RestCallFailedException the rest call failed exception
 * @throws JAXBException the jAXB exception
 * @throws URISyntaxException the uRI syntax exception
 */
public static String restUpdateBidirectionalRelationship(PersistenceContext context,String objectId,String type,String relationshipName,Object newValue,String persistenceUnit,MediaType mediaType,String partner,boolean sendLinks) throws RestCallFailedException, URISyntaxException, JAXBException {
  String url=RestUtils.getServerURI() + persistenceUnit + "String_Node_Str"+ type+ "String_Node_Str"+ objectId+ "String_Node_Str"+ relationshipName;
  if (partner != null) {
    url+="String_Node_Str" + MatrixParameters.JPARS_RELATIONSHIP_PARTNER + "String_Node_Str"+ partner;
  }
  WebResource webResource=client.resource(url);
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  context.marshallEntity(newValue,mediaType,os,sendLinks);
  ClientResponse response=webResource.type(mediaType).accept(mediaType).post(ClientResponse.class,os.toString());
  Status status=response.getClientResponseStatus();
  if (status != Status.OK) {
    throw new RestCallFailedException(status);
  }
  return response.getEntity(String.class);
}

Fixed version (ground truth):
/** 
 * Rest update bidirectional relationship.
 * @param context the context
 * @param objectId the object id
 * @param type the type
 * @param relationshipName the relationship name
 * @param newValue the new value
 * @param persistenceUnit the persistence unit
 * @param mediaType the media type
 * @param partner the partner
 * @param sendLinks the send links
 * @return the string
 * @throws RestCallFailedException the rest call failed exception
 * @throws URISyntaxException the uRI syntax exception
 * @throws JAXBException the jAXB exception
 */
public static String restUpdateBidirectionalRelationship(PersistenceContext context,String objectId,String type,String relationshipName,Object newValue,String persistenceUnit,MediaType mediaType,String partner,boolean sendLinks) throws RestCallFailedException, URISyntaxException, JAXBException {
  String url=RestUtils.getServerURI() + persistenceUnit + "String_Node_Str"+ type+ "String_Node_Str"+ objectId+ "String_Node_Str"+ relationshipName;
  if (partner != null) {
    url+="String_Node_Str" + MatrixParameters.JPARS_RELATIONSHIP_PARTNER + "String_Node_Str"+ partner;
  }
  WebResource webResource=client.resource(url);
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  context.marshallEntity(newValue,mediaType,os,sendLinks);
  ClientResponse response=webResource.type(mediaType).accept(mediaType).post(ClientResponse.class,os.toString());
  Status status=response.getClientResponseStatus();
  if (status != Status.OK) {
    throw new RestCallFailedException(status);
  }
  return response.getEntity(String.class);
}