-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support CharSequence
argument for Fallback String-to-Object Conversion
#4819
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
base: main
Are you sure you want to change the base?
Support CharSequence
argument for Fallback String-to-Object Conversion
#4819
Conversation
...main/java/org/junit/platform/commons/support/conversion/FallbackStringToObjectConverter.java
Outdated
Show resolved
Hide resolved
In my opinion, both the feature and the implementation are straightforward. However, after having put a little more thought into it, I believe we may want to alter the implementation to support backward compatibility. For example, if an existing code base has overloaded Thus, we should ideally make a first pass to find In other words, I think this new feature should effectively be a "fallback for the fallback". 😉 I'm happy to implement that, but I wanted to bring up the topic for discussion first. |
843e966
to
da86bdf
Compare
I've marked this PR as a draft until I've reworked the implementation to avoid introducing that regression. |
Prior to this commit, the Fallback String-to-Object Conversion support for parameterized tests supported factory constructors and methods that accepted a single String argument. This commit relaxes that restriction to support factory constructors and methods that accept either a single String argument or a single CharSequence argument, since the original source String can always be supplied to an Executable that accepts a CharSequence. For backward compatibility, the search algorithm gives precedence to factories that accept String arguments, only falling back to factories that accept CharSequence arguments if necessary. Note that this change is available to third parties via ConversionSupport in junit-platform-commons, which junit-jupiter-params utilizes. Closes junit-team#4815
da86bdf
to
02aaf4d
Compare
I have addressed this, force pushed, and removed draft status. |
Prior to this commit, the "Fallback String-to-Object Conversion" support for parameterized tests supported factory constructors and methods that accepted a single
String
argument.This commit relaxes that restriction to support factory constructors and methods that accept either a single
String
argument or a singleCharSequence
argument, since the original sourceString
can always be supplied to anExecutable
that accepts aCharSequence
.Note that this change is available to third parties via
ConversionSupport
injunit-platform-commons
, whichjunit-jupiter-params
utilizes.CharSequence
factory arguments #4815