8000 Move @CheckReturnValue from methods to class scope (#2379) · mockito/mockito@f32973d · GitHub
[go: up one dir, main page]

Skip to content

Commit f32973d

Browse files
authored
Move @CheckReturnValue from methods to class scope (#2379)
1 parent 5891de1 commit f32973d

File tree

10 files changed

+25
-65
lines changed

10 files changed

+25
-65
lines changed

src/main/java/org/mockito/ArgumentCaptor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
* @see Captor
6060
* @since 1.8.0
6161
*/
62+
@CheckReturnValue
6263
public class ArgumentCaptor<T> {
6364

6465
private final CapturingMatcher<T> capturingMatcher = new CapturingMatcher<T>();
@@ -79,7 +80,7 @@ private ArgumentCaptor(Class<? extends T> clazz) {
7980
* @return null or default values
8081
*/
8182
public T capture() {
82-
Mockito.argThat(capturingMatcher);
83+
T ignored = Mockito.argThat(capturingMatcher);
8384
return defaultValue(clazz);
8485
}
8586

src/main/java/org/mockito/ArgumentMatchers.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
*
113113
* @see AdditionalMatchers
114114
*/
115+
@CheckReturnValue
115116
@SuppressWarnings("unchecked")
116117
public class ArgumentMatchers {
117118

@@ -258,7 +259,7 @@ public static <T> T isA(Class<T> type) {
258259
*/
259260
@Deprecated
260261
public static <T> T anyVararg() {
261-
any();
262+
Object ignored = any();
262263
return null;
263264
}
264265

0 commit comments

Comments
 (0)
0