Skip to content

Commit dc423d2

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
RELNOTES=n/a PiperOrigin-RevId: 686893871
1 parent 2212495 commit dc423d2

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

android/guava-tests/test/com/google/common/reflect/TypesTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,16 @@ private static class WithTypeVariable {
257257
@SuppressWarnings("unused")
258258
<T> void withoutBound(List<T> list) {}
259259

260-
@SuppressWarnings("unused")
260+
@SuppressWarnings({
261+
"unused",
262+
/*
263+
* Since reflection can't tell the difference between <T> and <T extends Object>, it doesn't
264+
* make a ton of sense to have a separate tests for each. But having tests for each doesn't
265+
* really hurt anything, and maybe it will serve a purpose in a future in which Java has a
266+
* built-in nullness feature?
267+
*/
268+
"ExtendsObject",
269+
})
261270
<T extends Object> void withObjectBound(List<T> list) {}
262271

263272
@SuppressWarnings("unused")

guava-tests/test/com/google/common/reflect/TypesTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,16 @@ private static class WithTypeVariable {
257257
@SuppressWarnings("unused")
258258
<T> void withoutBound(List<T> list) {}
259259

260-
@SuppressWarnings("unused")
260+
@SuppressWarnings({
261+
"unused",
262+
/*
263+
* Since reflection can't tell the difference between <T> and <T extends Object>, it doesn't
264+
* make a ton of sense to have a separate tests for each. But having tests for each doesn't
265+
* really hurt anything, and maybe it will serve a purpose in a future in which Java has a
266+
* built-in nullness feature?
267+
*/
268+
"ExtendsObject",
269+
})
261270
<T extends Object> void withObjectBound(List<T> list) {}
262271

263272
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)