Skip to content

Imprecise definition of how parameters are handled in MethodLinkBuilderFactory.linkTo(…) methods #1652

@odrotbohm

Description

@odrotbohm

MethodLinkBuilderFactory.linkTo(…) methods taking Class and Method parameters implicitly assume that they're called with a parameter array of a length matching the number of expected parameters on the method. This assumption comes from WebMvcLinkBuilderFactory.linkTo(Object) just calling ….next() on theIterator of the received parameters.

This was reported as a behavioral change in Blazebit/blaze-persistence#1363 and likely introduced by the fix for #1598.

We should tighten the contract by adding additional methods that do not take a varargs parameter and let those create an Object[] based on the number of parameters the handed in method has. The methods actually taking parameters could then be tightened to verify the parameter array length so that mismatches in the two would still be covered if parameters are given in the first place.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions