Skip to content

READY: Settable Default Charset#550

Merged
alexmoore merged 9 commits intodevelopfrom
CLIENTS-547
Sep 25, 2015
Merged

READY: Settable Default Charset#550
alexmoore merged 9 commits intodevelopfrom
CLIENTS-547

Conversation

@alexmoore
Copy link
Contributor

This is from a customer request (JIRA CLIENTS-547), to have a settable default charset. Currently it's set to the JRE's default, which can change from machine to machine.

You can set it from the static set() method on the DefaultCharset class, or from the command line by providing the charset name with the arg com.basho.riak.client.DefaultCharset. (e.g. java -Dcom.basho.riak.client.DefaultCharset="UTF-8" ...)

Rendered Javadocs:
defaultcharset__riak_client_for_java_2_0_3-snapshot_api_

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (

This happens in several places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens several places? I only see one if :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢 if (

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we want to freeze the observable behavior, here is no needs to check internal state. better to verify as:

        assertEquals(systemDefault.name(), DefaultCharset.get().name());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we're just testing/calling the initializer method b/c the charset for that class is static final, so we can't change it unless we restart the VM. Testing the initializer function should test everything except the actual assignment to the static final "singleton" variable.

alexmoore added a commit that referenced this pull request Sep 25, 2015
READY: Settable Default Charset
@alexmoore alexmoore merged commit 3d96645 into develop Sep 25, 2015
@alexmoore alexmoore deleted the CLIENTS-547 branch September 25, 2015 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants