You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2016/05/23 12:36:12 UTC
[jira] [Commented] (SLING-5549) Better handling for Double.NaN
[ https://issues.apache.org/jira/browse/SLING-5549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15296319#comment-15296319 ]
Bertrand Delacretaz commented on SLING-5549:
--------------------------------------------
I have removed the Commons JSON 2.0.18 fix version on this ticket as it looks like it is only at the discussion stage and I'm planning to release that module.
> Better handling for Double.NaN
> ------------------------------
>
> Key: SLING-5549
> URL: https://issues.apache.org/jira/browse/SLING-5549
> Project: Sling
> Issue Type: Improvement
> Components: Extensions
> Reporter: Chetan Mehrotra
> Priority: Minor
> Fix For: JMX Resource Provider 1.0.4
>
>
> Its possible that some JMX attribute results in Double.NaN which causes issue with JSON rendition
> {noformat}
> org.apache.sling.commons.json.JSONException: JSON does not allow
> non-finite numbers
> at org.apache.sling.commons.json.io.JSONRenderer.testNumberValidity(JSONRenderer.java:483)
> at org.apache.sling.commons.json.JSONObject.testValidity(JSONObject.java:912)
> at org.apache.sling.commons.json.JSONObject.put(JSONObject.java:856)
> at org.apache.sling.commons.json.sling.JsonObjectCreator.createProperty(JsonObjectCreator.java:206)
> at org.apache.sling.commons.json.sling.JsonObjectCreator.create(JsonObjectCreator.java:94)
> at org.apache.sling.commons.json.sling.JsonObjectCreator.create(JsonObjectCreator.java:48)
> at org.apache.sling.commons.json.sling.ResourceTraversor.adapt(ResourceTraversor.java:141)
> at org.apache.sling.commons.json.sling.ResourceTraversor.collectResource(ResourceTraversor.java:128)
> at org.apache.sling.commons.json.sling.ResourceTraversor.collectChildren(ResourceTraversor.java:99)
> at org.apache.sling.commons.json.sling.ResourceTraversor.collectResources(ResourceTraversor.java:76)
> at org.apache.sling.servlets.get.impl.helpers.JsonRendererServlet.doGet(JsonRendererServlet.java:100)
> {noformat}
> As a fix we should
> # Skip such properties in JSON renderer
> # Skip such attributes in JMX Resource ValueMap
> See http://markmail.org/thread/ybuaioecpiuqupjo
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)