question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Detection of DurationStyle.ISO8601 does not support lower-case input

See original GitHub issue

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

  1. Add Pattern.CASE_INSENSITIVE as the second argument to the Pattern.compile method at Line 87 of DurationStyle.java
  2. 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)?)?"

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
wilkinsonacommented, Sep 2, 2022

Given that we say we use the format that is used by java.time.Duration, I think it’s reasonable to expect the detect and detectAndParse methods to align with Duration’s own parsing.

I’m not sure that we need to go as far as using the same pattern as Duration does. Our simpler pattern used case-insensitively may be enough for our detection needs.

0reactions
philwebbcommented, Sep 3, 2022

Closing in favor of PR #32223. Thanks @valentine-dev!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detection of DurationStyle.ISO8601 does not support ... - GitHub
Detection of DurationStyle.ISO8601 does not support lower-case input #32232. wilkinsona opened this issue on Sep 5 · 0 comments.
Read more >
"T" and "Z" case sensitive in ISO8601 format? - Stack Overflow
The letter 'T'. Parsing is case insensitive. So this allows upper case T and lower case t . We should not trust Java...
Read more >
gt.pdf - R Project
Description Build display tables from tabular data with an easy-to-use set of functions. With its progressive approach, we can construct display ...
Read more >
Free Automated Malware Analysis Service - Hybrid Analysis
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to ...
Read more >
Boost.Chrono 2.0.2
Nevertheless round will exactly (with no round off error) detect a tie and ... If the author in the example does not want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found