There is C convention to mark that function is called for side effects only and in this particular invocation we are not interested in returning value:

(void) getSomethingAndDoAction(...);

Are there any equivalent in Java?

1 Answers

2
Daniel Pryden On Best Solutions

The Error Prone project has a @CheckReturnValue annotation that can be used for this purpose.

This would make it a compile-time error to ignore the return value, unless you suppress the error using an annotation: @SuppressWarnings("CheckReturnValue")