Closed techsy730 closed 3 years ago
I'm confused. Why deprecate? This stuff has never been distributed AFAIK.
For Predicate, you are right. We could just make the change. But the Consumers were introduced in 8.0.0 it seems.
Ok. At the same time, as I was discussing in #197 , predicates and consumers are exactly the case in which implementing the JDK interface, even if the type does not match, makes perfect sense. Say you have a LongConsumer computing statistics on a stream: it is natural to use it on a CharStream. There is no unsafe type conversion. The situation is very different with operators.
So deprecate the fact that, for example, ByteConsumer extends java.util.function.IntConsumer.
This fact has lead to some need some unfortunate extra overloads to avoid ambiguity. These overloads were already marked deprecated, so when we remove the widened superinterface we should also remove these methods.
Example of a deprecated method that should be co-removed is ByteIterable.forEach(java.util.function.IntConsumer).