-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
cucumber-expressions: Prefer Java type hint over parameter type #659
Merged
Commits on Aug 2, 2019
-
cucumber-expressions: Prefer Java type hint over parameter type
When there is a conflict between the type hint from the regular expression and the method prefer the the parameter type associated with the regular expression. This ensures we will use the internal/user registered parameter transformer rather then the default. Unless the parameter type indicates it is the stronger type hint. Reasoning: 1. Pure cucumber expression users will not notice this in either scenario. 2. Pure regular expression users will benefit because `BuiltInParameterTransformer` can now seamlessly transform any captured values. (For all built in types useRegexpMatchAsStrongTypeHint is explicitly set to false.) 2. Regular expression users that define a default transformer have little need to define parameter types. The default transformer should be sufficiently powerful to meet their needs and will often allow users to add custom creation methods e.g. Jacksons @JsonFactory. 3. Users who mix regular and cucumber expressions may run into conflicts when a registered cucumber expression and unregistered happens to collide. However this was the situation before this flag was added. 4. Regular expression users who define custom parameter types do so with the expectation that the parameter will be matched. Subverting this expectation when the method signature does not match may result in a parameter transformer that is unable to convert to the desired type. Leaving the user puzzled as to why his transform was ignored. Fixes: #658
Configuration menu - View commit details
-
Copy full SHA for f90958d - Browse repository at this point
Copy the full SHA f90958dView commit details
Commits on Aug 4, 2019
-
cucumber-expressions: Prefer Go type hint over parameter type
When there is a conflict between the type hint from the regular expression and the method prefer the the parameter type associated with the regular expression. This ensures we will use the internal/user registered parameter transformer rather then the default. Unless the parameter type indicates it is the stronger type hint. Reasoning: 1. Pure cucumber expression users will not notice this in either scenario. 2. Pure regular expression users will benefit because `BuiltInParameterTransformer` can now seamlessly transform any captured values. (For all built in types `useRegexpMatchAsStrongTypeHint` is explicitly set to false.) 2. Regular expression users that define a default transformer have little need to define parameter types. The default transformer should be sufficiently powerful to meet their needs and will often allow users to add custom creation methods e.g. Jacksons @JsonFactory. 3. Users who mix regular and cucumber expressions may run into conflicts when a registered cucumber expression and unregistered happens to collide. However this was the situation before this flag was added. 4. Regular expression users who define custom parameter types do so with the expectation that the parameter will be matched. Subverting this expectation when the method signature does not match may result in a parameter transformer that is unable to convert to the desired type. Leaving the user puzzled as to why his transform was ignored.
Configuration menu - View commit details
-
Copy full SHA for cf62394 - Browse repository at this point
Copy the full SHA cf62394View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0389bf1 - Browse repository at this point
Copy the full SHA 0389bf1View commit details
Commits on Aug 5, 2019
-
Merge remote-tracking branch 'origin/master' into prefer-type-hint--o…
…ver-parameter-type
Configuration menu - View commit details
-
Copy full SHA for 69ce125 - Browse repository at this point
Copy the full SHA 69ce125View commit details
Commits on Aug 11, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 8094db4 - Browse repository at this point
Copy the full SHA 8094db4View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.