Skip to content
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

INT-4458: Do not expose recursive generics API #2432

Merged
merged 3 commits into from
May 1, 2018

Conversation

artembilan
Copy link
Member

JIRA: https://jira.spring.io/browse/INT-4458

According Kotlin generics system restrictions we can't expose API
based on the recursive generics, like we have with Java DSL for JMS

  • Replace explicit recursive generics on factory method with the wildcard (?).
    This way both Kotlin and Java are able to instantiate target object and perform
    the proper chain API auto-completion
  • Fix JmsInboundChannelAdapterSpec to deal with provided S type for the
    configureListenerContainer() - the way we can configure a JmsDefaultListenerContainerSpec
  • Add kotlin-spring Gradle plugin to avoid extra open modificator on @Bean methods
  • Add JmsDslKotlinTests.kt

Cherry-pick to 5.0.x excluding Kotlin support

JIRA: https://jira.spring.io/browse/INT-4458

According Kotlin generics system restrictions we can't expose API
based on the recursive generics, like we have with Java DSL for JMS

* Replace explicit recursive generics on factory method with the wildcard (`?`).
This way both Kotlin and Java are able to instantiate target object and perform
the proper chain API auto-completion
* Fix `JmsInboundChannelAdapterSpec` to deal with provided `S` type for the
`configureListenerContainer()` - the way we can configure a `JmsDefaultListenerContainerSpec`
* Add `kotlin-spring` Gradle plugin to avoid extra `open` modificator on `@Bean` methods
* Add `JmsDslKotlinTests.kt`

**Cherry-pick to 5.0.x excluding Kotlin support**
@artembilan
Copy link
Member Author

If that's OK, I can go ahead and fix similar problem in AMQP DSL and other.

@garyrussell
Copy link
Contributor

LGTM; do you want to do the others in this PR? Or a separate one?

@artembilan
Copy link
Member Author

Well, I can do in the separate PR(s), but then it's more work during cherry-picking.
So, I'd prefer to do here as one unit of work, because this PR doesn't address all the problems.
Therefore [DO NOT MERGE YET] 😄

@artembilan
Copy link
Member Author

Looks like nothing more to fix.
Ready for final review.

Thanks

@artembilan
Copy link
Member Author

Oh! Looks like we have back-ported Kotlin tests to 5.0.x!
So, this is simple to merge then.
Let me push some polishing to the test-case! 😄

@garyrussell garyrussell merged commit a62832c into spring-projects:master May 1, 2018
garyrussell pushed a commit that referenced this pull request May 1, 2018
* INT-4458: Do not expose recursive generics API

JIRA: https://jira.spring.io/browse/INT-4458

According Kotlin generics system restrictions we can't expose API
based on the recursive generics, like we have with Java DSL for JMS

* Replace explicit recursive generics on factory method with the wildcard (`?`).
This way both Kotlin and Java are able to instantiate target object and perform
the proper chain API auto-completion
* Fix `JmsInboundChannelAdapterSpec` to deal with provided `S` type for the
`configureListenerContainer()` - the way we can configure a `JmsDefaultListenerContainerSpec`
* Add `kotlin-spring` Gradle plugin to avoid extra `open` modificator on `@Bean` methods
* Add `JmsDslKotlinTests.kt`

**Cherry-pick to 5.0.x excluding Kotlin support**

* Fix `Amqp` DSL factory for recursive generics

* Polishing for Kotlin tests
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