aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Don't reset cachedSize to 0 in getSerializedSizeDave Hawkey2014-03-215-10/+41
| | | | | | | | This avoids a race-condition when cachedSize is momentarily set to 0 for non-empty messages if multiple threads call getSerializedSize (e.g. during serialization). Change-Id: I15a8ded92edbf41bf1c8d787960c5bbbc8a323c5
* Merge "Fix compile error on mac 10.9"Wink Saville2014-02-211-0/+1
|\
| * Fix compile error on mac 10.9Wink Saville2014-02-211-0/+1
|/ | | | | | | | Add #<include> istream to message.cc which was the solution to this bug: https://code.google.com/p/protobuf/issues/detail?id=570 Change-Id: Ic63730fdbe73234bf7efdd50ff0b55bb11ca0fd4
* Merge "Extension overhaul."Max Cai2014-02-1716-538/+1142
|\
| * Extension overhaul.Max Cai2014-01-1016-538/+1142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Merge changes I9fecff3c,I2c1eb07fMax Cai2014-02-108-61/+315
|\ \ | | | | | | | | | | | | | | | * changes: Fix repeated packed field merging code for non-packed data. Add validation when parsing enum fields.
| * | Fix repeated packed field merging code for non-packed data.Max Cai2014-01-162-9/+16
| | | | | | | | | | | | | | | | | | | | | Enum fix is already included in the previous commit. Bug: https://code.google.com/p/android/issues/detail?id=64893 Change-Id: I9fecff3c8822918a019028eb57fa39b361a2c960
| * | Add validation when parsing enum fields.Max Cai2014-01-167-52/+299
|/ / | | | | | | | | | | | | | | | | | | | | | | Invalid values from the wire are silently ignored. Unlike full/lite, the invalid values are not stored into the unknown fields, because there's no way to get them out from Nano's unknown fields without a matching Extension. Edited README and slightly moved it towards a standalone section for Nano, independent of the Micro section. Change-Id: I2c1eb07f4d6d8f3aea242b8ddd95b9c966f3f177
* | Merge "Allow whitespace in nano codegen options."Max Cai2014-01-144-31/+51
|\ \
| * | Allow whitespace in nano codegen options.Max Cai2014-01-144-31/+51
|/ / | | | | | | | | | | So we don't need to keep all option in a single line in the .mk files. Change-Id: I786b879b334cac4cd13b32fabcb76efe53b4ac80
* | Merge "Correctness: floating point equality using bits instead of ==."Max Cai2014-01-134-50/+183
|\ \
| * | Correctness: floating point equality using bits instead of ==.Max Cai2014-01-104-50/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Special values for float and double make it inaccurate to test the equality with ==. The main Java library uses the standard Object.equals() implementation for all fields, which for floating point fields means Float.equals() or Double.equals(). They define equality as bitwise equality, with all NaN representations normalized to the same bit sequence (and therefore equal to each other). This test checks that the nano implementation complies with Object.equals(), so NaN == NaN and +0.0 != -0.0. Change-Id: I97bb4a3687223d8a212c70cd736436b9dd80c1d7
* | | Merge "Don't serialize required fields whose 'has' flags are unset."Max Cai2014-01-134-6/+15
|\ \ \ | |/ / | | / | |/ |/|
| * Don't serialize required fields whose 'has' flags are unset.Max Cai2014-01-104-6/+15
|/ | | | Change-Id: Ibbe944fff83e44a8f2206e18ee9ec6f10661297a
* Merge "Fix MessageNanoPrinter for accessors"Andrew Flynn2013-12-193-25/+102
|\
| * Fix MessageNanoPrinter for accessorsAndrew Flynn2013-12-123-25/+102
|/ | | | | | | | | accessors mode switches proto fields away from being public fields (which is how MessageNanoPrinter found which fields to print via reflection). Add a pass through the methods looking for generated accessor methods to print those as well. Change-Id: I7c47853ecbd5534086f44b25a89dbbe56f63ed03
* Merge "Avoid class initializers to help ProGuard."Max Cai2013-12-1012-94/+248
|\
| * Avoid class initializers to help ProGuard.Max Cai2013-12-1012-94/+248
|/ | | | | | | | | | | | | | | | | | | Class initializers prevent ProGuard from inlining any methods because it thinks the class initializer may have side effects. This is true for static methods, but instance methods can still be inlined, because to have an instance you will have touched the class and any class initializers would have run. But ProGuard only starts inlining instance methods of classes with class initializers from v4.11b6, and Android uses v4.4 now. This change tries to avoid the class initializers as much as possible, by delaying the initialization of the empty array and some fields' saved defaults until when they're needed. However, if the message hosts any extensions, they must be public static final and therefore introducing the class initializer. In that case we won't bother with lazy initialization. Change-Id: I00d8296f6eb0023112b93ee135cdb28dbd52b0b8
* Merge "Nano: don't generate accessor methods for nested methods"Max Cai2013-12-105-138/+53
|\
| * Nano: don't generate accessor methods for nested methodsAndrew Flynn2013-12-095-138/+53
| | | | | | | | | | | | | | | | | | For nested message objects, don't generate accessor methods because they have a default value that is not a valid value (null), so there is no reason to have get/set/has/clear methods for them. Clients and protos (while serializing) can check against the invalid value to see if it's been set. Change-Id: Ic63400889581271b8cbcd9c45c84519d4921fd4b
* | Merge commit '0afd5a4d782037ea641d75d595cf5d38ed6978ac' into HEADThe Android Open Source Project2013-12-050-0/+0
|\ \ | |/ |/|
| * am 3e0d99fa: Merge "Update MessageNano#toString() to return mostly valid ↵Max Cai2013-11-153-40/+84
| |\ | | | | | | | | | | | | | | | | | | TextFormat." * commit '3e0d99fab8c1da2a8f36637b7bf5e8581143e36a': Update MessageNano#toString() to return mostly valid TextFormat.
| * \ am 332076f0: Merge "Fix warnings warnings in header files, hide others."Max Cai2013-11-153-6/+10
| |\ \ | | | | | | | | | | | | | | | | * commit '332076f08a9d46b772fee755832a0e09dd8cb6aa': Fix warnings warnings in header files, hide others.
| * \ \ am ac8e2e15: Merge "Minimize method count for nanoproto."Max Cai2013-11-124-63/+112
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * commit 'ac8e2e150716784a707587ae6e2c8b3a291a2ae7': Minimize method count for nanoproto.
| * \ \ \ am 8a15121c: Merge "Allow for ref-type arrays containing null elements."Max Cai2013-11-063-22/+82
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * commit '8a15121c1077fe883f428bd27dee6b99e06e48b6': Allow for ref-type arrays containing null elements.
| * \ \ \ \ am bb971d53: Merge "Implement hashCode() and equals() behind a generator ↵Max Cai2013-10-2517-65/+915
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | option." * commit 'bb971d53626cb286f8dc491c15d2731001c4891b': Implement hashCode() and equals() behind a generator option.
* | \ \ \ \ \ Merge commit '7cb6b37f3799affce9e1be39977d4419283df795' into HEADThe Android Open Source Project2013-11-221-0/+1
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | am 42be1e79: Merge "Feature request: set() and clear() accessors return this"Max Cai2013-10-164-17/+33
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '42be1e79ccd670be36220222936aa7cacc6856f6': Feature request: set() and clear() accessors return this
| * \ \ \ \ \ \ am c50f605c: Merge "Make generated code more aligned with Google Java style."Max Cai2013-10-166-55/+78
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c50f605c572a425b2fa696fedc5e61ac6f66d2a9': Make generated code more aligned with Google Java style.
| * \ \ \ \ \ \ \ am afaf74ce: Merge "Fix repeated field merging semantics."Max Cai2013-10-166-37/+193
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'afaf74ce55f4aff63dc30e7045a7cd6c1cf232dc': Fix repeated field merging semantics.
| * \ \ \ \ \ \ \ \ am 63e819ad: Merge "Protect against null repeated fields."Max Cai2013-10-155-21/+78
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '63e819adbb4d2d8215f5d3d8297dc50bf2fe3329': Protect against null repeated fields.
| * \ \ \ \ \ \ \ \ \ am c85806ba: Merge remote-tracking branch \'goog/klp-dev-plus-aosp\' into ↵Max Cai2013-10-150-0/+0
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tomerge * commit 'c85806baedfc98ad5759a990b35ea5b5f1ac4edb':
| | * \ \ \ \ \ \ \ \ \ Merge remote-tracking branch 'goog/klp-dev-plus-aosp' into tomergeMax Cai2013-10-1125-104/+1410
| | |\ \ \ \ \ \ \ \ \ \
| * | \ \ \ \ \ \ \ \ \ \ am 39cee9f1: Merge "Remove all field initializers and let ctor call clear()."Max Cai2013-10-114-14/+18
| |\ \ \ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '39cee9f1f5cd513a53ac5100eb208ed431f99af0': Remove all field initializers and let ctor call clear().
| * | | | | | | | | | | | am cbb08132: Merge "Add missing README parts for enum_style and in-repo usage"Ulas Kirazci2013-10-101-3/+51
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cbb08132821cb56f4e6c5e5f8a0b32f51879782a': Add missing README parts for enum_style and in-repo usage
| * \ \ \ \ \ \ \ \ \ \ \ \ am c4a1b547: Merge "Add reftypes field generator option."Ulas Kirazci2013-10-099-29/+287
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c4a1b547c91178d79f5d2cc2e00b8be922c22fe8': Add reftypes field generator option.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ am 44cbb06c: Merge "Fix some indenting issues with set__() function"Wink Saville2013-10-091-10/+6
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '44cbb06c725fbba00464bba9f19dc0ea295406b1': Fix some indenting issues with set__() function
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ am 9827c718: Merge "Fix roundtrip failure with groups when unknown fields ↵Ulas Kirazci2013-10-043-2/+30
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are enabled." * commit '9827c718c45cfa1744a3b0f8fc27dac9cd415603': Fix roundtrip failure with groups when unknown fields are enabled.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am 44dc2f1e: Merge "Implement enum_style=java option."Ulas Kirazci2013-09-288-23/+195
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '44dc2f1eaead8d95d3f5a4f80f9da87852053bfb': Implement enum_style=java option.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am 0d035e9b: Merge "Accessor style for optional fields."Ulas Kirazci2013-09-2815-63/+719
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0d035e9b3485d26df106ff9118705d8476466674': Accessor style for optional fields.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am cc652daa: Merge "Add some bitfield helper methods from 2.4"Ulas Kirazci2013-09-242-0/+102
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cc652daaec7fc6ebf8b12d361444364da257988b': Add some bitfield helper methods from 2.4
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am 9e6afdf9: Merge "Add two codegen parameters to nano."Ulas Kirazci2013-09-242-2/+30
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9e6afdf96f98259f89aad66367954a247b3e7817': Add two codegen parameters to nano.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge commit '11c3b27d' into fix-mcWink Saville2013-08-131-1/+19
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '11c3b27d': Add a Gradle build file for the protobuf libraries. Change-Id: Id785093c51eb423576292994a98d42efbbc3fddb
| * | | | | | | | | | | | | | | | | | | | am ece98e5f: Merge "Fix checkbuild targets, remove ↵Wink Saville2013-08-081-2/+2
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unittest_enum_mulitplejava_nano.proto." * commit 'ece98e5f6728a937c8d32d342f3b1b037a611f3e': Fix checkbuild targets, remove unittest_enum_mulitplejava_nano.proto.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am e7b778b9: Merge "Fix outer classname for javamicro/javanano."Wink Saville2013-08-0827-497/+718
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e7b778b99f607460ed9ea88a13ec91164cda8537': Fix outer classname for javamicro/javanano.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am 87c8e31b: Merge "Fixed packed repeated serialization."Ulas Kirazci2013-07-313-30/+48
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '87c8e31b8c0baa78f979863a9ed10654a1cdca1f': Fixed packed repeated serialization.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am be47f55e: Merge "Add an option to inspect "has" state upon parse."Ulas Kirazci2013-07-2910-31/+273
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'be47f55e2f93df84abb55759e49cf381d2745cc5': Add an option to inspect "has" state upon parse.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am 021f8f1b: Merge "Add test for passing in proto params."Ulas Kirazci2013-07-262-1/+25
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '021f8f1badf1c4db519e3f35d600dec4b5c52eff': Add test for passing in proto params.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am ac5a239e: Merge "Per-file java_multiple_files flag."Ulas Kirazci2013-07-2516-43/+230
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ac5a239e7d90613cb9404098b70c036a52531a74': Per-file java_multiple_files flag.
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ am 3099f911: am 19c4090e: Merge "Allow NaN/+inf/-inf defaults in micro/nano."Ulas Kirazci2013-07-237-8/+141
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3099f911382d143d9b702d36e5e52d2f37d8edd9': Allow NaN/+inf/-inf defaults in micro/nano.