-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
We are using the following XML to JSON conversion in our code bases.
private JSONObject xmlToJson() throws Exception {
JSONObject jsonObj = null;
FileReader fr = new FileReader(benchmarkXmlFile); // Reads the XML file (data.xml)
jsonObj = XML.toJSONObject(fr); // Performs the conversion using org.json.XML
fr.close();
return jsonObj;
}
The XML file contains a bitmask
<ProcessAffinity>
<Ranks>
<Rank>0</Rank>
<Mask>1000000000000000000000000000000000000000000000000000</Mask>
</Ranks>
</ProcessAffinity>
This bit mask is converted to a floating point number in JSON, only if it has a leading "1" otherwise the conversion is valid:

javadev