Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F1BE1200C74 for ; Sun, 14 May 2017 22:02:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F05EC160BB7; Sun, 14 May 2017 20:02:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 420F7160BA3 for ; Sun, 14 May 2017 22:02:35 +0200 (CEST) Received: (qmail 59320 invoked by uid 500); 14 May 2017 20:02:27 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 59310 invoked by uid 99); 14 May 2017 20:02:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 May 2017 20:02:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 003F31857B2 for ; Sun, 14 May 2017 20:02:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.296 X-Spam-Level: X-Spam-Status: No, score=-0.296 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id yIVpoRkazmSB for ; Sun, 14 May 2017 20:02:25 +0000 (UTC) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id B7FD35F520 for ; Sun, 14 May 2017 20:02:24 +0000 (UTC) Received: by mail-oi0-f43.google.com with SMTP id w10so110851115oif.0 for ; Sun, 14 May 2017 13:02:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=JimJ/rXA6LuuWJ2r+NCF1hhhZudCc1Wmhdc2MA6qufE=; b=DkRTFcx66Yx9mIEeT7bFbwosEnmCrK5tlmC0zv96XfXnE1sZJ1gnDY1LTNdPqIhs1n 8VWNv1TezSK1DzqqkrDrrzhlXNq5vNy5S5A2Wfn48SBbKAzgkYBW7m+wmD8fULlt9r7B +kMS+eR8Gpy9oYuXttUB5tKnyZraI8+TxkRX4z6cWT27CeP+myhjz6R9pxnd9RDCSHSg OE4ZfPcSuZLWeAEFImj3ECuRSGBCxBvJnKluOJRrrktNGOqhhihb0K7sRITsJ52r6zhK pIzffKndCro7Z6UuZX9nDqwQhIntQBkbLdnPUBzr1x/xJcRvbHsW6+WT8f1KcLJy4HA4 14Lw== X-Gm-Message-State: AODbwcD15zBAcwkjGUpiuVqhbZcRpBPuAgSpjuZTpXBp8DrljMF07OD6 UJG+GlvkhgX4BnSV8uQwab2QXUitkyYO X-Received: by 10.202.93.86 with SMTP id r83mr991928oib.195.1494792143384; Sun, 14 May 2017 13:02:23 -0700 (PDT) MIME-Version: 1.0 From: James Laverack Date: Sun, 14 May 2017 20:02:12 +0000 Message-ID: Subject: GROOVY-7979 and Index Overlay JSON parser behaviour To: dev@groovy.apache.org Content-Type: multipart/alternative; boundary="001a113d318eb834aa054f816ada" archived-at: Sun, 14 May 2017 20:02:36 -0000 --001a113d318eb834aa054f816ada Content-Type: text/plain; charset="UTF-8" Hi all, I'm interested in contributing to Groovy development, so I've taken a look at the bug tracker and taken up GROOVY-7979. Most of this is pretty straightforward, but I'm having a bit of difficulty with figuring out how the index overlay parsers (`INDEX_OVERLAY` and `LAX`) should behave. The ticket seems to imply that like the other parser implementations they should throw a JsonException when attempting to parse the string "[-]". But because the index overlay parser doesn't parse the value in the array until it's called for, simply doing `parser.parseText('[-]')` won't throw an exception whereas `parser.parseText('[-]')[0]` would. (With the fixes I've implemented to the number parsing code that fix the other parsers anyway.) Is it acceptable to have the lax parser behave like this and not throw the exception until the value is accessed, or should the implementation of `NumberValue` check for this case when it's created? Thanks, James Laverack --001a113d318eb834aa054f816ada Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I'm intereste= d in contributing to Groovy development, so I've taken a look at the bu= g tracker and taken up GROOVY-7979. Most of this is pretty straightforward,= but I'm having a bit of difficulty with figuring out how the index ove= rlay parsers (`INDEX_OVERLAY` and `LAX`) should behave.

The ticket s= eems to imply that like the other parser implementations they should throw = a JsonException when attempting to parse the string "[-]". But be= cause the index overlay parser doesn't parse the value in the array unt= il it's called for, simply doing `parser.parseText('[-]')` won&= #39;t throw an exception whereas `parser.parseText('[-]')[0]` would= . (With the fixes I've implemented to the number parsing code that fix = the other parsers anyway.)

Is it acceptable to have the lax pa= rser behave like this and not throw the exception until the value is access= ed, or should the implementation of `NumberValue` check for this case when = it's created?

Thanks,
James Laverack
--001a113d318eb834aa054f816ada--