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-validator.git


The following commit(s) were added to refs/heads/master by this push:
     new db77cde7 Use Objects.toString()
db77cde7 is described below

commit db77cde7582c56bd694321b786542e52e22a4ff2
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Jun 11 10:59:11 2024 -0400

    Use Objects.toString()
---
 .../java/org/apache/commons/validator/routines/ISBNValidator.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java 
b/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
index 6784159e..6bec772e 100644
--- a/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
@@ -17,6 +17,7 @@
 package org.apache.commons.validator.routines;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 import org.apache.commons.validator.routines.checkdigit.CheckDigitException;
 import org.apache.commons.validator.routines.checkdigit.EAN13CheckDigit;
@@ -247,7 +248,7 @@ public class ISBNValidator implements Serializable {
      */
     public String validateISBN10(final String code) {
         final Object result = isbn10Validator.validate(code);
-        return result == null ? null : result.toString();
+        return Objects.toString(result, null);
     }
 
     /**
@@ -262,7 +263,7 @@ public class ISBNValidator implements Serializable {
      */
     public String validateISBN13(final String code) {
         final Object result = isbn13Validator.validate(code);
-        return result == null ? null : result.toString();
+        return Objects.toString(result, null);
     }
 
 }

Reply via email to