Repository navigation
Conversation
Author
|
After opening the pull request, the project’s CI checks failed. Inspecting the logs showed the failure was unrelated to our change: seven cases of FastDatePrinterTimeZonesTest, which formats the current time, failed because the run happened during the US/Mexico daylight-saving change on 1 November 2026. Our own DurationFormatUtilsTest, including testLANG980, passed (54 tests, 0 failures). |
garydgregory
marked this pull request as draft
November 1, 2026 11:25
Member
|
@u7924412 Rebase on git master. Set to draft. |
Member
Member
|
Closing: See above. |
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.
Fixes LANG-980.
DurationFormatUtils.Tokencompared token values with==in two places:Token.containsTokenWithValue(Token[], Object)Token.equals(Object)This only worked because the values being compared were always the same
Stringconstant instances (y,M,d,H,m,s,S). A token holding an equal but differentStringinstance was not recognised, which would causeformatDuration/formatPeriodto silently leave that unit out.This PR changes both comparisons to use
equals(), matching howlexx()already compares token values (previous.getValue().equals(value)).null(the constructor usesObjects.requireNonNull), so callingequals()is safe.StringBuilder, which does not overrideequals(), so their behaviour is unchanged.Added
testLANG980, which fails before this change and passes after it.mvn; that'smvnon the command line by itself.