Skip to content

Commit 7748fd5

Browse files
ggikkoakarnokd
authored andcommitted
Fix wrong comments in Functions.java “Function3” -> “BiFunction” (#5230)
* Fix wrong comments in Functions.java “Function3” -> “BiFunction” * Add “toFunction” fail test from Bifurcation to Function9 * Update FunctionsTest.java Fix interface naming * Change comments “BiFunction..Function9” - > “BiFunction, Function3..Function9” * Add @SuppressWarnings({"unchecked", "rawtypes"}) into Functions fail test
1 parent cd258e3 commit 7748fd5

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

src/main/java/io/reactivex/internal/functions/Functions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import io.reactivex.schedulers.Timed;
2525

2626
/**
27-
* Utility methods to convert the Function3..Function9 instances to Function of Object array.
27+
* Utility methods to convert the BiFunction, Function3..Function9 instances to Function of Object array.
2828
*/
2929
public final class Functions {
3030

src/test/java/io/reactivex/internal/functions/FunctionsTest.java

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,62 @@ public Integer apply(Integer t1, Integer t2, Integer t3, Integer t4, Integer t5,
169169
}).apply(new Object[20]);
170170
}
171171

172+
@SuppressWarnings({"unchecked", "rawtypes"})
173+
@Test(expected = NullPointerException.class)
174+
public void biFunctionFail() throws Exception {
175+
BiFunction biFunction = null;
176+
Functions.toFunction(biFunction);
177+
}
178+
179+
@SuppressWarnings({"unchecked", "rawtypes"})
180+
@Test(expected = NullPointerException.class)
181+
public void function3Fail() throws Exception {
182+
Function3 function3 = null;
183+
Functions.toFunction(function3);
184+
}
185+
186+
@SuppressWarnings({"unchecked", "rawtypes"})
187+
@Test(expected = NullPointerException.class)
188+
public void function4Fail() throws Exception {
189+
Function4 function4 = null;
190+
Functions.toFunction(function4);
191+
}
192+
193+
@SuppressWarnings({"unchecked", "rawtypes"})
194+
@Test(expected = NullPointerException.class)
195+
public void function5Fail() throws Exception {
196+
Function5 function5 = null;
197+
Functions.toFunction(function5);
198+
}
199+
200+
@SuppressWarnings({"unchecked", "rawtypes"})
201+
@Test(expected = NullPointerException.class)
202+
public void function6Fail() throws Exception {
203+
Function6 function6 = null;
204+
Functions.toFunction(function6);
205+
}
206+
207+
@SuppressWarnings({"unchecked", "rawtypes"})
208+
@Test(expected = NullPointerException.class)
209+
public void function7Fail() throws Exception {
210+
Function7 function7 = null;
211+
Functions.toFunction(function7);
212+
}
213+
214+
@SuppressWarnings({"unchecked", "rawtypes"})
215+
@Test(expected = NullPointerException.class)
216+
public void function8Fail() throws Exception {
217+
Function8 function8 = null;
218+
Functions.toFunction(function8);
219+
}
220+
221+
@SuppressWarnings({"unchecked", "rawtypes"})
222+
@Test(expected = NullPointerException.class)
223+
public void function9Fail() throws Exception {
224+
Function9 function9 = null;
225+
Functions.toFunction(function9);
226+
}
227+
172228
@Test
173229
public void identityFunctionToString() {
174230
assertEquals("IdentityFunction", Functions.identity().toString());

0 commit comments

Comments
 (0)