Skip to content

Commit

Permalink
Fix wrong comments in Functions.java “Function3” -> “BiFunction” (#5230)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ggikko authored and akarnokd committed Mar 26, 2017
1 parent cd258e3 commit 7748fd5
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.reactivex.schedulers.Timed;

/**
* Utility methods to convert the Function3..Function9 instances to Function of Object array.
* Utility methods to convert the BiFunction, Function3..Function9 instances to Function of Object array.
*/
public final class Functions {

Expand Down
56 changes: 56 additions & 0 deletions src/test/java/io/reactivex/internal/functions/FunctionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,62 @@ public Integer apply(Integer t1, Integer t2, Integer t3, Integer t4, Integer t5,
}).apply(new Object[20]);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void biFunctionFail() throws Exception {
BiFunction biFunction = null;
Functions.toFunction(biFunction);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void function3Fail() throws Exception {
Function3 function3 = null;
Functions.toFunction(function3);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void function4Fail() throws Exception {
Function4 function4 = null;
Functions.toFunction(function4);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void function5Fail() throws Exception {
Function5 function5 = null;
Functions.toFunction(function5);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void function6Fail() throws Exception {
Function6 function6 = null;
Functions.toFunction(function6);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void function7Fail() throws Exception {
Function7 function7 = null;
Functions.toFunction(function7);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void function8Fail() throws Exception {
Function8 function8 = null;
Functions.toFunction(function8);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Test(expected = NullPointerException.class)
public void function9Fail() throws Exception {
Function9 function9 = null;
Functions.toFunction(function9);
}

@Test
public void identityFunctionToString() {
assertEquals("IdentityFunction", Functions.identity().toString());
Expand Down

0 comments on commit 7748fd5

Please sign in to comment.