Please make sure your issue is not addressed in the FAQ.
Please include the following information:
[x] The version of infer from infer --version.
Infer v1.1.0
[x] Your operating system and version, for example "Debian 9", "MacOS High Sierra", whether you are using Docker, etc.
Ubuntu 20.04
[x] Which command you ran, for example infer -- make.
infer -- javac javacheck/HttpURLConnectionTest.java
[x] The full output in a paste, for instance a gist.
Please attention, ;the javax.net.ssl.HttpsURLConnection extends java.net.HttpURLConnection extends java.net.URLConnection, all they itself have no close() method.
javacheck/HttpURLConnectionTest.java:18: error: Resource Leak
resource of type javax.net.ssl.HttpsURLConnection acquired by call to openConnection() at line 13 is not released after line 18.
return conn;
} else {
System.out.println("url open connection is not HttpURLConnection");
// Logger.error(TAG, "url open connection is not HttpURLConnection");
throw new IOException();
Found 1 issue
Issue Type(ISSUED_TYPE_ID): #
Resource Leak(RESOURCE_LEAK): 1
[x] If possible, a minimal example to reproduce your problem (for instance, some code where
infer reports incorrectly, together with the way you run infer to reproduce the incorrect
report).
Please make sure your issue is not addressed in the FAQ.
Please include the following information:
infer --version
. Infer v1.1.0infer -- make
. infer -- javac javacheck/HttpURLConnectionTest.javaclose()
method.javacheck/HttpURLConnectionTest.java:18: error: Resource Leak resource of type
javax.net.ssl.HttpsURLConnection
acquired by call toopenConnection()
at line 13 is not released after line 18.Found 1 issue Issue Type(ISSUED_TYPE_ID): # Resource Leak(RESOURCE_LEAK): 1
// import androidx.annotation.NonNull;
import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection;
class HttpURLConnectionTest {
}