Skip to content

Commit caee17d

Browse files
committed
Add KotlinUtils
1 parent bea8446 commit caee17d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/BeanFactoryAwareFunctionRegistry.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.springframework.cloud.function.context.config.RoutingFunction;
4545
import org.springframework.cloud.function.core.FunctionInvocationHelper;
4646
import org.springframework.cloud.function.json.JsonMapper;
47+
import org.springframework.cloud.function.utils.KotlinUtils;
4748
import org.springframework.context.ApplicationContext;
4849
import org.springframework.context.ApplicationContextAware;
4950
import org.springframework.context.support.GenericApplicationContext;
@@ -147,6 +148,7 @@ public <T> T lookup(Class<?> type, String functionDefinition, String... expected
147148
logger.debug("Skipping function '" + functionName + "' since it is already present");
148149
}
149150
else {
151+
150152
Object functionCandidate = this.discoverFunctionInBeanFactory(functionName);
151153
if (functionCandidate != null) {
152154
Type functionType = null;
@@ -157,7 +159,8 @@ public <T> T lookup(Class<?> type, String functionDefinition, String... expected
157159
else if (functionCandidate instanceof BiFunction || functionCandidate instanceof BiConsumer) {
158160
functionRegistration = this.registerMessagingBiFunction(functionCandidate, functionName);
159161
}
160-
else if (KotlinDetector.isKotlinType(functionCandidate.getClass())) {
162+
//else if (KotlinDetector.isKotlinType(functionCandidate.getClass())) {
163+
else if (KotlinUtils.isKotlinType(functionCandidate)) {
161164
KotlinLambdaToFunctionAutoConfiguration.KotlinFunctionWrapper wrapper =
162165
new KotlinLambdaToFunctionAutoConfiguration.KotlinFunctionWrapper(functionCandidate);
163166
wrapper.setName(functionName);

spring-cloud-function-samples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<module>function-sample-cloudevent-stream</module>
3333
<module>function-sample-cloudevent-rsocket</module>
3434
<module>function-sample-cloudevent-sdk</module>
35-
<module>function-sample-kotlin-web</module>
35+
<!-- <module>function-sample-kotlin-web</module>-->
3636
<module>function-sample-grpc-cloudevent</module>
3737
</modules>
3838

0 commit comments

Comments
 (0)