The get & contains & remove method using Objects are right now converted to type-specific methods, now that is fine in most cases but there are cases where non-type-specific methods are really useful. Because Compare-Method is: Input.equals(collectionValue), that means the input decides if the key matches it should still work.
Adding an Object is a different story there the function should be converted to a type Specific method.
As an example: In a IntList a Integer should be able to remove an entry, but also a MutableInt from the Apache Library and a custom class that masks itself with a Integer. Since the Integer is final that is not possible with the type specific case.
I know of many cases where using that fact helped simplify a lot of code and it is intended by the Java Developers.
Methods to fix:
contains
containsAll
containsAny
indexOf
lastIndexOf
get
remove
removeAll
The get & contains & remove method using Objects are right now converted to type-specific methods, now that is fine in most cases but there are cases where non-type-specific methods are really useful. Because Compare-Method is: Input.equals(collectionValue), that means the input decides if the key matches it should still work.
Adding an Object is a different story there the function should be converted to a type Specific method.
As an example: In a IntList a Integer should be able to remove an entry, but also a MutableInt from the Apache Library and a custom class that masks itself with a Integer. Since the Integer is final that is not possible with the type specific case.
I know of many cases where using that fact helped simplify a lot of code and it is intended by the Java Developers.
- Methods to fix:
- [X] contains
- [X] containsAll
- [X] containsAny
- [X] indexOf
- [X] lastIndexOf
- [X] get
- [X] remove
- [X] removeAll
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The get & contains & remove method using Objects are right now converted to type-specific methods, now that is fine in most cases but there are cases where non-type-specific methods are really useful. Because Compare-Method is: Input.equals(collectionValue), that means the input decides if the key matches it should still work.
Adding an Object is a different story there the function should be converted to a type Specific method.
As an example: In a IntList a Integer should be able to remove an entry, but also a MutableInt from the Apache Library and a custom class that masks itself with a Integer. Since the Integer is final that is not possible with the type specific case.
I know of many cases where using that fact helped simplify a lot of code and it is intended by the Java Developers.