Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/125#discussion_r71082922
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/data/Key.java ---
    @@ -103,7 +103,18 @@ public Key() {
        *          row ID
        */
       public Key(Text row) {
    -    init(row.getBytes(), 0, row.getLength(), EMPTY_BYTES, 0, 0, 
EMPTY_BYTES, 0, 0, EMPTY_BYTES, 0, 0, Long.MAX_VALUE, false, true);
    +    this(row.getBytes());
    --- End diff --
    
    This is wrong. `Text.getBytes()` will return the backing array for the 
`Text` object, but the contents of the data in the `Text` object may be less 
than the length of the array. Make sure you use the initial position of `0` and 
a length of `Text.getLength()`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to