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

opwvhk pushed a commit to branch branch-1.12
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/branch-1.12 by this push:
     new 58378c5e5e AVRO-4027: Fix missing bits in branch
58378c5e5e is described below

commit 58378c5e5ec897c15cdf24c4592a9e026ee89a2f
Author: Oscar Westra van Holthe - Kind <[email protected]>
AuthorDate: Sat Jun 14 11:39:14 2025 +0200

    AVRO-4027: Fix missing bits in branch
---
 lang/java/compiler/src/test/idl/input/simple.avdl  | 3 +++
 lang/java/compiler/src/test/idl/output/simple.avpr | 8 ++++++++
 lang/java/idl/src/test/idl/input/simple.avdl       | 3 +++
 3 files changed, 14 insertions(+)

diff --git a/lang/java/compiler/src/test/idl/input/simple.avdl 
b/lang/java/compiler/src/test/idl/input/simple.avdl
index 715bbd07d7..3af0daa671 100644
--- a/lang/java/compiler/src/test/idl/input/simple.avdl
+++ b/lang/java/compiler/src/test/idl/input/simple.avdl
@@ -65,6 +65,9 @@ protocol Simple {
     @foo.bar.bar("foo.bar2") array<string> a = [];
     // An optional type with a null default value (results in a union with 
null first).
     @foo.foo.bar(42) @foo.foo.foo("3foo") string? prop = null;
+    // Arrays and maps can have empty defaults
+    array<int> numbers = [];
+    map<string> dictionary = {};
   }
 
   /** An MD5 hash. */
diff --git a/lang/java/compiler/src/test/idl/output/simple.avpr 
b/lang/java/compiler/src/test/idl/output/simple.avpr
index 0ec9edb4c2..004e32480d 100644
--- a/lang/java/compiler/src/test/idl/output/simple.avpr
+++ b/lang/java/compiler/src/test/idl/output/simple.avpr
@@ -78,6 +78,14 @@
       "name": "prop",
       "type": [ "null" , {"type":"string", "foo.foo.bar": 42, "foo.foo.foo": 
"3foo"} ],
       "default": null
+    }, {
+      "name": "numbers",
+      "type": {"type": "array", "items": "int"},
+      "default": []
+    }, {
+      "name": "dictionary",
+      "type": {"type": "map", "values": "string"},
+      "default": {}
     }],
     "my-property" : {
       "key" : 3
diff --git a/lang/java/idl/src/test/idl/input/simple.avdl 
b/lang/java/idl/src/test/idl/input/simple.avdl
index 27949547a1..a2dd5e2f42 100644
--- a/lang/java/idl/src/test/idl/input/simple.avdl
+++ b/lang/java/idl/src/test/idl/input/simple.avdl
@@ -65,6 +65,9 @@ protocol Simple {
     @foo.bar.bar("foo.bar2") array<string> a = [];
     // An optional type with a null default value (results in a union with 
null first).
     @foo.foo.bar(42) @foo.foo.foo("3foo") string? prop = null;
+    // Arrays and maps can have empty defaults
+    array<int> numbers = [];
+    map<string> dictionary = {};
   }
 
   /** An MD5 hash. */

Reply via email to