-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The task of mapping a proto type to Java class was initially based on .properties files, which mapped a proto type name to a Java class name.
Then, we improved the generation, migrating to using descriptor set files, and building KnownTypes basing on them. It works better on the code generation side, but in order to unpack just one message from Any we need to load and build a very big thing.
We can probably do better, generating a Java class file which would have ImmutableMap from one string with a proto type name to another string to a Java class name. The name of the class would be a constant, which KnownTypes would use to load the class, and use its mapping for loading the classes.
There are may be other, better options. This issue was raised in the discussion of our Protobuf article for DOU (см. секцию «Собрание типов»).