accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <>
Subject [GitHub] accumulo pull request #125: ACCUMULO-4375 Add missing byte[]-based Key const...
Date Sun, 17 Jul 2016 14:04:36 GMT
Github user joshelser commented on a diff in the pull request:
    --- Diff: core/src/main/java/org/apache/accumulo/core/data/ ---
    @@ -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 or file a JIRA ticket
with INFRA.

View raw message