Skip to content

Fixes: Enhance Kotlin Support for Suppliers, Functions, and Consumers #1277 #1278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

apoupard
Copy link

@apoupard apoupard commented May 8, 2025

Description:

This merge request aims to enhance and solidify Kotlin support within Spring Cloud Function. It addresses several identified issues related to the handling of various Kotlin features, including suspend functions, Flow types, and different functional arities/signatures for Suppliers, Functions, and Consumers.

Recent compatibility testing highlighted a number of scenarios where Kotlin function declarations were not being processed as expected, leading to runtime exceptions and test failures. This MR introduces fixes and improvements to the spring-cloud-function-context to better interpret and manage diverse Kotlin functional styles.

Key Changes:

  • Enhanced Kotlin Arity Handling: The spring-cloud-function-context has been refactored to more comprehensively handle various declaration combinations for Kotlin functions, consumers, and suppliers.
  • New Arity Tests: A comprehensive suite of tests has been added to the spring-cloud-function-kotlin module. These tests cover a wide range of Kotlin function, consumer, and supplier declarations to ensure their correct behavior and to help identify areas for further improvement.
  • Unit Tests for Arity and Wrappers: Additional unit tests have been introduced to verify the core logic for Kotlin arity handling and associated wrapper mechanisms. These tests cover catalogue registration and native type casting.

Summary of Addressed Issues from Testing:

The changes in this MR specifically target issues observed during testing, such as:

  • UnsupportedOperationException and NullPointerException related to suspend function handling.
  • ClassCastException when dealing with kotlinx.coroutines.flow.Flow and org.springframework.messaging.Message types.
  • DecodingException for certain reactive types like Flow.

By addressing these points, this MR significantly improves the robustness and usability of Spring Cloud Function for Kotlin developers, aiming to provide a more seamless and first-class experience.

@apoupard apoupard force-pushed the feat/kotlin-support-enhancement branch 3 times, most recently from b8e40f1 to 5224936 Compare May 8, 2025 14:10
@apoupard
Copy link
Author

apoupard commented May 8, 2025

About the DCO task fail, I have update the email to [email protected].
All commits have
Signed-off-by: Adrien [email protected]

@artembilan
Copy link
Member

Signed-off-by: Adrien [email protected]

It has to container your legal name - full legal name.
Consider to squash all commits and force-push only one with correct sign-off.
Thanks

Adrien added 4 commits May 13, 2025 01:08
This commit introduces a comprehensive suite of tests to cover all possible declarations of Kotlin functions, consumers, and suppliers within the `spring-cloud-function-kotlin` module.

The primary goal of these tests is to explore the various declaration combinations and identify potential areas for improvement and enhanced support in the framework.

Signed-off-by: Adrien Poupard <[email protected]>
This commit refactors the `spring-cloud-function-context` to comprehensively handle all combinations of possible declarations for Kotlin functions, consumers, and suppliers. This improves the framework's ability to correctly interpret and manage different Kotlin functional styles.

Signed-off-by: Adrien Poupard <[email protected]>
This commit adds new unit tests to verify the core logic for Kotlin arity handling and wrapper mechanisms. These tests cover various scenarios including catalogue registration and native type casting for consumers, functions, and suppliers.

Signed-off-by: Adrien Poupard <[email protected]>
@apoupard apoupard force-pushed the feat/kotlin-support-enhancement branch from 5224936 to 8a8ef5a Compare May 12, 2025 23:09
@apoupard
Copy link
Author

Done, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants