Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 628901800F for ; Fri, 12 Jun 2015 06:20:02 +0000 (UTC) Received: (qmail 31215 invoked by uid 500); 12 Jun 2015 06:20:02 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 31170 invoked by uid 500); 12 Jun 2015 06:20:02 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 31158 invoked by uid 99); 12 Jun 2015 06:20:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2015 06:20:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DF43BDFFD5; Fri, 12 Jun 2015 06:20:01 +0000 (UTC) From: dhutchis To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request: Fix precondition check in AbstractEncoder. Content-Type: text/plain Message-Id: <20150612062001.DF43BDFFD5@git1-us-west.apache.org> Date: Fri, 12 Jun 2015 06:20:01 +0000 (UTC) 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 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. ---