From a9a7bc0097216696392d732f472effe5ff11d217 Mon Sep 17 00:00:00 2001 From: Marc Herman Date: Wed, 5 Jan 2022 18:42:52 +0100 Subject: [PATCH] Fix class cast exception defaultVal result can be of any type, not only JsonNode. --- .../java/com/github/fge/avro/translators/RecordTranslator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/fge/avro/translators/RecordTranslator.java b/src/main/java/com/github/fge/avro/translators/RecordTranslator.java index 467d5a8..3aa7d01 100644 --- a/src/main/java/com/github/fge/avro/translators/RecordTranslator.java +++ b/src/main/java/com/github/fge/avro/translators/RecordTranslator.java @@ -109,7 +109,7 @@ protected void doTranslate(final Schema avroSchema, private static void injectDefault(final ObjectNode propertyNode, final Schema.Field field) { - final JsonNode value = (JsonNode) field.defaultVal(); + final Object value = field.defaultVal(); if (value == null) return;