Details
Description
The JsonSlurper LAX parser parses an invalid number incorrectly:
Example.java
import groovy.json.* def obj = new JsonSlurper().setType(JsonParserType.LAX).parseText('{ "num": 1a}') println "1a: num = ${obj.num}" println "1a: type is " + obj.num.class.name obj = new JsonSlurper().setType(JsonParserType.LAX).parseText('{ "num": 1A}') println "1A: num = ${obj.num}" println "1A: type is " + obj.num.class.name
produces:
1a: num = 59
1a: type is java.lang.Integer
1A: num = 27
1A: type is java.lang.Integer
It seems like the parser should fail this as an invalid number, though one could argue the LAX parser could interpret it as hex 1a, but neither is being done. Valid numbers are of course parsed correctly.