refine ImmutableCollections class implementations
Following this checklist to help us incorporate your contribution quickly and easily:
- [ ] Your pull request should address just one issue, without pulling in other changes.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge.
- [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice.
- [ ] Run
mvn verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] You have run the Core IT successfully.
If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement if you are unsure please ask on the developers list.
To make clear that you license your contribution under the Apache License Version 2.0, January 2004 you have to acknowledge this by using the following check-box.
- [ ] I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
- [ ] In any other case, please file an Apache Individual Contributor License Agreement.
Chesterton's Fence. Do we know why this was here? Maybe it's just old pre Java 1.5 code that we don;t need at all any more. Are there performance impacts?
I know the reason now. the jdk impl is not null-value-allowable
closing this pr.
Chesterton's Fence. Do we know why this was here? Maybe it's just old pre Java 1.5 code that we don;t need at all any more. Are there performance impacts?
I know the reason now. the jdk impl is not null-value-allowable
closing this pr.
The other reason is that Map.copyOf() does not keep input Map ordering.
However, we can remove the read-only Properties which is not used anymore, and I think we can switch to List.empty(), List.of() and List.copyOf() instead of our custom list implementation.
The null-values are not a show-stopper imho, as we can refine the API to not allow nulls, it may just need a few adjustements. However, until we have some kind of SequentialMap.of() in the JDK, we need to keep our own Map implementation.
Btw, this duplicates #2363