Grigorii Yurkov
02/10/2021, 7:53 AMthis
to S
is unchecked. Is it a bug or I miss somethingnfrankel
02/10/2021, 7:58 AMNiklas Gürtler
02/10/2021, 8:21 AMVampire
02/10/2021, 8:36 AMAbstractBuilder
be of type S
?Niklas Gürtler
02/10/2021, 8:38 AMS
should derive from AbstractBuilder<S>
, so an instance of AbstractBuilder<S>
can be downcast to S
. However, someone could do:
class A : AbstractBuilder<B> {}
class B : AbstractBuilder<A> {}
and then the cast fails, but the JVM can't check it as it's uncheckedVampire
02/10/2021, 8:40 AMNiklas Gürtler
02/10/2021, 8:40 AMGrigorii Yurkov
02/10/2021, 8:42 AMVampire
02/10/2021, 8:43 AMGrigorii Yurkov
02/10/2021, 8:43 AMpublic interface BaseStream<T, S extends BaseStream<T, S>>
nfrankel
02/10/2021, 8:48 AMVampire
02/10/2021, 8:49 AMnfrankel
02/10/2021, 8:49 AMMatteo Mirk
02/10/2021, 10:27 AMdmitriy.novozhilov
02/10/2021, 8:34 PM