aymkhalil commented on code in PR #20104:
URL: https://github.com/apache/pulsar/pull/20104#discussion_r1167159803
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java:
##########
@@ -39,17 +42,20 @@ public class GenericJsonRecord extends
VersionedGenericRecord {
private final JsonNode jn;
private final SchemaInfo schemaInfo;
- GenericJsonRecord(byte[] schemaVersion,
- List<Field> fields,
- JsonNode jn) {
+ GenericJsonRecord(byte[] schemaVersion, List<Field> fields, JsonNode jn) {
this(schemaVersion, fields, jn, null);
}
- public GenericJsonRecord(byte[] schemaVersion,
- List<Field> fields,
- JsonNode jn, SchemaInfo schemaInfo) {
+ @SneakyThrows
+ public GenericJsonRecord(byte[] schemaVersion, List<Field> fields,
JsonNode jn, SchemaInfo schemaInfo) {
super(schemaVersion, fields);
- this.jn = jn;
+ if (schemaInfo == null) {
Review Comment:
I wonder if we should just mark schemaInfo @NonNull - it seems
GenericJsonRecord is only meant to be used with Schema (otherwise, we open the
door for schema/java type mismatch).
--
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]