Skip to content

Bean binding might not be used when more than one constructor exists #18485

@philwebb

Description

@philwebb

Spring Cloud discovered a recent regression with the binder where the ValueObjectBinder is used instead of the JavaBeanBinder. They use a pattern like this:

public class Foo {

    Foo() {
    }

    Foo(String name) {
        ..
    }

   // getName / setName

}

This allows for properties to be defined in two ways: test[0]=hello or test[0].name=hello.

In the first instance the ObjectToObject converter is used to create the instance. In the second case, bean binding should be used.

The regression only happens then the bound object doesn't have a supplied value (e.g. it's in a list).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions