return runnable -> { return new Runnable() { // S1604 flagged here @CustomAnnotation @Override public void run() { // Some logic runnable.run(); } } };
S1604 advises to replace this code by a lambda, but it is not possible due to the custom annotation. We should not report an issue when the method has an annotation other than @Override.
- relates to
-
RSPEC-1604 Anonymous inner classes containing only one method should become lambdas
- Active
- links to