commit | a13d25079ab4e79525f68c42f7108bbe59be0806 | [log] [tgz] |
---|---|---|
author | Mateus Azis <azis@google.com> | Thu May 25 08:44:38 2023 -0700 |
committer | Mateus Azis <azis@google.com> | Thu May 25 08:47:04 2023 -0700 |
tree | 922e7d0fcd487c1c140bb4afbc4dd81b7ca3b95c | |
parent | 77bd5cceabef5edaf626cbb444ce6b376a061e94 [diff] |
Use try-with-resources to ensure input stream gets closed. "new File" never returns null; a File object is created even if no file exists at that path. Using try-with-resources guarantees that the stream is closed even if an exception is thrown: go/java-practices/closing#try Test: m TeleService -j && atest TeleServiceTests --start-avd Bug: 274764512 Change-Id: I68d50bae2dd000170adbf1f7008bcd39a45c4fce