From ba42c96029643420d1de2e0359ea393c466a131f Mon Sep 17 00:00:00 2001 From: Google Java Core Libraries Date: Thu, 20 Feb 2025 11:22:23 -0800 Subject: [PATCH] Update `TableCollectorsTest` for compatibility with J2KT. PiperOrigin-RevId: 729184487 --- .../common/collect/TableCollectorsTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/guava-tests/test/com/google/common/collect/TableCollectorsTest.java b/guava-tests/test/com/google/common/collect/TableCollectorsTest.java index 70cd90cfdd49..994e81ff7589 100644 --- a/guava-tests/test/com/google/common/collect/TableCollectorsTest.java +++ b/guava-tests/test/com/google/common/collect/TableCollectorsTest.java @@ -66,6 +66,8 @@ public void testToImmutableTableConflict() { .collect(collector)); } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when rowFunction result (null) is unboxed + @J2ktIncompatible public void testToImmutableTableNullRowKey() { Collector, ?, ImmutableTable> collector = toImmutableTable(t -> null, Cell::getColumnKey, Cell::getValue); @@ -74,6 +76,9 @@ public void testToImmutableTableNullRowKey() { () -> Stream.of(immutableCell("one", "uno", 1)).collect(collector)); } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when columnFunction result (null) is + // unboxed + @J2ktIncompatible public void testToImmutableTableNullColumnKey() { Collector, ?, ImmutableTable> collector = toImmutableTable(Cell::getRowKey, t -> null, Cell::getValue); @@ -82,6 +87,8 @@ public void testToImmutableTableNullColumnKey() { () -> Stream.of(immutableCell("one", "uno", 1)).collect(collector)); } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when getValue result (null) is unboxed + @J2ktIncompatible public void testToImmutableTableNullValue() { { Collector, ?, ImmutableTable> @@ -119,6 +126,8 @@ public void testToImmutableTableMerging() { immutableCell("two", "dos", 4)); } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when rowFunction result (null) is unboxed + @J2ktIncompatible public void testToImmutableTableMergingNullRowKey() { Collector, ?, ImmutableTable> collector = toImmutableTable(t -> null, Cell::getColumnKey, Cell::getValue, Integer::sum); @@ -127,6 +136,9 @@ public void testToImmutableTableMergingNullRowKey() { () -> Stream.of(immutableCell("one", "uno", 1)).collect(collector)); } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when columnFunction result (null) is + // unboxed + @J2ktIncompatible public void testToImmutableTableMergingNullColumnKey() { Collector, ?, ImmutableTable> collector = toImmutableTable(Cell::getRowKey, t -> null, Cell::getValue, Integer::sum); @@ -135,6 +147,9 @@ public void testToImmutableTableMergingNullColumnKey() { () -> Stream.of(immutableCell("one", "uno", 1)).collect(collector)); } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when valueFunction result (null) is + // unboxed + @J2ktIncompatible public void testToImmutableTableMergingNullValue() { { Collector, ?, ImmutableTable> @@ -160,6 +175,9 @@ public void testToImmutableTableMergingNullValue() { } } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when mergeFunction result (null) is + // unboxed + @J2ktIncompatible public void testToImmutableTableMergingNullMerge() { Collector, ?, ImmutableTable> collector = toImmutableTable(Cell::getRowKey, Cell::getColumnKey, Cell::getValue, (v1, v2) -> null); @@ -188,6 +206,9 @@ public void testToTable() { immutableCell("three", "tres", 3)); } + // https://youtrack.jetbrains.com/issue/KT-58242/. Crash when mergeFunction result (null) is + // unboxed + @J2ktIncompatible public void testToTableNullMerge() { // TODO github.com/google/guava/issues/6824 - the null merge feature is not compatible with the // current nullness annotation of the mergeFunction parameter. Work around with casts.