Program: 79779
Project: 79779
Buggy source:
/** 
 * <p>Creates or updates a resource set description.</p> <p>If the request contains a If-Match header an update is performed, otherwise a create is performed.</p> <p>An update will replace the current description of the resource set with the contents of the request body.</p>
 * @param entity The new resource set description.
 * @return A JSON object containing the authorization server's unique id for the resource set and, optionally,a policy uri.
 * @throws NotFoundException If the requested resource set description does not exist.
 * @throws ServerException When an error occurs during creating or updating.
 * @throws BadRequestException If the request JSON is invalid.
 */
@Post public Representation createResourceSet(JsonRepresentation entity) throws NotFoundException, ServerException, BadRequestException {
  ResourceSetDescription resourceSetDescription=new ResourceSetDescription(null,getClientId(),getResourceOwnerId(),validator.validate(toMap(entity)));
  OAuth2Request oAuth2Request=requestFactory.create(getRequest());
  ResourceSetStore store=providerSettingsFactory.get(oAuth2Request).getResourceSetStore();
  try {
    store.create(oAuth2Request,resourceSetDescription);
    for (    ResourceSetRegistrationListener listener : listeners) {
      listener.resourceSetCreated(oAuth2Request.<String>getParameter("String_Node_Str"),resourceSetDescription);
    }
  }
 catch (  ServerException e) {
    throw e;
  }
catch (  BadRequestException e) {
    throw e;
  }
catch (  NotFoundException e) {
    throw e;
  }
  getResponse().setStatus(new Status(201));
  return createJsonResponse(resourceSetDescription,false,true);
}

Fixed version (ground truth):
/** 
 * <p>Creates or updates a resource set description.</p> <p>If the request contains a If-Match header an update is performed, otherwise a create is performed.</p> <p>An update will replace the current description of the resource set with the contents of the request body.</p>
 * @param entity The new resource set description.
 * @return A JSON object containing the authorization server's unique id for the resource set and, optionally,a policy uri.
 * @throws NotFoundException If the requested resource set description does not exist.
 * @throws ServerException When an error occurs during creating or updating.
 * @throws BadRequestException If the request JSON is invalid.
 */
@Post public Representation createResourceSet(JsonRepresentation entity) throws NotFoundException, ServerException, BadRequestException {
  ResourceSetDescription resourceSetDescription=new ResourceSetDescription(null,getClientId(),getResourceOwnerId(),validator.validate(toMap(entity)));
  OAuth2Request oAuth2Request=requestFactory.create(getRequest());
  ResourceSetStore store=providerSettingsFactory.get(oAuth2Request).getResourceSetStore();
  store.create(oAuth2Request,resourceSetDescription);
  for (  ResourceSetRegistrationListener listener : listeners) {
    listener.resourceSetCreated(oAuth2Request.<String>getParameter("String_Node_Str"),resourceSetDescription);
  }
  getResponse().setStatus(new Status(201));
  return createJsonResponse(resourceSetDescription,false,true);
}