Class DescriptorMessageInfoFactory.IsInitializedCheckAnalyzer

java.lang.Object
com.google.protobuf.DescriptorMessageInfoFactory.IsInitializedCheckAnalyzer
Enclosing class:
DescriptorMessageInfoFactory

static class DescriptorMessageInfoFactory.IsInitializedCheckAnalyzer extends Object
A helper class to determine whether a message type needs to implement isInitialized().

If a message type doesn't have any required fields or extensions (directly and transitively), it doesn't need to implement isInitialized() and can always return true there. It's a bit tricky to determine whether a type has transitive required fields because protobuf allows cycle references within the same .proto file (e.g., message Foo has a Bar field, and message Bar has a Foo field). For that we use Tarjan's strongly connected components algorithm to classify messages into strongly connected groups. Messages in the same group are transitively including each other, so they should either all have transitive required fields (or extensions), or none have.

This class is thread-safe.