accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Havanki (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-2487) Value implementation provides conflicting statements
Date Mon, 17 Mar 2014 20:32:45 GMT


Bill Havanki commented on ACCUMULO-2487:

I'm also +1 for 1.6.0. However, I disagree with Sean and would prefer the implementation remain
as it is, and fix the Javadoc. Two reasons:

# It's typical to make a {{new Value()}} and then call {{readFields()}} on it, which blows
away the previous byte array. We would be wasting an array allocation by changing the behavior.
# You can already make a zero-size sequence with {{new Value(new byte\[0])}}.

> Value implementation provides conflicting statements
> ----------------------------------------------------
>                 Key: ACCUMULO-2487
>                 URL:
>             Project: Accumulo
>          Issue Type: Bug
>          Components: client
>            Reporter: Mike Drob
>            Priority: Critical
>             Fix For: 1.7.0
> The javadoc for the no-arg constructor for {{Value}} states that it "Creates a zero-size
sequence." However, the implementation of get will error in this case.
> {code}
> public byte[] get() {
>     if (this.value == null) {
>       throw new IllegalStateException("Uninitialized. Null constructor " + "called w/o
accompanying readFields invocation");
>     }
> {code}
> Either we need to change the javadoc to be more explicit or change the behaviour of various
accessors in the class. I would consider both solutions to be breaking of the API contract
since we are changing what clients can expect from us.

This message was sent by Atlassian JIRA

View raw message