commit | 75eb42b914ed228c20f3b8af97ee452e1dcc9e2e | [log] [tgz] |
---|---|---|
author | Mateus Azis <azis@google.com> | Tue Apr 18 17:07:00 2023 -0700 |
committer | Mateus Azis <azis@google.com> | Tue Apr 18 17:09:55 2023 -0700 |
tree | 3b931439855d592a6dda71751761ff3660876620 | |
parent | a1355bc271fb4c20f879f5c75921c4f6f82a793b [diff] |
Use try-with-resources to avoid accidentaly leaking unclosed objects. Try-with-resources guarantees that objects will be closed even if an exception happens after their creation. It also handles nulls and avoids throwing NPE. Test: built and launched Cuttlefish. Change-Id: I80e767d1fbbca25a724bfe94e1752f88891a6bb0