Use 'instanceof' pattern variable

Update authors and copyright years

Fixing checkstyle issue
This commit is contained in:
Byungjun You
2023-01-22 19:44:16 +09:00
committed by Soby Chacko
parent b49fde97c8
commit 7895025c47
33 changed files with 283 additions and 274 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ import org.springframework.messaging.MessageChannel;
* It is intended for internal framework testing and is NOT for public use. Breaking changes are likely!!!
*
* @author Oleg Zhurakousky
* @author Byungjun You
* @since 3.0.2
*
*/
@@ -52,8 +53,8 @@ public final class FunctionBindingTestUtils {
public static void bind(ConfigurableApplicationContext applicationContext, Object function) {
try {
Object targetFunction = function;
if (function instanceof FunctionRegistration) {
targetFunction = ((FunctionRegistration) function).getTarget();
if (function instanceof FunctionRegistration functionRegistration) {
targetFunction = functionRegistration.getTarget();
}
String functionName = targetFunction instanceof Function ? "function" : (targetFunction instanceof Consumer ? "consumer" : "supplier");