Hello, Jörg Thank You. I understand limitation of JSON itself.But while list often contains objects of same type and order is not always issue, order of read/writeObject is important. I tried jettison 1.2 and 1.0.1 but result was the same. For now we just removed our code which cause us problem during deserialization. If some legacy code will appear suppose we just use hotfix.
Thanks, Anatoly 2014-07-04 1:30 GMT+04:00 Jörg Schaible <joerg.schai...@gmx.de>: > Hi Anatoly, > > Анатолий Инсапов wrote: > > > Hello. > > > > My problem and reseach described there > > > http://stackoverflow.com/questions/24449238/xstream-changes-order-of-objects-in-write-readobject-with-json-serialization > > This is a behavior of Jettison's heuristics transforming XML into JSON. It > will collect values from sibling elements with same name and form an array. > Which version of Jettison are you using? Note, that only Jettison 1.2 pass > XStream's unit tests, the complete 1.3.x series is borked. > > > I suppose it is easer to read formatted text with syntax highlighting but > > I can copy content into mail if needed. I attach link to simplest patch > in > > comments - http://pastebin.com/n3qpRGHS . > > > > We use xStream 1.4.7. Is there way to fix it in 1.4.7(or 1.4.8)? > > Sorry, but there's not much we can do about it, the JSON heuristics has its > limits. See, you will get the same problem with this list: > > List<Object> list = new ArrayList<>(); > list.add("First"); > list.add(Integer.valueOf(2)); > list.add("3rd"); > list.add(Long.valueOf(4)); > > Therefore any element sequence with arbitrary types is affected. This > includes stuff explicitly written in writeObject() as well as Exernalizable > instances, and so on... > > Cheers, > Jörg > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > >