You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/27 02:10:12 UTC
[jira] [Commented] (GROOVY-7728) LAX parser: Commenting out key/val
pairs doesn't work
[ https://issues.apache.org/jira/browse/GROOVY-7728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15259238#comment-15259238 ]
ASF GitHub Bot commented on GROOVY-7728:
----------------------------------------
GitHub user jwagenleitner opened a pull request:
https://github.com/apache/groovy/pull/322
GROOVY-7728 - LAX parser: Commenting out key/val pairs doesn't work
Changed loop to process comments and end of object marker after processing
key/values because skipWhitespace leaves the cursor on the first
non-whitespace character and that character needs to be processed before
the loop increments the index counter. This same logic is used by
JsonFastParser#decodeJsonObjectLazyFinalParse.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jwagenleitner/groovy GROOVY-7728
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/322.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #322
----
commit af3800f4f6534e0771b624b7d8bc99bd2d0f6a93
Author: John Wagenleitner <jw...@apache.org>
Date: 2016-04-27T00:07:45Z
GROOVY-7728 - LAX parser: Commenting out key/val pairs doesn't work
Changed loop to process comments and end of object marker after processing
key/values because skipWhitespace leaves the cursor on the first
non-whitespace character and that character needs to be processed before
the loop increments the index counter. This same logic is used by
JsonFastParser#decodeJsonObjectLazyFinalParse.
----
> LAX parser: Commenting out key/val pairs doesn't work
> ------------------------------------------------------
>
> Key: GROOVY-7728
> URL: https://issues.apache.org/jira/browse/GROOVY-7728
> Project: Groovy
> Issue Type: Bug
> Components: JSON
> Affects Versions: 2.4.5
> Environment: Linux OpenJDK 7 (java version "1.7.0_91")
> Reporter: Stephen Olander-Waters
> Priority: Minor
>
> This is in regards to {{JsonParserType.LAX}}. I'm calling it with this code:
> {code}
> def slurpOpts = new JsonSlurper().setType(JsonParserType.LAX).parse(new File(ConfigFileName))
> slurpOpts.each {k, v -> myOpts.put(k, slurpOpts.get(k))}
> {code}
> Here is my JSON. {{appUserId}} is parsed but it should be commented out. The key {{baseFolderName}} is correctly commented out.
> {code}
> {
> "enterpriseDomain": "@example.com"
> ,"enterpriseId": "123456"
> ,"clientId": "abcdefghijklmnopqrstuvwxyz123456"
> ,"clientSecret": "abcdefghijklmnopqrstuvwxyz123456"
> ,"keyId": "12345678"
> ,"keyFileName": "/etc/PrintToBox/PrintToBox_private_key.pem"
> ,"keyPassword": "12345678901234567890"
> // ,"appUserId": "123456789"
> // Optional parameters with defaults shown
> // ,"baseFolderName": "PrintToBox"
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)