[ 
https://issues.apache.org/jira/browse/SDAP-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16479747#comment-16479747
 ] 

ASF GitHub Bot commented on SDAP-72:
------------------------------------

lewismc commented on a change in pull request #17: SDAP-72
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/17#discussion_r189106719
 
 

 ##########
 File path: core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
 ##########
 @@ -473,12 +474,20 @@ protected Client makeClient(Properties props) throws 
IOException {
 
     Client client = null;
 
-    // Prefer TransportClient
+    // Prefer to TransportClient
     if (hosts != null && port > 1) {
-      TransportClient transportClient = new ESTransportClient(settings);
-      for (String host : hosts)
-        transportClient.addTransportAddress(new 
InetSocketTransportAddress(InetAddress.getByName(host), port));
-      client = transportClient;
+      TransportClient transportClient = null;
+      try {
 
 Review comment:
   Use a 
[try-with-resources](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html)
 statement such that the client is closed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Solve bugs in file named ESDriver
> ---------------------------------
>
>                 Key: SDAP-72
>                 URL: https://issues.apache.org/jira/browse/SDAP-72
>             Project: Apache Science Data Analytics Platform
>          Issue Type: Bug
>          Components: mudrod
>            Reporter: Yun Li
>            Priority: Major
>             Fix For: 0.1
>
>
> Solve MUDROD bugs found by sonar coverage @[~lewismc] 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to