Skip to content

Commit 8b0d007

Browse files
cpovirkGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
We're aware of the problem, and additional warnings for legacy usages aren't helping. RELNOTES=n/a PiperOrigin-RevId: 648819163
1 parent 3618043 commit 8b0d007

File tree

8 files changed

+16
-8
lines changed

8 files changed

+16
-8
lines changed

android/guava-testlib/src/com/google/common/testing/GcFinalization.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public static void await(CountDownLatch latch) {
229229
private static void createUnreachableLatchFinalizer(CountDownLatch latch) {
230230
Object unused =
231231
new Object() {
232-
@SuppressWarnings("removal") // b/260137033
232+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
233233
@Override
234234
protected void finalize() {
235235
latch.countDown();
@@ -301,7 +301,7 @@ public boolean isDone() {
301301
* @throws RuntimeException if timed out or interrupted while waiting
302302
* @since 12.0
303303
*/
304-
@SuppressWarnings("removal") // b/260137033
304+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
305305
public static void awaitFullGc() {
306306
CountDownLatch finalizerRan = new CountDownLatch(1);
307307
WeakReference<Object> ref =

android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public void testAwait_CountDownLatch() {
4646
final CountDownLatch latch = new CountDownLatch(1);
4747
Object unused =
4848
new Object() {
49+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
4950
@Override
5051
protected void finalize() {
5152
latch.countDown();
@@ -60,6 +61,7 @@ public void testAwaitDone_Future() {
6061
final SettableFuture<@Nullable Void> future = SettableFuture.create();
6162
Object unused =
6263
new Object() {
64+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
6365
@Override
6466
protected void finalize() {
6567
future.set(null);
@@ -75,6 +77,7 @@ public void testAwaitDone_Future_Cancel() {
7577
final SettableFuture<@Nullable Void> future = SettableFuture.create();
7678
Object unused =
7779
new Object() {
80+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
7881
@Override
7982
protected void finalize() {
8083
future.cancel(false);
@@ -215,6 +218,7 @@ public void testAwaitFullGc() {
215218
final WeakReference<Object> ref =
216219
new WeakReference<Object>(
217220
new Object() {
221+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
218222
@Override
219223
protected void finalize() {
220224
finalizerRan.countDown();

android/guava/src/com/google/common/io/FileBackedOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public InputStream openStream() throws IOException {
136136
return openInputStream();
137137
}
138138

139-
@SuppressWarnings("removal") // b/260137033
139+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
140140
@Override
141141
protected void finalize() {
142142
try {

android/guava/src/com/google/common/util/concurrent/ClosingFuture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@ public String toString() {
21242124
return toStringHelper(this).add("state", state.get()).addValue(future).toString();
21252125
}
21262126

2127-
@SuppressWarnings("removal") // b/260137033
2127+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
21282128
@Override
21292129
protected void finalize() {
21302130
if (state.get().equals(OPEN)) {

guava-testlib/src/com/google/common/testing/GcFinalization.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public static void await(CountDownLatch latch) {
229229
private static void createUnreachableLatchFinalizer(CountDownLatch latch) {
230230
Object unused =
231231
new Object() {
232-
@SuppressWarnings("removal") // b/260137033
232+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
233233
@Override
234234
protected void finalize() {
235235
latch.countDown();
@@ -301,7 +301,7 @@ public boolean isDone() {
301301
* @throws RuntimeException if timed out or interrupted while waiting
302302
* @since 12.0
303303
*/
304-
@SuppressWarnings("removal") // b/260137033
304+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
305305
public static void awaitFullGc() {
306306
CountDownLatch finalizerRan = new CountDownLatch(1);
307307
WeakReference<Object> ref =

guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public void testAwait_CountDownLatch() {
4646
final CountDownLatch latch = new CountDownLatch(1);
4747
Object unused =
4848
new Object() {
49+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
4950
@Override
5051
protected void finalize() {
5152
latch.countDown();
@@ -60,6 +61,7 @@ public void testAwaitDone_Future() {
6061
final SettableFuture<@Nullable Void> future = SettableFuture.create();
6162
Object unused =
6263
new Object() {
64+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
6365
@Override
6466
protected void finalize() {
6567
future.set(null);
@@ -75,6 +77,7 @@ public void testAwaitDone_Future_Cancel() {
7577
final SettableFuture<@Nullable Void> future = SettableFuture.create();
7678
Object unused =
7779
new Object() {
80+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
7881
@Override
7982
protected void finalize() {
8083
future.cancel(false);
@@ -215,6 +218,7 @@ public void testAwaitFullGc() {
215218
final WeakReference<Object> ref =
216219
new WeakReference<Object>(
217220
new Object() {
221+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
218222
@Override
219223
protected void finalize() {
220224
finalizerRan.countDown();

guava/src/com/google/common/io/FileBackedOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public InputStream openStream() throws IOException {
136136
return openInputStream();
137137
}
138138

139-
@SuppressWarnings("removal") // b/260137033
139+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
140140
@Override
141141
protected void finalize() {
142142
try {

guava/src/com/google/common/util/concurrent/ClosingFuture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2139,7 +2139,7 @@ public String toString() {
21392139
return toStringHelper(this).add("state", state.get()).addValue(future).toString();
21402140
}
21412141

2142-
@SuppressWarnings("removal") // b/260137033
2142+
@SuppressWarnings({"removal", "Finalize"}) // b/260137033
21432143
@Override
21442144
protected void finalize() {
21452145
if (state.get().equals(OPEN)) {

0 commit comments

Comments
 (0)