Please see [1], I've just uploaded a slightly refactored patch, named
json-collections.patch.
Can you please look at it ? Just something minor is missing, I can get to it
later on, but if you can apply it to the latest code and see where the
missing bit is then may be we can close [1] :-)


I have fixed something in MappedXMLStreamReader, in the constructor:

this.node = new Node(null, rootName, obj, convention);

instead of

this.node = new Node(null, rootName, ((JSONArray)top).getJSONObject(0), convention);

So the old implementation just not read the array items with index>0.

Also after the line ..

nextKey = node.getName().getLocalPart();

.. I inserted following:

if (!"".equals(node.getName().getNamespaceURI()))
nextKey = this.convention.getPrefix(node.getName().getNamespaceURI()) + "." + nextKey;
                                
So actually to qualify "nextKey" if there is namespace info. This is required for testReadQualifiedCollection() as it uses the qualified name "ns1.thetag". When not augmenting with this qualification, the collection component type just cannot be resolved, resulting that a generic ElementNSImpl instead of the collection component type is instantiated.

So with these two changes, all tests of JSONProviderTest run,
and also all of mine tests (I do not use any explicite namespaces or qualified JSON attribute names).

Sergey , can you check-in these changes?

Cheers,
Joerg

Reply via email to