basho/riak-ruby-client — pull request #86 by seancribbs (2013-03-19 17:25:41+00:00)
Title: Protocol Buffers Client allows empty-string Keys

The Protocol Buffer Client allows users to create and fetch objects with a key value of "" (empty string):

```
require 'riak'
client = Riak::Client.new(:protocol => "pbc")

blank_key = client['test'].get_or_new('')
blank_key.data = [1,2,3,4,5]
blank_key.store
```

We can even fetch this empty key object with `client['test']['']` too.

The problem is that the Java Client throws an exception if we try to fetch an object with an empty key:
```
Exception in thread "main" com.basho.riak.client.RiakRetryFailedException: java.lang.IllegalArgumentException: Key cannot be null or empty or just whitespace
Caused by: java.lang.IllegalArgumentException: Key cannot be null or empty or just whitespace
at com.basho.riak.client.raw.pbc.PBClientAdapter.fetch(PBClientAdapter.java:155)
```

Using an empty string with any HTTP interfaces fails too, because it thinks you are fetching bucket properties: `curl -v http://riak-host/riak/test/`

The correct behavior would be to throw an exception if an empty string key is used.