Skip to content

Constructor binding for nested class with multiple constructors causes BindException  #18810

@mbhave

Description

@mbhave
@ConstructorBinding
@ConfigurationProperties("test")
static class NestedConstructorProperties {

  private final String name;

  private final Nested nested;

  NestedConstructorProperties(String name, Nested nested) {
    this.name = name;
    this.nested = nested;
  }

  String getName() {
    return this.name;
  }

  Nested getNested() {
    return this.nested;
  }

  static class Nested { 

    private int age;

    @ConstructorBinding
    Nested(int age) {
      this.age = age;
    }

    Nested() {

    }

    int getAge() {
      return this.age;
    }

  }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions