79530738

Date: 2025-03-24 10:01:47
Score: 0.5
Natty:
Report link

Confirmed as spring boot bug in https://github.com/spring-projects/spring-boot/issues/44849

Sadly, no fix can applied to all classes, but to minimize the changes, we can either:

a. Use @Autowired to make constructor not used for property binding:

class CustomA @Autowired constructor(
    var y: String = "",
    var z: String = "",
) : Base()

b. Declare subclass with only default constructor

class CustomA : Base() {
    var y: String = ""
    var z: String = ""
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: minh tri Vo