aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/javanano/javanano_helpers.h
Commit message (Collapse)AuthorAge
* Remove javanano.Gravatar Feng Xiao2018-03-26
|
* Add std:: namespace prefix to set and map (#3332)Gravatar tanderson-google2017-07-09
| | | * Remove using std::{set,map}
* Remove the unused set common oneof variables in helperGravatar Jisi Liu2015-02-19
|
* Initial check in for primitive oneof fields.Gravatar Jisi Liu2015-02-19
|
* Get the map factory per mergeFrom() call for JavaNano.Gravatar Jisi Liu2015-02-07
|
* Initial checkin for maps support in JavaNano.Gravatar Jisi Liu2015-01-30
|
* Prepare nano proto code to be merged into protobuf repository.Gravatar Feng Xiao2014-11-19
|
* Extension overhaul.Gravatar Max Cai2014-01-10
| | | | | | | | | | | | | | | | | | | | | | - Get rid of TypeLiteral<T>. It was introduced to read the component type of a List<T> at runtime. But we use arrays everywhere else, and we can always read the component type of an array type at runtime. - Properly read/write "minor" types (e.g. sint32, sfixed32). The old implementation could only read/write data as the "typical" types (one per Java type), e.g. java.lang.Integer -> int32, java.lang.Long -> int64. So if e.g. an extension specifies sfixed32 as the type, it would be read/written in the totally incompatible int32 format. - Properly serialize repeated packed fields. The old implementation doesn't do packed serialization. As an added bonus, and to be more aligned with the rest of protobuf nano / main, repeated packable extensions can deserialize both packed and non-packed data. - Split Extension class into a hierarchy so under typical usage a large chunk of code dealing with primitive type extensions can be removed by ProGuard. Bug: https://code.google.com/p/android/issues/detail?id=62586 Change-Id: I0d692f35cc2a8ad3a5a1cb3ce001282b2356b041
* Implement hashCode() and equals() behind a generator option.Gravatar Brian Duff2013-10-25
| | | | | | | | | | | | | | | | The option is only called 'generate_equals' because: - equals() is the main thing; hashCode() is there only to complement equals(); - it's shorter; - toString() should not be included in this option because it's more for debugging and it's more likely to stop ProGuard from working well. Also shortened the "has bit" expression; was ((bitField & mask) == mask), now ((bitField & mask) != 0). Both the Java code and the bytecode are slightly shorter. Change-Id: Ic309a08a60883bf454eb6612679aa99611620e76
* Accessor style for optional fields.Gravatar Max Cai2013-09-23
| | | | | | | | | | | This CL implements the 'optional_field_style=accessors' option. All optional fields will now be 1 Java field and 1 bit in a shared bitfield behind get/set/has/clear accessor methods. The setter performs null check for reference types (Strings and byte[]s). Also decentralized the clear code generation. Change-Id: I60ac78329e352e76c2f8139fba1f292383080ad3
* Add some bitfield helper methods from 2.4Gravatar Max Cai2013-09-20
| | | | Change-Id: Ib9bb549602f71a451d2107fb04de17877553860e
* Fix outer classname for javamicro/javanano.Gravatar Max Cai2013-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - File class name is defined as the java_outer_classname option value or the file name ToCamelCase; never the single message's ClassName. - File-scope enums are translated to constants in the file class, regardless of java_multiple_files. - If java_multiple_files=true, and file's class name equals a message's class name, no error. This is done by detecting that the outer class is not needed and skipping the outer class codegen and clash checks. Note: there is a disparity between java[lite] and the previous java{micr|nan}o: when generating code for a single-message proto, the outer class is omitted by java{micr|nan}o if the file does not have java_outer_classname. This change makes java{micr|nan}o align with java[lite] codegen and create the outer class, but will print some info to warn of potential change of code. - Also fixed the "is_own_file" detection and made all parseX() methods static. Previously, all messages in a java_multiple_files=true file are (incorrectly) considered to be in their own files, including nested messages, causing them to become inner classes (instance- bound) and forcing the parseX() methods to lose the static modifier. - This change supersedes c/60164 and c/60086, which causes javanano to put enum values into enum shell classes if java_multiple_files=true. We now always use the parent class to host the enum values. A future change will add a command line option to provide more flexibility. - Elaborated in java/README.txt. Change-Id: I684932f90e0a028ef37c662b221def5ffa202439
* Update nano to serialize java keywords properly.Gravatar Tom Chao2013-07-19
| | | | Change-Id: I7407d0fab609c336ecd73499e725aed0dd50f555
* Nano protobufs.Gravatar Ulas Kirazci2013-04-01
Like micro protobufs except: - No setter/getter/hazzer functions. - Has state is not available. Outputs all fields != their default. - CodedInputStream can only take byte[] (not InputStream). - Repeated fields are in arrays, not ArrayList or Vector. - Unset messages/groups are null, not "defaultInstance()". - Required fields are always serialized. To use: - Link libprotobuf-java-2.3.0-nano runtime. - Use LOCAL_PROTOC_OPTIMIZE_TYPE := nano Change-Id: I7429015b3c5f7f38b7be01eb2d4927f7a9999c80