diff options
author | Brian Carlstrom <bdc@google.com> | 2015-03-10 05:36:57 +0000 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2015-03-10 05:36:57 +0000 |
commit | ec662a709ad6d45e19d23f2ae357fad96a766c69 (patch) | |
tree | 2e16d3a26438e9e7e25635a92e1ffa221d71fda9 /dalvik/src | |
parent | 9a36fbb0df656b18a47048b7d49c09d129f8fcbb (diff) | |
download | libcore-ec662a709ad6d45e19d23f2ae357fad96a766c69.zip libcore-ec662a709ad6d45e19d23f2ae357fad96a766c69.tar.gz libcore-ec662a709ad6d45e19d23f2ae357fad96a766c69.tar.bz2 |
Revert "Remove unnecessary null checks in CloseGuard documentation sample code"
This reverts commit 9a36fbb0df656b18a47048b7d49c09d129f8fcbb.
Change-Id: I31f38d46daf7cd28f0d9babd200ee093928c0766
Diffstat (limited to 'dalvik/src')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/CloseGuard.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dalvik/src/main/java/dalvik/system/CloseGuard.java b/dalvik/src/main/java/dalvik/system/CloseGuard.java index 0301e50..df36867 100644 --- a/dalvik/src/main/java/dalvik/system/CloseGuard.java +++ b/dalvik/src/main/java/dalvik/system/CloseGuard.java @@ -40,7 +40,9 @@ package dalvik.system; * * protected void finalize() throws Throwable { * try { - * guard.warnIfOpen(); + * if (guard != null) { + * guard.warnIfOpen(); + * } * cleanup(); * } finally { * super.finalize(); @@ -74,7 +76,9 @@ package dalvik.system; * * protected void finalize() throws Throwable { * try { - * guard.warnIfOpen(); + * if (guard != null) { + * guard.warnIfOpen(); + * } * cleanup(); * } finally { * super.finalize(); |