Description
The are two main problems with the generated build() method in specific record builders:
- For non-primitive types, if there is no default value and the user does not set the value, build() will execute successfully without throwing an exception
- Instead, an AvroRuntimeException should be thrown with an exception message indicating the name of the required field that was not set
- For primitive types, if there is no default value and the user does not set the value, an AvroRuntimeException is thrown with the 'cause' set to a NullPointerException, which is not very helpful
- The NPE comes from attempting to set the primitive field to the result of defaultValue(), which is null