Remove buggy memoization. Memoization also is too fragile for the api
because the repeated field is public.
Change-Id: I538b8426d274b22df2eeea5935023abbe7df49fe
Imported source files may have different values for the 'java_multiple_files'
option to the main source file's. Whether the fully qualified Java name of an
entity should include the outer class name depends on the flag value in the
file defining the referenced entity, not the main file. This CL loads the
flag values from the main and all transitively imported files into the params,
and generates the fully qualified Java names accordingly.
If the generator option 'java_multiple_files' is set, its value overrides any
in-file values in all source/imported files. This is because this generator
option is typically used on either none or all source files.
Change-Id: Id6a4a42426d68961dc669487d38f35530deb7d8e
Adds support for default values of NaN, infinity and negative
infinity for floats and doubles in both the nano and micro
java compiler.
Change-Id: Ibc43e5ebb073e51d9a8181f3aa23b72e10015dca
You can now do:
MyMessage foo = MessageNano.mergeFrom(new MyMessage(), bytes);
without having to cast the message returned from mergeFrom.
Change-Id: Ibb2ad327f75855d45352ad304c7f054f20dd29c9
You can use the processor option store_unknown_fields to switch
this support on:
aprotoc --javanano_out=store_unknown_fields=true:/tmp/out
A separate option for extensions isn't required. Support
for unknown fields must be turned on to allow storing and
retrieving extensions, because they are just stored as
unknown fields. If unknown fields are switched on, extension
related code will be generated when a proto message includes
an extension range, or an extension is encountered.
By default, store_unknown_fields is false. No additional
code is generated, and the generator will error out if protos
contain extension ranges or extensions.
Change-Id: I1e034c9e8f3305612953f72438189a7da6ed2167
When the java_multiple_files option is on, enums are placed in java
class files based on the name of the original enum type. This fixes
field references to such enum values to point to the correct class
name when setting the default.
Change-Id: I51a2e251c0d0ab1e45a182ba849d314232a74bac
- All of the real work for printing the proto is actually done in
MessageNanoPrinter.
- Uses reflection to find proto-defined fields and prints those.
- Prints all fields, even defaults and nulls.
- Also added a simple test to make sure it handles all proto types well.
Tried not to make the test too brittle (but hey it's testing a toString()
so how flexible can it be)
Change-Id: I3e360ef8b0561041e010c1f3445ec45ecdcd2559