KeyValueBlobTransientStore

Nuxeo Folks: KeyValueBlobTransientStore.getBlobs can return Collections.emptyList which you can't add to. However, SimpleTransientStore.getBlobs returns an ArrayList and so a unit test that expects to be able to add to the return value from getBlobs can pass, but then fail if deployed over a K/V transient store…

0 votes

1 answers

60 views

ANSWER



The Javadoc for TransientStore.getBlobs doesn't promise anything about mutability of the returned List, so you shouldn't assume that it's an ArrayList even though that's the case for the current implementation of SimpleTransientStore.

0 votes



True. It is a shortcoming of Java that interface contracts don't explicitly state mutability. Lacking that, programmers tend to interpret the contract to be: "what it did before"… Simple transient store and Redis transient store provided mutable lists, and the new kvbts does not, so…
12/14/2018