From ab2c291b461f1daf3b196daae2a148a847c0feec Mon Sep 17 00:00:00 2001 From: David Su Date: Mon, 27 Jan 2020 14:41:16 -0800 Subject: [PATCH] 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 --- core/java/android/util/CloseGuard.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/util/CloseGuard.java b/core/java/android/util/CloseGuard.java index 6ac769623bffc..ba504a3b4167c 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:
   {@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: 
   {@code
  *   class Bar {
  *
- *       private final CloseGuard guard = CloseGuard.get();
+ *       private final CloseGuard guard = new CloseGuard();
  *
  *       ...
  *