You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Method Signature as proposed in SWS-361 is insufficient. It it really buggy. Because it is a Map (that has unique keys), you can not add two collections with the same name, even if thy are part of different classes:
If configured so, only "theCollection" in "OtherClass" will be implicit, because it "overrides" "theCollection" from "TheClass".
I like to propose to deprecate the method and add on with a slightly different signature. It should take a Collection of Strings with the fully qualified name of the Collection. XStreamMarshaller.setImplicitCollections(Collection<String>)
<property name="implicitCollections">
<set>
<value>package.TheClass.theCollection</value>
<value>package.OtherClass.theCollection</value>
</set>
</property>
By the way: Shouldn't it be "implicitCollections" (plural?).
Fixed: there is now a setImplicitCollections (plural), which takes a Map of classes mapping to comma-separated field names. There was nothing wrong with your suggested solution, but this is simply more in line with the omittedFields property, which already used a similar format.
Jörg Gottschling opened SPR-5449 and commented
The Method Signature as proposed in SWS-361 is insufficient. It it really buggy. Because it is a Map (that has unique keys), you can not add two collections with the same name, even if thy are part of different classes:
<property name="implicitCollection">
<map>
<entry key="theCollection" value="package.TheClass" />
<entry key="theCollection" value="package.OtherClass" />
</map>
</property>
If configured so, only "theCollection" in "OtherClass" will be implicit, because it "overrides" "theCollection" from "TheClass".
I like to propose to deprecate the method and add on with a slightly different signature. It should take a Collection of Strings with the fully qualified name of the Collection. XStreamMarshaller.setImplicitCollections(Collection<String>)
<property name="implicitCollections">
<set>
<value>package.TheClass.theCollection</value>
<value>package.OtherClass.theCollection</value>
</set>
</property>
By the way: Shouldn't it be "implicitCollections" (plural?).
Referenced from: commits 03f3bf0
The text was updated successfully, but these errors were encountered: