Repository navigation
Find Element Data by its key whatever the case - #167
Merged
Merged
Conversation
jwrosewell
marked this pull request as ready for review
November 16, 2026 21:47
jwrosewell
added a commit
that referenced
this pull request
Nov 16, 2026
Draft
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.
Element Data keys are now compared ignoring case, so
flowData.get("Device")finds the Element Data stored underdevice, and adding Element Data under a key that differs only in case finds the Element Data already there. Until now the lookup compared keys exactly, soflowData.get("Device")threwNoSuchElementException.What the specification says
access-to-results.md lines 5 to 11 at b3b2c0dd:
Lines 19 and 20 say "It MUST be possible to get Element Data by supplying the string key for the element."
What was different on
rcFlow Data keeps its Element Data in the map TypedKeyMapBuilder makes, and its
findWithPrevious, which every lookup,put,containsKeyand removal goes through, compared each key's name withequals. Property names already ignore case, through each Element Data's own map.What changed
f92ce9c8.
findWithPreviouscompares names withequalsIgnoreCase, in both of its comparisons. Both kinds of map the builder makes, for a concurrent Pipeline and not, use it. A key keeps the spelling it was first stored under, andgetKeysgives that spelling.equalsIgnoreCasecompares character by character with no locale, so the result is the same under any default locale.Before you upgrade
flowData.get(key),getOrAdd(key, ...)and the other ways of reaching Element Data by its key now find the Element Data whatever the case of the key. Code that stored two Element Data under keys differing only in case, which no 51Degrees element does, now gets one entry, the second write replacing the first value.Tests
Tests first, 677e2ee5. New
TypedKeyMapKeyCaseTests, run against both kinds of map, checks that a value stored underdeviceis found asDeviceandDEVICEand thatcontainsKey("Device")is true, that a secondputunderDevicereplaces the value and leaves one key, and that the key keeps the spelling first given. New inFlowDataTests,FlowData_AddDataString_GetDataStringOtherCasegets Element Data stored asdevicewithDeviceandDEVICE, andFlowData_GetOrAddOtherCase_SameDataexpectsgetOrAdd("Device", ...)to return the Element Data already added asdevice.Red 43698064380 ran the test commit on
rc30e8df6 plus a throwaway workflow on Ubuntu and Windows, Java 17. On both, all threeTypedKeyMapKeyCaseTestsand the two newFlowDataTestsfailed, withNoSuchElementException, "expected:<1> but was:<2>", "expected:<[device]> but was:<[DEVICE, device]>" and "expected same", while the other 39FlowDataTestsand the 19 tests in each ofTypedKeyMapTestConcurrentandTypedKeyMapTestNonConcurrentpassed. Green 43698075971 ran the head plus the same workflow, and on both systemsTypedKeyMapKeyCaseTestspassed 3 of 3,FlowDataTests41 of 41, and eachTypedKeyMapTestclass 19 of 19.Full build
Run 43916478929 built ed94d31 merged with
rc81e3d4a on nine configurations, Ubuntu x64 with Java 8, 11, 17 and 21, Ubuntu arm64 with Java 17, and Windows with Java 8, 11, 17 and 21. Configure and all nine Build and Test jobs passed, read from each job's log, andTypedKeyMapKeyCaseTestspassed 3 of 3 in all nine jobs. Each of its tenSetting 'PullRequestSha'lines names ed94d31, and its Configure job printed "Left out 6 macOS entries". The run's last job, which only gathers the results, was still waiting for a runner when this was written.What it releases
pipeline.corechanges, so it and the packages that depend on it are released, each at its own next patch version.Base branch
rc81e3d4a is merged into the head, ed94d31, with a merge commit, with no conflict. #179 changes the sameTypedKeyMapBuilder.java, so whichever merges second keeps one copy.What remains
Nothing for this requirement in Java.