Spring cleaning: use method references

This commit is contained in:
Sam Brannen
2024-02-23 11:53:15 +01:00
parent 4339c8eac2
commit 4bd1485ce4
10 changed files with 17 additions and 18 deletions

View File

@@ -233,8 +233,7 @@ public class ScriptFactoryPostProcessor implements SmartInstantiationAwareBeanPo
// Filter out BeanPostProcessors that are part of the AOP infrastructure,
// since those are only meant to apply to beans defined in the original factory.
this.scriptBeanFactory.getBeanPostProcessors().removeIf(beanPostProcessor ->
beanPostProcessor instanceof AopInfrastructureBean);
this.scriptBeanFactory.getBeanPostProcessors().removeIf(AopInfrastructureBean.class::isInstance);
}
@Override

View File

@@ -98,7 +98,7 @@ public interface MethodValidationResult {
*/
default List<ParameterErrors> getBeanResults() {
return getAllValidationResults().stream()
.filter(result -> result instanceof ParameterErrors)
.filter(ParameterErrors.class::isInstance)
.map(result -> (ParameterErrors) result)
.toList();
}