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

jlmonteiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
     new 276658ed feat: char not properly handled as primitive to determine 
default value
276658ed is described below

commit 276658ed3be019f9635a8f3ceef6846e68ebe6ad
Author: Jean-Louis Monteiro <jlmonte...@tomitribe.com>
AuthorDate: Wed Oct 11 12:59:10 2023 +0200

    feat: char not properly handled as primitive to determine default value
    
    Signed-off-by: Jean-Louis Monteiro <jlmonte...@tomitribe.com>
---
 johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Mappings.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Mappings.java 
b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Mappings.java
index ac170a4b..77f172cc 100644
--- a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Mappings.java
+++ b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/Mappings.java
@@ -398,7 +398,9 @@ public class Mappings {
     }
 
     public static Object getPrimitiveDefault(final Type type) {
-        if (type == long.class) {
+        if (type == char.class) {
+            return '\u0000';
+        } else if (type == long.class) {
             return 0L;
         } else if (type == int.class) {
             return 0;

Reply via email to