Skip to content

NIFI-15601 Improved the TIME_DURATION_REGEX in DurationFormat.java to accurately capture a positive decimal number with or without a leading integer.#66

Open
dan-s1 wants to merge 1 commit intoapache:mainfrom
dan-s1:NIFI-15601

Conversation

@dan-s1
Copy link
Contributor

@dan-s1 dan-s1 commented Feb 13, 2026

Summary

NIFI-15601
In order to standardize the exceptions thrown, I improved the TIME_DURATION_REGEX regular expression in DurationFormat to capture a positive decimal number whether it has a leading integer or not and not allow for more than one period.
In addition to adding unit tests to test when the duration value has illegal characters, I also added another case to an existing parameterized test testGetPreciseTimeDurationWithDecimalNumbers to test a decimal that does not even have a leading zero.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

… accurately capture a positive decimal number with or without a leading integer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant