Github user twalthr commented on a diff in the pull request:
https://github.com/apache/flink/pull/6120#discussion_r203083498
--- Diff:
flink-core/src/test/java/org/apache/flink/api/java/typeutils/LambdaExtractionTest.java
---
@@ -271,19 +214,20 @@ public void testKeySelectorLambda() {
public void testLambdaTypeErasure() {
MapFunction<Tuple1<Integer>, Tuple1> f = (i) -> null;
TypeInformation<?> ti = TypeExtractor.getMapReturnTypes(f, new
TypeHint<Tuple1<Integer>>(){}.getTypeInfo(), null, true);
- Assert.assertTrue(ti instanceof MissingTypeInfo);
+ assertTrue(ti instanceof MissingTypeInfo);
}
@Test
public void testPartitionerLambda() {
Partitioner<Tuple2<Integer, String>> partitioner = (key,
numPartitions) -> key.f1.length() % numPartitions;
- final TypeInformation<?> ti =
TypeExtractor.getPartitionerTypes(partitioner);
-
- Assert.assertTrue(ti.isTupleType());
- Assert.assertEquals(2, ti.getArity());
- Assert.assertEquals(((TupleTypeInfo<?>) ti).getTypeAt(0),
BasicTypeInfo.INT_TYPE_INFO);
- Assert.assertEquals(((TupleTypeInfo<?>) ti).getTypeAt(1),
BasicTypeInfo.STRING_TYPE_INFO);
+ final TypeInformation<?> ti =
TypeExtractor.getPartitionerTypes(partitioner, null, true);
+ if (!(ti instanceof MissingTypeInfo)) {
--- End diff --
In case a compiler adds generics, this case would be activated. Otherwise
testing for `MissingTypInfo` is correct.
---