SOLR-7130: remove the special entry from response after reading, so that tests don't see them

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1662554 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-02-26 19:53:17 +00:00
parent 925ad53f97
commit 63a6080c82
1 changed files with 3 additions and 0 deletions

View File

@ -807,8 +807,11 @@ public class CloudSolrClient extends SolrClient {
NamedList<Object> resp = null;
try {
resp = sendRequest(request);
//to avoid an O(n) operation we always add STATE_VERSION to the last and try to read it from there
Object o = resp.get(STATE_VERSION, resp.size()-1);
if(o != null && o instanceof Map) {
//remove this because no one else needs this and tests would fail if they are comparing responses
resp.remove(resp.size()-1);
Map invalidStates = (Map) o;
for (Object invalidEntries : invalidStates.entrySet()) {
Map.Entry e = (Map.Entry) invalidEntries;