Skip to content

Commit

Permalink
Move @CheckReturnValue from methods to class scope (#2379)
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenelesnov committed Aug 2, 2021
1 parent 5891de1 commit f32973d
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 65 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/mockito/ArgumentCaptor.java
Expand Up @@ -59,6 +59,7 @@
* @see Captor
* @since 1.8.0
*/
@CheckReturnValue
public class ArgumentCaptor<T> {

private final CapturingMatcher<T> capturingMatcher = new CapturingMatcher<T>();
Expand All @@ -79,7 +80,7 @@ private ArgumentCaptor(Class<? extends T> clazz) {
* @return null or default values
*/
public T capture() {
Mockito.argThat(capturingMatcher);
T ignored = Mockito.argThat(capturingMatcher);
return defaultValue(clazz);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/mockito/ArgumentMatchers.java
Expand Up @@ -112,6 +112,7 @@
*
* @see AdditionalMatchers
*/
@CheckReturnValue
@SuppressWarnings("unchecked")
public class ArgumentMatchers {

Expand Down Expand Up @@ -258,7 +259,7 @@ public static <T> T isA(Class<T> type) {
*/
@Deprecated
public static <T> T anyVararg() {
any();
Object ignored = any();
return null;
}

Expand Down

0 comments on commit f32973d

Please sign in to comment.