opwvhk commented on code in PR #1776:
URL: https://github.com/apache/avro/pull/1776#discussion_r927604195
##########
lang/java/avro/src/main/java/org/apache/avro/Schema.java:
##########
@@ -345,6 +379,9 @@ public String getFullName() {
return getName();
}
+ public void terminateInit() {
Review Comment:
Ah, sort of like how the fields are marked immutable once set for the first
time? (and any field use before they are set yields an exception)
How about this idea:
1. in the constructor, mark if the record schema will have children (if the
parameter is omitted, it will not)
2. have a method where you can set all child schemata, once
This behaves like `setFields`: it allows us both to finalise initialisation
and makes the schema unusable for (de)serialisation until the child schemata
have been set (so it cannot be forgotten).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]