Skip to content

Commit 78a6f0d

Browse files
Ajit GeorgeAjit George
authored andcommitted
Cleanup on Apache DefaultHttpClient to prevent CLOSE_WAIT on port 8002
1 parent 8617c00 commit 78a6f0d

File tree

3 files changed

+451
-415
lines changed

3 files changed

+451
-415
lines changed

test-complete/src/test/java/com/marklogic/client/functionaltest/BasicJavaClientREST.java

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,31 +1453,26 @@ public String getDocumentCollectionsString(DocumentCollections collections)
14531453
public DocumentManager documentManagerSelector(DatabaseClient client, DocumentManager docMgr, String type)
14541454
{
14551455
// create doc manager
1456-
if(type == "XML")
1457-
{
1456+
switch(type) {
1457+
case "XML" :
14581458
docMgr = client.newXMLDocumentManager();
1459-
}
1460-
else if(type == "Text")
1461-
{
1459+
break;
1460+
case "Text" :
14621461
docMgr = client.newTextDocumentManager();
1463-
}
1464-
else if(type == "JSON")
1465-
{
1462+
break;
1463+
case "JSON" :
14661464
docMgr = client.newJSONDocumentManager();
1467-
}
1468-
else if(type == "Binary")
1469-
{
1465+
break;
1466+
case "Binary" :
14701467
docMgr = client.newBinaryDocumentManager();
1471-
}
1472-
else if (type == "JAXB") {
1468+
break;
1469+
case "JAXB" :
14731470
docMgr = client.newXMLDocumentManager();
1474-
}
1475-
else
1476-
{
1477-
1471+
break;
1472+
default :
14781473
System.out.println("Invalid type");
1479-
}
1480-
1474+
break;
1475+
}
14811476
return docMgr;
14821477
}
14831478

0 commit comments

Comments
 (0)