-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[Java8] Add lambda parameter type annotations #1768
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
Conversation
I am kinda stuck with DataTableType implementation, can't get lambda method return type, to register it with LambdaGlueRegistry.
Also, I still don't know how to implement ParameterType with multiple capture groups, without creating a lot of functional interfaces with different amount of String arguments.
etc |
You can't get at the return type from However if you have an instance of that class you can get resolved types by using the Internally it looks into the constant types pool which is a JVM implementation detail but currently also the only way to provide this functionality.
There is no other way in Java. Best thing you can do is provide up to 9 parameters as we've done in |
Introduces the backend module. With this module backend implementations only need to use dependencies from `io.cucumber.core.backend`. This will allow us to introduce the module system later on The implementation is not yet perfect. Classpath scanning and resource loading is located in other modules. Removing this depends on #1526 and removal of type registry configurer which depends on #1768 . Fixes #1386 because steps can now see if an exception came from user code or actual backend. Removes timeout which would close #1695 earlier then expected.
lambda-type-annotations Conflicts: java8/src/main/java/io/cucumber/java8/Java8Backend.java java8/src/main/java/io/cucumber/java8/LambdaGlue.java java8/src/test/java/io/cucumber/java8/Java8LambdaStepDefinitionMarksCorrectStackElementTest.java java8/src/test/java/io/cucumber/java8/LambdaGlueTest.java
Work continued on #1782 ; Aside from merging master, here are my changes isolated from @rasklaad : |
Continue Lambda type annotations
java8/src/main/java/io/cucumber/java8/Java8DataTableTypeDefinition.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers! I've merged both PR's so I can discuss them as a whole.
java8/src/main/java/io/cucumber/java8/Java8DocStringTypeDefinition.java
Outdated
Show resolved
Hide resolved
java8/src/test/java/io/cucumber/java8/TypeDefinitionsStepdefs.java
Outdated
Show resolved
Hide resolved
java8/src/test/java/io/cucumber/java8/TypeDefinitionsStepdefs.java
Outdated
Show resolved
Hide resolved
Addressed a few of the comments already; don't think I'll find time over the next few days to fix the remaining issues.. Anyone welcome to pick those up. |
Whoo all done! Thanks @rasklaad and @timtebeek! Now I've got to update the release notes again! 😆 |
@timtebeek Thank you for the participation |
@rasklaad No problem at all; glad to help, and thanks for the final push to finish the work! :) |
Details
Motivation and Context
Closes: #1764
How Has This Been Tested?
Types of changes
Checklist: