commons-collections icon indicating copy to clipboard operation
commons-collections copied to clipboard

Use Java Generics for `MultiKeyMap`-keys as method parameters

Open Chrimle opened this issue 1 year ago • 2 comments

Thanks for your contribution to Apache Commons! Your help is appreciated!

Before you push a pull request, review this list:

  • [ ] Read the contribution guidelines for this project.
  • [ ] Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • [ ] 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.
  • [ ] 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.

This is purely a draft. The suggestion made by @garydgregory was to simply update the JavaDocs. In reference to: COLLECTIONS-872

Chrimle avatar Dec 08 '24 22:12 Chrimle

@Chrimle See item 2 in the checklist.

garydgregory avatar Dec 09 '24 00:12 garydgregory

I've assessed this, and I would say that the keys should not be of type K. The reason, is that there is ambiguity whether all keys should of the same type or not. Regardless, I believe the better solution would allow any combination of types for the keys. Hence, if generics should be used - it wouldn't be done in this way.

These changes will be reverted, and instead, all JavaDocs in MultiKeyMap will be assessed.

@garydgregory this was just a draft. In hindsight, it could've been shared on Jira instead.

Chrimle avatar Dec 10 '24 00:12 Chrimle