Add org.cactoos.map.Immutable decorator - #1845
Open
rehandxtr wants to merge 1 commit into
Open
Conversation
rehandxtr
marked this pull request as draft
January 21, 2026 15:51
rehandxtr
marked this pull request as ready for review
June 24, 2026 15:53
rehandxtr
force-pushed
the
rehan_Split_Map_issue_fix
branch
from
June 24, 2026 16:10
5baa090 to
b61c74d
Compare
Author
PR hygiene pass (findings)Cleaned up this PR for review. Summary of what changed and what reviewers should know: Done
Scope vs
|
rehandxtr
force-pushed
the
rehan_Split_Map_issue_fix
branch
3 times, most recently
from
June 24, 2026 16:32
a452a16 to
15f4e48
Compare
Introduce a read-only Map decorator consistent with list/set Immutable classes, document usage in the README (including SplitPreserveAllTokens examples for the existing text API), and add unit tests for map.Immutable and TriFuncSplitPreserve. Keep the Maven CI matrix on ubuntu-24.04, windows-2022, and macos-15. Pass -Dhone.skipWithoutDocker=true so hone runs when Docker is present (Ubuntu) and is skipped cleanly on runners without Docker. Closes yegor256#1835
rehandxtr
force-pushed
the
rehan_Split_Map_issue_fix
branch
from
June 24, 2026 16:41
15f4e48 to
b6441ad
Compare
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.
Summary
Adds
org.cactoos.map.Immutable, a read-onlyMapdecorator aligned with the existinglist.Immutable/set.Immutablepattern, plus documentation and tests.This PR also documents the existing
SplitPreserveAllTokensAPI in the README and adds focused tests forTriFuncSplitPreserve(the implementation itself is already onmaster).Closes #1835
Relates to #1722 (docs/tests only — implementation already merged)
Changes
src/main/java/org/cactoos/map/Immutable.java— blocksput/remove/putAll/clear, immutable views (keySet,values,entrySet), andEntry.setValue()ImmutableTest(map decorator behavior and mutation rejection)TriFuncSplitPreserveTest(core split-preserve algorithm coverage)ubuntu-24.04,windows-2022,macos-15; pass-Dhone.skipWithoutDocker=true/-Dhone.skipOnWindows=trueso hone runs on Ubuntu (Docker available) and is skipped cleanly on macOS/WindowsDesign notes
Mapdirectly (same approach as otherImmutabledecorators in this codebase), not viaMapEnvelope.Map<? extends K, ? extends V>for covariance, consistent with typical Cactoos collection decorators.SplitPreserveAllTokensfor discoverability; that class is not introduced by this PR (already present onmaster).Test plan
ImmutableTest— mutation attempts throwUnsupportedOperationException; views/iterators/entry updates are blocked; read operations delegate correctlyTriFuncSplitPreserveTest— delimiter / limit / empty-token edge casesubuntu-24.04,windows-2022, andmacos-15Commit hygiene
History kept to a single commit on
rehan_Split_Map_issue_fixfor a clean review surface.