Hi there,

I mostly work with Scala and don't know too much about the internal
machinery of Java.
There is something very confusing to me.

Since Java generics don't support type variations like Scala, why do you
have things like
```
public class TumblingEventTimeWindows extends WindowAssigner<Object,
TimeWindow>
```
instead of
```
public class TumblingEventTimeWindows<T> extends WindowAssigner<T,
TimeWindow>
```
?

But here
<https://github.com/apache/flink/blob/release-1.11/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java#L1909>
it
seems the compiler can infer the type `WindowAssigner<Tuple2<String, Integer>,
TimeWindow>` instead of `WindowAssigner<Object, TimeWindow>`.
Is that so?

When I try to do the same in Scala, the compiler gives an error that
`Object` is invariant.

It would be great if someone can give me a hint.

Kind regards,
Zhenhao

Reply via email to