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

doebele pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git


The following commit(s) were added to refs/heads/master by this push:
     new b814d53  EMPIREDB-346 fix
b814d53 is described below

commit b814d53de8bf6fa9ba689e2916581d228403d0e3
Author: Rainer Döbele <[email protected]>
AuthorDate: Thu Apr 29 10:23:55 2021 +0200

    EMPIREDB-346
    fix
---
 .../src/main/java/org/apache/empire/commons/ObjectUtils.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/empire-db/src/main/java/org/apache/empire/commons/ObjectUtils.java 
b/empire-db/src/main/java/org/apache/empire/commons/ObjectUtils.java
index 30ba80c..831d448 100644
--- a/empire-db/src/main/java/org/apache/empire/commons/ObjectUtils.java
+++ b/empire-db/src/main/java/org/apache/empire/commons/ObjectUtils.java
@@ -573,16 +573,18 @@ public final class ObjectUtils
      */
     public static String getString(Object value)
     {
-        if (value==null || (value instanceof String))
+        if (value==null)
+            return null;
+        if (value instanceof String)
             return (String)value;
         // convert
+        if (value==NO_VALUE)
+            throw new NotSupportedException(value, "getString");
         if (value instanceof Enum<?>)
             return getString((Enum<?>)value);
         if (value instanceof Date)
             return formatDate((Date)value, true);
-        if (value==NO_VALUE)
-            return null;
-        // toString
+        // default
         return value.toString();
     }
     

Reply via email to