Skip to content

finished Transient.Map as a drop-in replacement for java.util.HashMap#40

Merged
jurgenvinju merged 3 commits intomainfrom
drop-in-transient-map
Jan 26, 2026
Merged

finished Transient.Map as a drop-in replacement for java.util.HashMap#40
jurgenvinju merged 3 commits intomainfrom
drop-in-transient-map

Conversation

@jurgenvinju
Copy link
Copy Markdown
Member

@jurgenvinju jurgenvinju commented Sep 22, 2025

  • implements java.util.Map{put,putAll,remove,removeAll} by forwarding to Map.{__put,__putAll,__remove,__removeAll} instead of throwing UnsupportedOperationException
  • added some @SuppressWarnings
  • this allows me to use Transient.Map.of() instead of new HashMap and save quite a bit of memory in Rascal's interpreter.

@jurgenvinju
Copy link
Copy Markdown
Member Author

@msteindorfer do you see anything against this? I'm now using __putAll in an experiment and that seems to work fine as a replacement for putAll. Of course for the Immutable versions this does not make sense; but I'm interested in using our Transient versions.

@jurgenvinju jurgenvinju merged commit 2882ffb into main Jan 26, 2026
1 check passed
@jurgenvinju jurgenvinju deleted the drop-in-transient-map branch January 26, 2026 10:25
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