Sonar Issue-HttpClient instances should always have socket and connect timeouts

133 Views Asked by At
        URLConnection conn = url.openConnection();
        conn.connect();

For this piece of code Sonar is throwing HttpClient instances should always have socket and connect timeouts

    HttpClient httpclient = HttpClientBuilder.create().useSystemProperties().build();
    HttpPost httpPost = new HttpPost(apiEndPoint);

For this piece of code as well sonar is stating HttpClient instances should always have socket and connect timeouts

Need help in understanding the resolution and why is this happening

0

There are 0 best solutions below