Bug Report
Environment
Version of Spring Boot
2.7.3
Version of Java
11
Expected (what is in the Reference Documentation)
The standard ISO-8601 format used by java.time.Duration
from https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.typesafe-configuration-properties.conversion.durations
Actual Behavior
Some format used by java.time.Duration is not working in Spring Boot app, like "pt25.234s" demonstrated in the example application at https://github.com/valentine-dev/spring-boot-duration-style-iso8601
Suggestion Solution
- Add
Pattern.CASE_INSENSITIVE as the second argument to the Pattern.compile method at Line 87 of DurationStyle.java
- Use the following pattern string in java.time.Duration source code (Line 151 ~ 152 in the file from JDK 11) at Line 65 of DurationStyle.java:
"([-+]?)P(?:([-+]?[0-9]+)D)?" +
"(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?"
Bug Report
Environment
Version of Spring Boot
2.7.3
Version of Java
11
Expected (what is in the Reference Documentation)
from https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.typesafe-configuration-properties.conversion.durations
Actual Behavior
Some format used by java.time.Duration is not working in Spring Boot app, like "pt25.234s" demonstrated in the example application at https://github.com/valentine-dev/spring-boot-duration-style-iso8601
Suggestion Solution
Pattern.CASE_INSENSITIVEas the second argument to thePattern.compilemethod at Line 87 of DurationStyle.java"([-+]?)P(?:([-+]?[0-9]+)D)?" +"(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?"