google / physical-web

The Physical Web: walk up and use anything
http://physical-web.org
Apache License 2.0
6k stars 667 forks source link

The resource was closed incorrectly #955

Open QiAnXinCodeSafe opened 5 years ago

QiAnXinCodeSafe commented 5 years ago

The code may throw an exception before the resource is closed,you should use try-catch-finally or try-with-resource to close resource https://github.com/google/physical-web/blob/12604319e99b6d6dff451fc5a58a13a271f1dc7a/java/libs/src/main/java/org/physical_web/collection/JsonObjectRequest.java#L63-L65 https://github.com/google/physical-web/blob/12604319e99b6d6dff451fc5a58a13a271f1dc7a/android/PhysicalWeb/app/src/main/java/org/physical_web/physicalweb/Utils.java#L1169-L1181 The resource is not closed https://github.com/google/physical-web/blob/12604319e99b6d6dff451fc5a58a13a271f1dc7a/java/libs/src/main/java/org/physical_web/collection/Request.java#L81-L88