From 38a196588c19408d7c9dba61ab3a149d8368ad57 Mon Sep 17 00:00:00 2001 From: ggikko Date: Sun, 26 Mar 2017 19:33:42 +0900 Subject: [PATCH 1/5] =?UTF-8?q?Fix=20wrong=20comments=20in=20Functions.jav?= =?UTF-8?q?a=20=E2=80=9CFunction3=E2=80=9D=20->=20=E2=80=9CBiFunction?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/io/reactivex/internal/functions/Functions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/reactivex/internal/functions/Functions.java b/src/main/java/io/reactivex/internal/functions/Functions.java index 5d562a8b76..ae68e17d56 100644 --- a/src/main/java/io/reactivex/internal/functions/Functions.java +++ b/src/main/java/io/reactivex/internal/functions/Functions.java @@ -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..Function9 instances to Function of Object array. */ public final class Functions { From 73a285da497e21785573a9ed1e4085a4feacb950 Mon Sep 17 00:00:00 2001 From: ggikko Date: Sun, 26 Mar 2017 19:53:41 +0900 Subject: [PATCH 2/5] =?UTF-8?q?Add=20=E2=80=9CtoFunction=E2=80=9D=20fail?= =?UTF-8?q?=20test=20from=20Bifurcation=20to=20Function9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/functions/FunctionsTest.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/test/java/io/reactivex/internal/functions/FunctionsTest.java b/src/test/java/io/reactivex/internal/functions/FunctionsTest.java index bea758be58..d4e351a8d1 100644 --- a/src/test/java/io/reactivex/internal/functions/FunctionsTest.java +++ b/src/test/java/io/reactivex/internal/functions/FunctionsTest.java @@ -169,6 +169,54 @@ public Integer apply(Integer t1, Integer t2, Integer t3, Integer t4, Integer t5, }).apply(new Object[20]); } + @Test(expected = NullPointerException.class) + public void biFunctionFail() throws Exception { + BiFunction biFunction = null; + Functions.toFunction(biFunction); + } + + @Test(expected = NullPointerException.class) + public void function3Fail() throws Exception { + Function3 function3 = null; + Functions.toFunction(function3); + } + + @Test(expected = NullPointerException.class) + public void function4Fail() throws Exception { + Function3 function4 = null; + Functions.toFunction(function4); + } + + @Test(expected = NullPointerException.class) + public void function5Fail() throws Exception { + Function3 function5 = null; + Functions.toFunction(function5); + } + + @Test(expected = NullPointerException.class) + public void function6Fail() throws Exception { + Function3 function6 = null; + Functions.toFunction(function6); + } + + @Test(expected = NullPointerException.class) + public void function7Fail() throws Exception { + Function3 function7 = null; + Functions.toFunction(function7); + } + + @Test(expected = NullPointerException.class) + public void function8Fail() throws Exception { + Function3 function8 = null; + Functions.toFunction(function8); + } + + @Test(expected = NullPointerException.class) + public void function9Fail() throws Exception { + Function3 function9 = null; + Functions.toFunction(function9); + } + @Test public void identityFunctionToString() { assertEquals("IdentityFunction", Functions.identity().toString()); From 03220b464d138ec634e0f13ed72b60fef5a7fd4a Mon Sep 17 00:00:00 2001 From: Jihong Park Date: Sun, 26 Mar 2017 19:57:39 +0900 Subject: [PATCH 3/5] Update FunctionsTest.java Fix interface naming --- .../reactivex/internal/functions/FunctionsTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/io/reactivex/internal/functions/FunctionsTest.java b/src/test/java/io/reactivex/internal/functions/FunctionsTest.java index d4e351a8d1..8c8a5439ad 100644 --- a/src/test/java/io/reactivex/internal/functions/FunctionsTest.java +++ b/src/test/java/io/reactivex/internal/functions/FunctionsTest.java @@ -183,37 +183,37 @@ public void function3Fail() throws Exception { @Test(expected = NullPointerException.class) public void function4Fail() throws Exception { - Function3 function4 = null; + Function4 function4 = null; Functions.toFunction(function4); } @Test(expected = NullPointerException.class) public void function5Fail() throws Exception { - Function3 function5 = null; + Function5 function5 = null; Functions.toFunction(function5); } @Test(expected = NullPointerException.class) public void function6Fail() throws Exception { - Function3 function6 = null; + Function6 function6 = null; Functions.toFunction(function6); } @Test(expected = NullPointerException.class) public void function7Fail() throws Exception { - Function3 function7 = null; + Function7 function7 = null; Functions.toFunction(function7); } @Test(expected = NullPointerException.class) public void function8Fail() throws Exception { - Function3 function8 = null; + Function8 function8 = null; Functions.toFunction(function8); } @Test(expected = NullPointerException.class) public void function9Fail() throws Exception { - Function3 function9 = null; + Function9 function9 = null; Functions.toFunction(function9); } From 00bd4c7689d68e88d254f5c12897f6db5d654a45 Mon Sep 17 00:00:00 2001 From: ggikko Date: Sun, 26 Mar 2017 20:16:32 +0900 Subject: [PATCH 4/5] =?UTF-8?q?Change=20comments=20=E2=80=9CBiFunction..Fu?= =?UTF-8?q?nction9=E2=80=9D=20-=20>=20=E2=80=9CBiFunction,=20Function3..Fu?= =?UTF-8?q?nction9=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/io/reactivex/internal/functions/Functions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/reactivex/internal/functions/Functions.java b/src/main/java/io/reactivex/internal/functions/Functions.java index ae68e17d56..b54694844f 100644 --- a/src/main/java/io/reactivex/internal/functions/Functions.java +++ b/src/main/java/io/reactivex/internal/functions/Functions.java @@ -24,7 +24,7 @@ import io.reactivex.schedulers.Timed; /** - * Utility methods to convert the BiFunction..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 { From 1524557678abbfd91c11512a2cd37da1f76f34d2 Mon Sep 17 00:00:00 2001 From: ggikko Date: Sun, 26 Mar 2017 20:17:03 +0900 Subject: [PATCH 5/5] Add @SuppressWarnings({"unchecked", "rawtypes"}) into Functions fail test --- .../io/reactivex/internal/functions/FunctionsTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/io/reactivex/internal/functions/FunctionsTest.java b/src/test/java/io/reactivex/internal/functions/FunctionsTest.java index 8c8a5439ad..872d09df15 100644 --- a/src/test/java/io/reactivex/internal/functions/FunctionsTest.java +++ b/src/test/java/io/reactivex/internal/functions/FunctionsTest.java @@ -169,48 +169,56 @@ 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;