Skip to content

Commit ba42c96

Browse files
java-team-github-botGoogle Java Core Libraries
authored andcommitted
Update TableCollectorsTest for compatibility with J2KT.
PiperOrigin-RevId: 729184487
1 parent 60ba1ab commit ba42c96

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

guava-tests/test/com/google/common/collect/TableCollectorsTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public void testToImmutableTableConflict() {
6666
.collect(collector));
6767
}
6868

69+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when rowFunction result (null) is unboxed
70+
@J2ktIncompatible
6971
public void testToImmutableTableNullRowKey() {
7072
Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>> collector =
7173
toImmutableTable(t -> null, Cell::getColumnKey, Cell::getValue);
@@ -74,6 +76,9 @@ public void testToImmutableTableNullRowKey() {
7476
() -> Stream.of(immutableCell("one", "uno", 1)).collect(collector));
7577
}
7678

79+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when columnFunction result (null) is
80+
// unboxed
81+
@J2ktIncompatible
7782
public void testToImmutableTableNullColumnKey() {
7883
Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>> collector =
7984
toImmutableTable(Cell::getRowKey, t -> null, Cell::getValue);
@@ -82,6 +87,8 @@ public void testToImmutableTableNullColumnKey() {
8287
() -> Stream.of(immutableCell("one", "uno", 1)).collect(collector));
8388
}
8489

90+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when getValue result (null) is unboxed
91+
@J2ktIncompatible
8592
public void testToImmutableTableNullValue() {
8693
{
8794
Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>>
@@ -119,6 +126,8 @@ public void testToImmutableTableMerging() {
119126
immutableCell("two", "dos", 4));
120127
}
121128

129+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when rowFunction result (null) is unboxed
130+
@J2ktIncompatible
122131
public void testToImmutableTableMergingNullRowKey() {
123132
Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>> collector =
124133
toImmutableTable(t -> null, Cell::getColumnKey, Cell::getValue, Integer::sum);
@@ -127,6 +136,9 @@ public void testToImmutableTableMergingNullRowKey() {
127136
() -> Stream.of(immutableCell("one", "uno", 1)).collect(collector));
128137
}
129138

139+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when columnFunction result (null) is
140+
// unboxed
141+
@J2ktIncompatible
130142
public void testToImmutableTableMergingNullColumnKey() {
131143
Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>> collector =
132144
toImmutableTable(Cell::getRowKey, t -> null, Cell::getValue, Integer::sum);
@@ -135,6 +147,9 @@ public void testToImmutableTableMergingNullColumnKey() {
135147
() -> Stream.of(immutableCell("one", "uno", 1)).collect(collector));
136148
}
137149

150+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when valueFunction result (null) is
151+
// unboxed
152+
@J2ktIncompatible
138153
public void testToImmutableTableMergingNullValue() {
139154
{
140155
Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>>
@@ -160,6 +175,9 @@ public void testToImmutableTableMergingNullValue() {
160175
}
161176
}
162177

178+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when mergeFunction result (null) is
179+
// unboxed
180+
@J2ktIncompatible
163181
public void testToImmutableTableMergingNullMerge() {
164182
Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>> collector =
165183
toImmutableTable(Cell::getRowKey, Cell::getColumnKey, Cell::getValue, (v1, v2) -> null);
@@ -188,6 +206,9 @@ public void testToTable() {
188206
immutableCell("three", "tres", 3));
189207
}
190208

209+
// https://youtrack.jetbrains.com/issue/KT-58242/. Crash when mergeFunction result (null) is
210+
// unboxed
211+
@J2ktIncompatible
191212
public void testToTableNullMerge() {
192213
// TODO github.com/google/guava/issues/6824 - the null merge feature is not compatible with the
193214
// current nullness annotation of the mergeFunction parameter. Work around with casts.

0 commit comments

Comments
 (0)