[
https://issues.apache.org/jira/browse/SOLR-12959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16676003#comment-16676003
]
Noble Paul commented on SOLR-12959:
-----------------------------------
* In code {{SimpleOrderedMap}} is exactly same as {{NamedList}}
* In javabin or XML or any other format , {{SimpleOrderedMap}} is exactly the
same
* In {{JSON}} response, the default behavior for both {{NamedList}} and
{{SimpleOrderedMap}} are serialized exactly same way
* When we choose the {{namedListStyle}} to be something else ,
{{SimpleOrderedMap}} is serialized as {{JSON_NL_MAP}} .
The following is the code for serializing {{NaMedList}} / {{SimpleOrderedMap}}
{code:java}
default void writeNamedList(String name, NamedList val) throws IOException {
String namedListStyle = getNamedListStyle();
if (val instanceof SimpleOrderedMap) {
writeNamedListAsMapWithDups(name, val);
} else if (namedListStyle == JSON_NL_FLAT) {
writeNamedListAsFlat(name, val);
} else if (namedListStyle == JSON_NL_MAP) {
writeNamedListAsMapWithDups(name, val);
} else if (namedListStyle == JSON_NL_ARROFARR) {
writeNamedListAsArrArr(name, val);
} else if (namedListStyle == JSON_NL_ARROFMAP) {
writeNamedListAsArrMap(name, val);
} else if (namedListStyle == JSON_NL_ARROFNTV) {
throw new UnsupportedOperationException(namedListStyle
+ " namedListStyle must only be used with
ArrayOfNameTypeValueJSONWriter");
}
}
{code}
So , again, what's the feature that we want to preserve here? If we
replace{{SimpleOrderedMap}} with a {{LinkedHashMap}} , we get exactly the
same behavior as we get today.
> Deprecate solrj SimpleOrderedMap
> --------------------------------
>
> Key: SOLR-12959
> URL: https://issues.apache.org/jira/browse/SOLR-12959
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: SolrJ
> Reporter: Noble Paul
> Priority: Minor
>
> There is no difference between a NamedList and a SumpleOrderedMap. It
> doesn't help to have both of them when they are doing exactly free same things
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]