fix duration parsing#714
Merged
Merged
Conversation
mukundansundar
commented
Mar 24, 2022
| // return empty string for anything negative, it'll only happen for reminder "periods", not dueTimes. A | ||
| // negative "period" means fire once only. | ||
| if (value == Duration.ZERO | ||
| || (value.compareTo(Duration.ZERO) == 1)) { |
Contributor
Author
There was a problem hiding this comment.
compareTo can produce any value greater than 1, by contract any positive value means the value is greater. This failed the test when only milliseconds were given ...
Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
90681be to
b381f24
Compare
Codecov Report
@@ Coverage Diff @@
## master #714 +/- ##
============================================
+ Coverage 77.98% 78.19% +0.21%
- Complexity 1105 1117 +12
============================================
Files 97 97
Lines 3407 3417 +10
Branches 394 399 +5
============================================
+ Hits 2657 2672 +15
+ Misses 550 547 -3
+ Partials 200 198 -2
Continue to review full report at Codecov.
|
artursouza
approved these changes
Mar 24, 2022
fackee
pushed a commit
to fackee/java-sdk
that referenced
this pull request
Mar 28, 2022
Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
artursouza
pushed a commit
to pkedy/java-sdk
that referenced
this pull request
Jun 22, 2022
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix the Duration parsing. When reminder dueTime is stored in DB as "30m" or "10s" etc ... Java SDK fails to load the reminder with IndexOutOfBoundException.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #712
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: