basho/riak-java-client — pull request #114 by broach (2012-03-23 18:29:57+00:00)
Title: There was a bug in the HTTPClientConfig.Builder that was causing a probl...

There was a bug in the HTTPClientConfig.Builder that was causing a problem with creating a HTTPClusterClient

If you supplied an existing HTTPClientConfig to the builder it would copy the URL - at that point calling the
withPort() methods would not produce a change because having already set the URL took precedence.

A second problem was that even if you hadn't set the URL, calling build() did set it. This causes a problem if you were attempting to use the builder to construct multiple HTTPClients with different hosts and/or ports (as was the case with HTTPClusterClient) - you end up with all the HTTPClients having the same URL

I corrected this by parsing out the host and port from the URL if you passed in an existing config to the builder while at the same time not copying the URL. I also changed build() to not set the URL internally.

The HTTPClusterClient.addHosts() methods now work correctly.