Program: 64207
Project: 64207
Buggy source:
/** 
 * Rest remove bidirectional relationship.
 * @param context the context
 * @param objectId the object id
 * @param type the type
 * @param relationshipName the relationship name
 * @param persistenceUnit the persistence unit
 * @param mediaType the media type
 * @param partner the partner
 * @param listItemId the list item id
 * @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 restRemoveBidirectionalRelationship(String objectId,String type,String relationshipName,String persistenceUnit,MediaType mediaType,String partner,String listItemId) 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;
    if (listItemId != null) {
      url+="String_Node_Str" + QueryParameters.JPARS_LIST_ITEM_ID + "String_Node_Str"+ listItemId;
    }
  }
 else {
    if (listItemId != null) {
      url+="String_Node_Str" + QueryParameters.JPARS_LIST_ITEM_ID + "String_Node_Str"+ listItemId;
    }
  }
  WebResource webResource=client.resource(url);
  ClientResponse response=webResource.type(mediaType).accept(mediaType).delete(ClientResponse.class);
  Status status=response.getClientResponseStatus();
  if (status != Status.OK) {
    throw new RestCallFailedException(status);
  }
  String result=response.getEntity(String.class);
  return result;
}

Fixed version (ground truth):
/** 
 * Rest remove bidirectional relationship.
 * @param context the context
 * @param objectId the object id
 * @param type the type
 * @param relationshipName the relationship name
 * @param persistenceUnit the persistence unit
 * @param mediaType the media type
 * @param partner the partner
 * @param listItemId the list item id
 * @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 restRemoveBidirectionalRelationship(String objectId,String type,String relationshipName,String persistenceUnit,MediaType mediaType,String partner,String listItemId) 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" + QueryParameters.JPARS_RELATIONSHIP_PARTNER + "String_Node_Str"+ partner;
    if (listItemId != null) {
      url+="String_Node_Str" + QueryParameters.JPARS_LIST_ITEM_ID + "String_Node_Str"+ listItemId;
    }
  }
 else {
    if (listItemId != null) {
      url+="String_Node_Str" + QueryParameters.JPARS_LIST_ITEM_ID + "String_Node_Str"+ listItemId;
    }
  }
  WebResource webResource=client.resource(url);
  ClientResponse response=webResource.type(mediaType).accept(mediaType).delete(ClientResponse.class);
  Status status=response.getClientResponseStatus();
  if (status != Status.OK) {
    throw new RestCallFailedException(status);
  }
  String result=response.getEntity(String.class);
  return result;
}