commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [commons-lang] branch master updated: [LANG-1498] Add support of lambda value evaluation for defaulting methods #416.
Date Fri, 01 Nov 2019 04:04:06 GMT
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


The following commit(s) were added to refs/heads/master by this push:
     new a4c60c4  [LANG-1498] Add support of lambda value evaluation for defaulting methods
#416.
a4c60c4 is described below

commit a4c60c4e011afb6a8bf0c580390a64abb3663b72
Author: Gary Gregory <gardgregory@gmail.com>
AuthorDate: Fri Nov 1 00:04:02 2019 -0400

    [LANG-1498] Add support of lambda value evaluation for defaulting
    methods #416.
    
    Better param name.
---
 src/main/java/org/apache/commons/lang3/ObjectUtils.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
index 58f0b19..8b67d05 100644
--- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
@@ -170,12 +170,12 @@ public class ObjectUtils {
      *
      * @param <T> the type of the object
      * @param object  the {@code Object} to test, may be {@code null}
-     * @param defaultValueSupplier  the default value to return, may be {@code null}
+     * @param defaultSupplier  the default value to return, may be {@code null}
      * @return {@code object} if it is not {@code null}, {@code defaultValueSupplier.get()}
otherwise
      * @since 3.10
      */
-    public static <T> T defaultIfNull(final T object, final Supplier<T> defaultValueSupplier)
{
-        return object != null ? object : defaultValueSupplier == null ? null : defaultValueSupplier.get();
+    public static <T> T defaultIfNull(final T object, final Supplier<T> defaultSupplier)
{
+        return object != null ? object : defaultSupplier == null ? null : defaultSupplier.get();
     }
 
     /**


Mime
View raw message