Skip to content

Commit

Permalink
Address [StaticQualifiedUsingExpression](https://errorprone.info/bugp…
Browse files Browse the repository at this point in the history
…attern/StaticQualifiedUsingExpression) and [ExtendsObject](https://errorprone.info/bugpattern/ExtendsObject) warnings.

RELNOTES=n/a
PiperOrigin-RevId: 686893871
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Oct 17, 2024
1 parent 2212495 commit dc423d2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,16 @@ private static class WithTypeVariable {
@SuppressWarnings("unused")
<T> void withoutBound(List<T> list) {}

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

@SuppressWarnings("unused")
Expand Down
11 changes: 10 additions & 1 deletion guava-tests/test/com/google/common/reflect/TypesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,16 @@ private static class WithTypeVariable {
@SuppressWarnings("unused")
<T> void withoutBound(List<T> list) {}

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

@SuppressWarnings("unused")
Expand Down

0 comments on commit dc423d2

Please sign in to comment.