You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/10/16 18:13:13 UTC

[commons-lang] branch master updated (9aad0f421 -> 88879df3a)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


    from 9aad0f421 Add Java 21 build to GitHub
     new 13839dae6 Add FailableSupplieSuppliersr.nul()
     new 6c61b0916 Add Suppliers.nul()
     new 6f799a1ae Better message for soft failure
     new 88879df3a Rename type parameter to match the stock Supplier

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                            |  2 ++
 .../org/apache/commons/lang3/SystemProperties.java |  6 ++--
 .../commons/lang3/function/FailableSupplier.java   | 33 ++++++++++++++++++++--
 .../apache/commons/lang3/function/Suppliers.java   | 24 ++++++++++++++++
 .../org/apache/commons/lang3/ObjectUtilsTest.java  | 25 ++++++++--------
 .../org/apache/commons/lang3/StringUtilsTest.java  |  5 ++--
 ...uppliersTest.java => FailableSupplierTest.java} | 32 ++++++++++++---------
 .../apache/commons/lang3/function/ObjectsTest.java |  4 +--
 .../commons/lang3/function/SuppliersTest.java      |  1 +
 .../time/FastDateParser_TimeZoneStrategyTest.java  | 11 ++++----
 10 files changed, 103 insertions(+), 40 deletions(-)
 copy src/test/java/org/apache/commons/lang3/function/{SuppliersTest.java => FailableSupplierTest.java} (61%)


[commons-lang] 02/04: Add Suppliers.nul()

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 6c61b0916ef77600d09c3e299498ce60058035a0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Oct 16 09:16:22 2023 -0400

    Add Suppliers.nul()
---
 src/changes/changes.xml                            |  1 +
 .../org/apache/commons/lang3/SystemProperties.java |  6 +++---
 .../apache/commons/lang3/function/Suppliers.java   | 24 +++++++++++++++++++++
 .../org/apache/commons/lang3/ObjectUtilsTest.java  | 25 +++++++++++-----------
 .../org/apache/commons/lang3/StringUtilsTest.java  |  5 +++--
 .../commons/lang3/function/SuppliersTest.java      |  1 +
 6 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1e48ea300..9ef8a801b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -73,6 +73,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action                   type="add" dev="ggregory" due-to="Benjamin Confino, Gary Gregory">Add ConcurrentInitializer#isInitialized() #1120.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add Streams.failableStream(T...).</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add FailableSupplier.nul().</action>
+    <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add Suppliers.nul().</action>
     <!-- UPDATE -->
     <action                   type="update" dev="ggregory" due-to="Gary Gregory">Bump commons-parent from 58 to 64.</action>
     <action                   type="update" dev="ggregory" due-to="Gary Gregory">Bump org.easymock:easymock from 5.1.0 to 5.2.0 #1104.</action>
diff --git a/src/main/java/org/apache/commons/lang3/SystemProperties.java b/src/main/java/org/apache/commons/lang3/SystemProperties.java
index 1e54f0fda..eaff144cb 100644
--- a/src/main/java/org/apache/commons/lang3/SystemProperties.java
+++ b/src/main/java/org/apache/commons/lang3/SystemProperties.java
@@ -22,6 +22,8 @@ import java.util.function.IntSupplier;
 import java.util.function.LongSupplier;
 import java.util.function.Supplier;
 
+import org.apache.commons.lang3.function.Suppliers;
+
 /**
  * Accesses current system property names and values.
  *
@@ -29,8 +31,6 @@ import java.util.function.Supplier;
  */
 public final class SystemProperties {
 
-    private static final Supplier<String> NULL_SUPPLIER = () -> null;
-
     /**
      * The System property name {@value}.
      */
@@ -752,7 +752,7 @@ public final class SystemProperties {
      * @return the system property value or {@code null} if a security problem occurs
      */
     public static String getProperty(final String property) {
-        return getProperty(property, NULL_SUPPLIER);
+        return getProperty(property, Suppliers.nul());
     }
 
     /**
diff --git a/src/main/java/org/apache/commons/lang3/function/Suppliers.java b/src/main/java/org/apache/commons/lang3/function/Suppliers.java
index 6467a4780..a19a1598d 100644
--- a/src/main/java/org/apache/commons/lang3/function/Suppliers.java
+++ b/src/main/java/org/apache/commons/lang3/function/Suppliers.java
@@ -26,6 +26,30 @@ import java.util.function.Supplier;
  */
 public class Suppliers {
 
+    /**
+     * Returns the singleton supplier that always returns null.
+     * <p>
+     * This supplier never throws an exception.
+     * </p>
+     */
+    @SuppressWarnings("rawtypes")
+    private static Supplier NUL = () -> null;
+
+    /**
+     * Returns the singleton supplier that always returns null.
+     * <p>
+     * This supplier never throws an exception.
+     * </p>
+     *
+     * @param <T> Supplied type.
+     * @return The NUL singleton.
+     * @since 3.14.0
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> Supplier<T> nul() {
+        return NUL;
+    }
+
     /**
      * Null-safe call to {@link Supplier#get()}.
      *
diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
index 15376767d..8f297918c 100644
--- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
@@ -47,6 +47,7 @@ import java.util.Set;
 import java.util.function.Supplier;
 
 import org.apache.commons.lang3.exception.CloneFailedException;
+import org.apache.commons.lang3.function.Suppliers;
 import org.apache.commons.lang3.mutable.MutableInt;
 import org.apache.commons.lang3.mutable.MutableObject;
 import org.apache.commons.lang3.text.StrBuilder;
@@ -479,14 +480,14 @@ public class ObjectUtilsTest extends AbstractLangTest {
     @Test
     public void testGetFirstNonNull() {
         // first non-null
-        assertEquals("", ObjectUtils.getFirstNonNull(() -> null, () -> ""));
+        assertEquals("", ObjectUtils.getFirstNonNull(Suppliers.nul(), () -> ""));
         // first encountered value is used
-        assertEquals("1", ObjectUtils.getFirstNonNull(() -> null, () -> "1", () -> "2", () -> null));
-        assertEquals("123", ObjectUtils.getFirstNonNull(() -> "123", () -> null, () -> "456"));
+        assertEquals("1", ObjectUtils.getFirstNonNull(Suppliers.nul(), () -> "1", () -> "2", Suppliers.nul()));
+        assertEquals("123", ObjectUtils.getFirstNonNull(() -> "123", Suppliers.nul(), () -> "456"));
         // don't evaluate suppliers after first value is found
-        assertEquals("123", ObjectUtils.getFirstNonNull(() -> null, () -> "123", () -> fail("Supplier after first non-null value should not be evaluated")));
+        assertEquals("123", ObjectUtils.getFirstNonNull(Suppliers.nul(), () -> "123", () -> fail("Supplier after first non-null value should not be evaluated")));
         // supplier returning null and null supplier both result in null
-        assertNull(ObjectUtils.getFirstNonNull(null, () -> null));
+        assertNull(ObjectUtils.getFirstNonNull(null, Suppliers.nul()));
         // Explicitly pass in an empty array of Object type to ensure compiler doesn't complain of unchecked generic array creation
         assertNull(ObjectUtils.getFirstNonNull());
         // supplier is null
@@ -494,8 +495,8 @@ public class ObjectUtilsTest extends AbstractLangTest {
         // varargs array itself is null
         assertNull(ObjectUtils.getFirstNonNull((Supplier<Object>[]) null));
         // test different types
-        assertEquals(1, ObjectUtils.getFirstNonNull(() -> null, () -> 1));
-        assertEquals(Boolean.TRUE, ObjectUtils.getFirstNonNull(() -> null, () -> Boolean.TRUE));
+        assertEquals(1, ObjectUtils.getFirstNonNull(Suppliers.nul(), () -> 1));
+        assertEquals(Boolean.TRUE, ObjectUtils.getFirstNonNull(Suppliers.nul(), () -> Boolean.TRUE));
     }
 
     @Test
@@ -849,7 +850,7 @@ public class ObjectUtilsTest extends AbstractLangTest {
     @Test
     public void testToString_String_Supplier() {
         assertNull(ObjectUtils.toString(null, (Supplier<String>) null));
-        assertNull(ObjectUtils.toString(null, () -> null));
+        assertNull(ObjectUtils.toString(null, Suppliers.nul()));
         // Pretend computing BAR is expensive.
         assertEquals(BAR, ObjectUtils.toString(null, () -> BAR));
         assertEquals(Boolean.TRUE.toString(), ObjectUtils.toString(Boolean.TRUE, () -> BAR));
@@ -858,12 +859,12 @@ public class ObjectUtilsTest extends AbstractLangTest {
     @Test
     public void testToString_Supplier_Supplier() {
         assertNull(ObjectUtils.toString(NULL_SUPPLIER, (Supplier<String>) null));
-        assertNull(ObjectUtils.toString(() -> null, (Supplier<String>) null));
-        assertNull(ObjectUtils.toString(NULL_SUPPLIER, () -> null));
-        assertNull(ObjectUtils.toString(() -> null, () -> null));
+        assertNull(ObjectUtils.toString(Suppliers.nul(), (Supplier<String>) null));
+        assertNull(ObjectUtils.toString(NULL_SUPPLIER, Suppliers.nul()));
+        assertNull(ObjectUtils.toString(Suppliers.nul(), Suppliers.nul()));
         // Pretend computing BAR is expensive.
         assertEquals(BAR, ObjectUtils.toString(NULL_SUPPLIER, () -> BAR));
-        assertEquals(BAR, ObjectUtils.toString(() -> null, () -> BAR));
+        assertEquals(BAR, ObjectUtils.toString(Suppliers.nul(), () -> BAR));
         assertEquals(Boolean.TRUE.toString(), ObjectUtils.toString(() -> Boolean.TRUE, () -> BAR));
     }
 
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
index bc5aeef80..438dfe5ce 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
@@ -42,6 +42,7 @@ import java.util.Objects;
 import java.util.function.Supplier;
 import java.util.regex.PatternSyntaxException;
 
+import org.apache.commons.lang3.function.Suppliers;
 import org.apache.commons.lang3.mutable.MutableInt;
 import org.apache.commons.lang3.text.WordUtils;
 import org.junit.jupiter.api.Disabled;
@@ -682,7 +683,7 @@ public class StringUtilsTest extends AbstractLangTest {
         assertEquals("NULL", StringUtils.getIfBlank("",  () -> "NULL"));
         assertEquals("NULL", StringUtils.getIfBlank(" ", () -> "NULL"));
         assertEquals("abc", StringUtils.getIfBlank("abc", () -> "NULL"));
-        assertNull(StringUtils.getIfBlank("", () -> null));
+        assertNull(StringUtils.getIfBlank("", Suppliers.nul()));
         assertNull(StringUtils.defaultIfBlank("", (String) null));
         // Tests compatibility for the API return type
         final String s = StringUtils.getIfBlank("abc", () -> "NULL");
@@ -750,7 +751,7 @@ public class StringUtilsTest extends AbstractLangTest {
         assertEquals("NULL", StringUtils.getIfEmpty((String) null, () -> "NULL"));
         assertEquals("NULL", StringUtils.getIfEmpty("", () -> "NULL"));
         assertEquals("abc", StringUtils.getIfEmpty("abc", () -> "NULL"));
-        assertNull(StringUtils.getIfEmpty("", () -> null));
+        assertNull(StringUtils.getIfEmpty("", Suppliers.nul()));
         assertNull(StringUtils.defaultIfEmpty("", (String) null));
         // Tests compatibility for the API return type
         final String s = StringUtils.getIfEmpty("abc", () -> "NULL");
diff --git a/src/test/java/org/apache/commons/lang3/function/SuppliersTest.java b/src/test/java/org/apache/commons/lang3/function/SuppliersTest.java
index 1c912757c..ec5a1faec 100644
--- a/src/test/java/org/apache/commons/lang3/function/SuppliersTest.java
+++ b/src/test/java/org/apache/commons/lang3/function/SuppliersTest.java
@@ -37,6 +37,7 @@ public class SuppliersTest extends AbstractLangTest {
     public void testGet() {
         assertNull(Suppliers.get(null));
         assertNull(Suppliers.get(() -> null));
+        assertNull(Suppliers.get(Suppliers.nul()));
         assertEquals("foo", Suppliers.get(() -> "foo"));
     }
 }


[commons-lang] 01/04: Add FailableSupplieSuppliersr.nul()

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 13839dae6ef46f46023b3c489830fc25c0075aaf
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Oct 16 09:14:44 2023 -0400

    Add FailableSupplieSuppliersr.nul()
---
 src/changes/changes.xml                            |  1 +
 .../commons/lang3/function/FailableSupplier.java   | 27 ++++++++++++++
 .../lang3/function/FailableSupplierTest.java}      | 41 +++++++++++++---------
 .../apache/commons/lang3/function/ObjectsTest.java |  4 +--
 4 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d7f1ef721..1e48ea300 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -72,6 +72,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add LazyInitializer.isInitialized().</action>
     <action                   type="add" dev="ggregory" due-to="Benjamin Confino, Gary Gregory">Add ConcurrentInitializer#isInitialized() #1120.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add Streams.failableStream(T...).</action>
+    <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add FailableSupplier.nul().</action>
     <!-- UPDATE -->
     <action                   type="update" dev="ggregory" due-to="Gary Gregory">Bump commons-parent from 58 to 64.</action>
     <action                   type="update" dev="ggregory" due-to="Gary Gregory">Bump org.easymock:easymock from 5.1.0 to 5.2.0 #1104.</action>
diff --git a/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java b/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
index 6f80af546..c4ad522f4 100644
--- a/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
+++ b/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
@@ -29,6 +29,33 @@ import java.util.function.Supplier;
 @FunctionalInterface
 public interface FailableSupplier<R, E extends Throwable> {
 
+    /**
+     * Returns the singleton supplier that always returns null.
+     * <p>
+     * This supplier never throws an exception.
+     * </p>
+     *
+     * @since 3.14.0
+     */
+    @SuppressWarnings("rawtypes")
+    FailableSupplier NUL = () -> null;
+
+    /**
+     * Returns the singleton supplier that always returns null.
+     * <p>
+     * This supplier never throws an exception.
+     * </p>
+     *
+     * @param <T> Supplied type.
+     * @param <E> The kind of thrown exception or error.
+     * @return The NUL singleton.
+     * @since 3.14.0
+     */
+    @SuppressWarnings("unchecked")
+    static <T, E extends Exception> FailableSupplier<T, E> nul() {
+        return NUL;
+    }
+
     /**
      * Supplies an object
      *
diff --git a/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java b/src/test/java/org/apache/commons/lang3/function/FailableSupplierTest.java
similarity index 54%
copy from src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
copy to src/test/java/org/apache/commons/lang3/function/FailableSupplierTest.java
index 6f80af546..646205252 100644
--- a/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
+++ b/src/test/java/org/apache/commons/lang3/function/FailableSupplierTest.java
@@ -17,23 +17,32 @@
 
 package org.apache.commons.lang3.function;
 
-import java.util.function.Supplier;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+import org.junit.jupiter.api.Test;
 
 /**
- * A functional interface like {@link Supplier} that declares a {@link Throwable}.
- *
- * @param <R> Return type.
- * @param <E> The kind of thrown exception or error.
- * @since 3.11
+ * Tests {@link FailableSupplier}.
  */
-@FunctionalInterface
-public interface FailableSupplier<R, E extends Throwable> {
-
-    /**
-     * Supplies an object
-     *
-     * @return a result
-     * @throws E if the supplier fails
-     */
-    R get() throws E;
+public class FailableSupplierTest {
+
+    @Test
+    public void testNULL() throws Throwable {
+        assertNull(FailableSupplier.NUL.get());
+    }
+
+    @Test
+    public void testNullSupplierDefaultException() throws Exception {
+        assertNull(FailableSupplier.nul().get());
+    }
+
+    @Test
+    public void testNullSupplierException() throws Exception {
+        assertNull(FailableSupplier.<Object, Exception>nul().get());
+    }
+
+    @Test
+    public void testNullSupplierRuntimeException() {
+        assertNull(FailableSupplier.<Object, RuntimeException>nul().get());
+    }
 }
diff --git a/src/test/java/org/apache/commons/lang3/function/ObjectsTest.java b/src/test/java/org/apache/commons/lang3/function/ObjectsTest.java
index 36788830e..19e623431 100755
--- a/src/test/java/org/apache/commons/lang3/function/ObjectsTest.java
+++ b/src/test/java/org/apache/commons/lang3/function/ObjectsTest.java
@@ -81,7 +81,7 @@ public class ObjectsTest extends AbstractLangTest {
 
     @Test
     void testRequireNonNullObjectFailableSupplierString() {
-        final TestableFailableSupplier<String, ?> supplier = new TestableFailableSupplier<>(() -> null);
+        final TestableFailableSupplier<String, ?> supplier = new TestableFailableSupplier<>(FailableSupplier.nul());
         assertSame("foo", Objects.requireNonNull("foo", supplier));
         assertFalse(supplier.isInvoked());
         try {
@@ -91,7 +91,7 @@ public class ObjectsTest extends AbstractLangTest {
             assertEquals("The supplier must not return null.", e.getMessage());
             assertTrue(supplier.isInvoked());
         }
-        final TestableFailableSupplier<String, ?> supplier2 = new TestableFailableSupplier<>(() -> null);
+        final TestableFailableSupplier<String, ?> supplier2 = new TestableFailableSupplier<>(FailableSupplier.nul());
         try {
             Objects.requireNonNull(null, supplier2);
             fail("Expected Exception");


[commons-lang] 03/04: Better message for soft failure

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 6f799a1aeb2dce54037d57b955dd69d04cc132f9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Oct 16 09:43:38 2023 -0400

    Better message for soft failure
---
 .../lang3/time/FastDateParser_TimeZoneStrategyTest.java       | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
index bcfbadd91..c46498caf 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
@@ -45,10 +45,10 @@ import org.junitpioneer.jupiter.DefaultTimeZone;
 import org.junitpioneer.jupiter.ReadsDefaultLocale;
 import org.junitpioneer.jupiter.ReadsDefaultTimeZone;
 
-/* make test reproducible */ @DefaultLocale(language = "en")
-/* make test reproducible */ @DefaultTimeZone(TimeZones.GMT_ID)
-/* make test reproducible */ @ReadsDefaultLocale
-/* make test reproducible */ @ReadsDefaultTimeZone
+/* Make test reproducible */ @DefaultLocale(language = "en")
+/* Make test reproducible */ @DefaultTimeZone(TimeZones.GMT_ID)
+/* Make test reproducible */ @ReadsDefaultLocale
+/* Make test reproducible */ @ReadsDefaultTimeZone
 public class FastDateParser_TimeZoneStrategyTest extends AbstractLangTest {
 
     private static final List<Locale> Java11Failures = new ArrayList<>();
@@ -136,7 +136,8 @@ public class FastDateParser_TimeZoneStrategyTest extends AbstractLangTest {
                         Java11Failures.add(locale);
                         // Mark as an assumption failure instead of a hard fail
                         System.err.printf(
-                                "Java %s - Mark as an assumption failure instead of a hard fail: locale = '%s', parse = '%s'%n",
+                                "Java %s %s - Mark as an assumption failure instead of a hard fail: locale = '%s', parse = '%s'%n",
+                                SystemUtils.JAVA_VENDOR,
                                 SystemUtils.JAVA_VERSION,
                                 localeStr, tzDisplay);
                         assumeTrue(false, localeStr);


[commons-lang] 04/04: Rename type parameter to match the stock Supplier

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 88879df3a9ba47d597f2620c1a72befcb5c69711
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Oct 16 10:36:54 2023 -0400

    Rename type parameter to match the stock Supplier
---
 .../java/org/apache/commons/lang3/function/FailableSupplier.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java b/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
index c4ad522f4..6b12de3c0 100644
--- a/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
+++ b/src/main/java/org/apache/commons/lang3/function/FailableSupplier.java
@@ -22,12 +22,12 @@ import java.util.function.Supplier;
 /**
  * A functional interface like {@link Supplier} that declares a {@link Throwable}.
  *
- * @param <R> Return type.
+ * @param <T> Return type.
  * @param <E> The kind of thrown exception or error.
  * @since 3.11
  */
 @FunctionalInterface
-public interface FailableSupplier<R, E extends Throwable> {
+public interface FailableSupplier<T, E extends Throwable> {
 
     /**
      * Returns the singleton supplier that always returns null.
@@ -62,5 +62,5 @@ public interface FailableSupplier<R, E extends Throwable> {
      * @return a result
      * @throws E if the supplier fails
      */
-    R get() throws E;
+    T get() throws E;
 }