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

        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



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source