Skip to content

Commit

Permalink
use Array.equals
Browse files Browse the repository at this point in the history
Signed-off-by: Shivesh Ranjan <[email protected]>
  • Loading branch information
shiveshr committed Jul 31, 2020
1 parent bd3b6a9 commit d26043a
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.AbstractMap;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -1003,7 +1004,20 @@ boolean compareNormalized(SchemaInfo schemaInfo) {
Preconditions.checkNotNull(schemaInfo, "Supply non null Schemainfo.");
return schemaInfo.getType().equals(normalized.getType()) &&
schemaInfo.getSerializationFormat().equals(normalized.getSerializationFormat()) &&
normalizeSchemaBinary(schemaInfo).parsedSchema.equals(this.parsedSchema);
compareParsedSchemas(schemaInfo);
}

private boolean compareParsedSchemas(SchemaInfo schemaInfo) {
switch (schemaInfo.getSerializationFormat()) {
case Avro:
case Protobuf:
case Json:
return normalizeSchemaBinary(schemaInfo).parsedSchema.equals(this.parsedSchema);
case Any:
case Custom:
default:
return Arrays.equals(schemaInfo.getSchemaData().array(), this.normalized.getSchemaData().array());
}
}
}
}

0 comments on commit d26043a

Please sign in to comment.