Remove test calls to registerSchemaOverride from BinaryProtocolTest. #23760
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove test calls to registerSchemaOverride from BinaryProtocolTest.
I don't think it's necessary. If we don't register the schema, it's lazily created later in Protobuf.schemaFor anyway: http://google3/third_party/java_src/protobuf/current/java/com/google/protobuf/Protobuf.java;l=67-70;rcl=793795963
The test still passes without this. I think this setUp is vestigial.
TestSchemas and Protobuf.schemaFor both use equivalent factories (
new ManifestSchemaFactory()
) to create these anyway:I'm trying to limit calls to registerSchemaOverride to see if we can remove it and make future usages of ClassValue inside Protobuf easier.
Also, registerSchemaOverride is not used by production code, so using it here makes the test less representative of production workloads.
History: this was added in 2016: https://critique.corp.google.com/cl/129882307/depot/google3/javatests/com/google/frameworks/protobuf/experimental/testing/BinaryProtocolTest.java
Back then, the Protobuf constructor chose different schema factories depending on platform: http://google3/third_party/java_src/protobuf/current/java/com/google/protobuf/Protobuf.java;l=93-110;drf=google3%2Fjava%2Fcom%2Fgoogle%2Fframeworks%2Fprotobuf%2Fexperimental%2FProtobuf.java;rcl=128834824.
This is not the case any more. This code was removed in cl/218868944.