summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Su <dysu@google.com> 2020-01-27 14:41:16 -0800
committer David Su <dysu@google.com> 2020-01-27 14:41:16 -0800
commitab2c291b461f1daf3b196daae2a148a847c0feec (patch)
tree82adcbbb0b93e2848f25d8164b5486e12b64444b
parentbd9ff621380c0204cdfed57c8c3f01bd17c0df9e (diff)
CloseGuard: Fix JavaDoc code sample to use correct API
The code sample in the JavaDoc shows `CloseGuard.get()` to create a new CloseGuard, which is incorrect. The correct API is `new CloseGuard()`. Bug: 148291235 Test: compiles Change-Id: I1dd24fff150e671007b67c023b20e078557f2966
-rw-r--r--core/java/android/util/CloseGuard.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/util/CloseGuard.java b/core/java/android/util/CloseGuard.java
index 6ac769623bff..ba504a3b4167 100644
--- a/core/java/android/util/CloseGuard.java
+++ b/core/java/android/util/CloseGuard.java
@@ -26,7 +26,7 @@ import android.annotation.NonNull;
* A simple example: <pre> {@code
* class Foo {
*
- * private final CloseGuard guard = CloseGuard.get();
+ * private final CloseGuard guard = new CloseGuard();
*
* ...
*
@@ -64,7 +64,7 @@ import android.annotation.NonNull;
* be deferred. For example: <pre> {@code
* class Bar {
*
- * private final CloseGuard guard = CloseGuard.get();
+ * private final CloseGuard guard = new CloseGuard();
*
* ...
*