accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhutchis <...@git.apache.org>
Subject [GitHub] accumulo pull request: Fix precondition check in AbstractEncoder.
Date Fri, 12 Jun 2015 06:20:01 GMT
Github user dhutchis commented on the pull request:

    https://github.com/apache/accumulo/pull/36#issuecomment-111376105
  
    Apparently this isn't as simple a fix as I thought.  Why is it supposed to fail in this
case?
    ```java
    try {
          lexicoder.decode(encoded, encoded.length, 0);
          fail("Should throw on offset==length.");
        } catch (IllegalArgumentException e) {}
    ```
    
    Here is my use case:
    ```java
    @Test
      public void testAbstractEncoderDecode() {
        AbstractEncoder<Long> encoder = new LongCombiner.StringEncoder();
        byte[] bytes = "a334".getBytes();
        Assert.assertEquals(334, encoder.decode(bytes, 1, 3).longValue());
      }
    ```
    
    Will have to look further into the tests.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message