markap14 commented on a change in pull request #4120: NIFI-7221 Support v2/v3
protocols with HWX Schema Registry
URL: https://github.com/apache/nifi/pull/4120#discussion_r395198033
##########
File path:
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/StandardSchemaIdentifier.java
##########
@@ -25,15 +25,18 @@
private final Optional<String> name;
private final OptionalLong identifier;
private final OptionalInt version;
+ private final OptionalLong schemaVersionId;
private final Optional<String> branch;
- StandardSchemaIdentifier(final String name, final Long identifier, final
Integer version, final String branch) {
+ StandardSchemaIdentifier(final String name, final Long identifier, final
Integer version,
+ final Long schemaVersionId, final String branch) {
this.name = Optional.ofNullable(name);
- this.identifier = identifier == null ? OptionalLong.empty() :
OptionalLong.of(identifier);;
- this.version = version == null ? OptionalInt.empty() :
OptionalInt.of(version);;
+ this.identifier = identifier == null ? OptionalLong.empty() :
OptionalLong.of(identifier);
+ this.version = version == null ? OptionalInt.empty() :
OptionalInt.of(version);
+ this.schemaVersionId = schemaVersionId == null ? OptionalLong.empty()
: OptionalLong.of(schemaVersionId);
this.branch = Optional.ofNullable(branch);
- if (this.name == null && this.identifier == null) {
+ if ((this.name == null && this.identifier == null) ||
this.schemaVersionId == null) {
Review comment:
This logic seems to be off a bit. It indicates that `this.schemaVersionId`
cannot be null. And either `this.name` or `this.identifier` cannot be null. But
none of them can be null because they are set to Optional objects above...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services