-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Honor Systems generated updates. Closes #296.
- Loading branch information
1 parent
eb21c8d
commit cf61d54
Showing
19 changed files
with
51 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cf61d54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In JettisonStaxWriter.java under com.thoughtworks.xstream.io.json package in xstream 1.4.19 version, there is a method startNode( ) defined with following (whole startNode( ) method section) logic, however I couldn't trace one particular change within this method. I verified till old history commits(10 yrs ago), but I dont see below change(No trace for below change section), only I could see is it was calling deprecated method in old commits ((AbstractXMLStreamWriter)out).seriliazeAsArray(key); and in recent updates it was completely removed(as in this current commit). All I want know is why there is check if(!JVM.is15()) for getSerializedAsArrays(), so I wanted to check history commits but couldnt find any for this change. Anyhelp is appreciated .
No trace for below change:
Whole startNode( ) method
cf61d54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is executed in XStream 1.4.19 if you run it with Java 1.4 and Jettison 1.0.1. It was removed on the master branch, since Java 1.4 is no longer supported as runtime environment.
cf61d54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @joehni , May I know if there is any issue if we execute the block (!JVM.is15()) in higher version like Java 8 or above(we can comment this if condition). We have dependency with "serializedAsArrays" content, we need put an arraylist element in serializedAsArrays and based on its presence we determine data type of its sub element.
For example (expected):
"factProperties":{"factProperty":[{"name":"offerCallBack","description":"","type":"JAVA_CLASS","javaClass":"java.lang.Boolean","sensitive":false},{"name":"test6","description":"","type":"STRING","sensitive":false},{"name":"test8","description":"","type":"STRING","sensitive":false}]}
Example description: We need to put "factProperties" in serializedArrays(dataType is ArrayList), and based on its presence in serializedAsArrays we determine its subelement ''factProperty'' dataType as ''array'' otherwise it will be treated as plain Obejct. Since in xstream .19 it comes under with condition (!JVM.is15()), we couldnt put it in serializedArrays as we use Java 8, we can remove (!JVM.is15()) condition in our implementation, but would want to know why this condition is particularly specified for executing this block in lower java(1.4)env, any harm if we execute in higher environment ?
cf61d54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that block is required for Jettison 1.0.1. For all support Jettison versions it is not required, because the implementation of the JettisonStaxDriver keeps track of types that are JSON lists (see usage of "stack" in startNode/endNode). Mapping of XML to JSON is not possible 1:1 and Jettison uses some heuristics to detect JSON arrays simply derived from the structure of the processed XML. XStream's driver implementation is tweaked to allow deserialization in a lot of cases - see the JettisonStaxDriverTest of the 1.4.x branch about the differences in the JSON format Jettison produces with its heuristic. Since Jettison 1.4.1 you'll need an additional configuration setting (see code in master branch), Jettison 1.2.1 to 1.4.0 (inclusive) won't work at all properly. If you modify something, run the unit tests against it to see what corner case you're failing then.