From 1871cffc7dbee71fe29e6eb99513726427c03157 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 30 Jul 2020 09:04:30 +0100 Subject: [PATCH] =?UTF-8?q?Document=20that=20constructor=20binding=20does?= =?UTF-8?q?=20not=20support=20@=E2=80=A6Unit=20annotations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes gh-22565 --- .../src/main/asciidoc/spring-boot-features.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 8de51231b0..2c6d9e5f57 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -1341,6 +1341,8 @@ These are: * `d` for days The default unit is milliseconds and can be overridden using `@DurationUnit` as illustrated in the sample above. +Note that `@DurationUnit` is only supported with JavaBean-style property binding using getters and setters. +It is not supported with constructor binding. TIP: If you are upgrading from a previous version that is using `Long` to express the duration, make sure to define the unit (using `@DurationUnit`) if it isn't milliseconds alongside the switch to `Duration`. Doing so gives a transparent upgrade path while supporting a much richer format.