Program: 6044
Project: 6044
Buggy source:
/** 
 * Puts the user provided data in the secure store, if the user has write access to the namespace. Grants the user all access to the newly created entity.
 * @param secureKeyId The Id for the key that needs to be stored.
 * @param secureKeyCreateRequest The request containing the data to be stored in the secure store.
 * @throws BadRequestException If the request does not contain the value to be stored.
 * @throws UnauthorizedException If the user does not have write permissions on the namespace.
 * @throws NamespaceNotFoundException If the specified namespace does not exist.
 * @throws AlreadyExistsException If the key already exists in the namespace. Updating is not supported.
 * @throws IOException If there was a problem storing the key to underlying provider.
 */
@Override public synchronized void put(SecureKeyId secureKeyId,SecureKeyCreateRequest secureKeyCreateRequest) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  NamespaceId namespaceId=new NamespaceId(secureKeyId.getNamespace());
  authorizer.enforce(namespaceId,principal,Action.WRITE);
  String description=secureKeyCreateRequest.getDescription();
  String value=secureKeyCreateRequest.getData();
  if (Strings.isNullOrEmpty(value)) {
    throw new BadRequestException("String_Node_Str" + "String_Node_Str");
  }
  byte[] data=value.getBytes(StandardCharsets.UTF_8);
  secureStoreManager.putSecureData(secureKeyId.getNamespace(),secureKeyId.getName(),data,description,secureKeyCreateRequest.getProperties());
  authorizer.grant(secureKeyId,principal,ImmutableSet.of(Action.ALL));
}

Fixed version (ground truth):
/** 
 * Puts the user provided data in the secure store, if the user has write access to the namespace. Grants the user all access to the newly created entity.
 * @param secureKeyId The Id for the key that needs to be stored.
 * @param secureKeyCreateRequest The request containing the data to be stored in the secure store.
 * @throws BadRequestException If the request does not contain the value to be stored.
 * @throws UnauthorizedException If the user does not have write permissions on the namespace.
 * @throws NamespaceNotFoundException If the specified namespace does not exist.
 * @throws AlreadyExistsException If the key already exists in the namespace. Updating is not supported.
 * @throws IOException If there was a problem storing the key to underlying provider.
 */
@Override public synchronized void put(SecureKeyId secureKeyId,SecureKeyCreateRequest secureKeyCreateRequest) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  NamespaceId namespaceId=new NamespaceId(secureKeyId.getNamespace());
  authorizer.enforce(namespaceId,principal,Action.WRITE);
  String description=secureKeyCreateRequest.getDescription();
  String value=secureKeyCreateRequest.getData();
  if (Strings.isNullOrEmpty(value)) {
    throw new BadRequestException("String_Node_Str" + "String_Node_Str");
  }
  secureStoreManager.putSecureData(secureKeyId.getNamespace(),secureKeyId.getName(),value,description,secureKeyCreateRequest.getProperties());
  authorizer.grant(secureKeyId,principal,ImmutableSet.of(Action.ALL));
}