junit5 icon indicating copy to clipboard operation
junit5 copied to clipboard

Consider making `ArgumentConverter#convert(Object, FieldContext)` non-default

Open scordio opened this issue 5 months ago • 2 comments

convert(Object, FieldContext) was introduced as a default method for backward compatibility in #4342.

I've recently implemented a few new argument converters and consistently managed to overlook overriding that method 🙃

Would you consider a breaking change by making it non-default in version 6?

Deliverables

  • [ ] convert(@Nullable Object source, FieldContext context) is no longer a default method

scordio avatar Aug 15 '25 10:08 scordio

I was also thinking whether the two convert methods could be merged into a single:

Object convert(@Nullable Object source, AnnotatedElementContext context)

but that would be a more aggressive change.

scordio avatar Aug 15 '25 10:08 scordio

Team decision: While we agree that the method should changed to non-default at some point, we think it's too early to do this in 6.0 since the change has only been made in 5.13.

marcphilipp avatar Aug 15 '25 14:08 marcphilipp