1. 22 Nov, 2013 1 commit
  2. 18 Nov, 2013 2 commits
  3. 15 Nov, 2013 3 commits
    • Max Cai's avatar
    • Nicholas Seckar's avatar
      Update MessageNano#toString() to return mostly valid TextFormat. · 904c81ee
      Nicholas Seckar authored
      The output of toString is now aligned with that used by non-nano and C++
      runtimes, with the exception of groups. Groups should be serialized using a
      camelized name (e.g. "FooBar" rather than "foo_bar") however the nano runtime
      does not have information on which fields are groups.
      
      Changes are:
        - bytes fields are output within double-quotes, non-printable characters are
          output as octal escape sequences (i.e. \NNN);
        - field identifiers are output in underscored format;
        - unset fields are not output (rather than printing "null");
        - the type name of the root message is not output.
      
      With these changes the nano toString, normal toString, and C++'s DebugString all
      produce equivalent output when given the same message. (Provided that message
      uses no deprecated features.)
      
      Change-Id: Id4791d73822846db29344db9f7bc3781c3e183a6
      904c81ee
    • Max Cai's avatar
      558af242
  4. 13 Nov, 2013 1 commit
  5. 12 Nov, 2013 1 commit
  6. 11 Nov, 2013 1 commit
    • Tom Chao's avatar
      Minimize method count for nanoproto. · 28b4dec7
      Tom Chao authored
      - Migrates getCachedSize to the MessageNano parent class to save one method per message.
      - Create ExtendableMessageNano parent class for protos with extensions, this saves the
      getExtension and setExtension methods on the relevant messages.
      - getSerializedSize's default case (with no fields to serialize) also migrate to the
      parent class, which saves methods on empty messages.
      - Container classes become interfaces to save the constructor.
      
      Change-Id: I81f1a1b6d6a660096835e9df3ea20456655aab4a
      28b4dec7
  7. 06 Nov, 2013 1 commit
  8. 05 Nov, 2013 1 commit
    • Aurash Mahbod's avatar
      Allow for ref-type arrays containing null elements. · 3f0c3480
      Aurash Mahbod authored
      Strip the null elements out before serializing the array.
      This is helpful in the cases where the user wants to construct
      an array of an inexact size for serialization. For example:
      User constructs array of size 5 because they anticipate adding
      more than 1 element before serialization. Only 3 get added, so
      the array looks like [Obj, Obj, Obj, null, null]. This would
      curently crash without this CL.
      
      All repeated fields of ref-type elements can contain null
      elements: repeated strings, repeated bytes, and repeated
      messages/groups.
      
      Change-Id: I117391c868c9a436536d70d6151780e9cc7e8227
      
      Conflicts:
      	src/google/protobuf/compiler/javanano/javanano_message_field.cc
      3f0c3480
  9. 25 Oct, 2013 2 commits
    • Max Cai's avatar
    • Brian Duff's avatar
      Implement hashCode() and equals() behind a generator option. · 56a37328
      Brian Duff authored
      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
      56a37328
  10. 16 Oct, 2013 8 commits
  11. 15 Oct, 2013 5 commits
  12. 11 Oct, 2013 4 commits
  13. 10 Oct, 2013 3 commits
  14. 09 Oct, 2013 4 commits
  15. 08 Oct, 2013 1 commit
    • Andrew Flynn's avatar
      Fix some indenting issues with set__() function · 0b86e55f
      Andrew Flynn authored
      Previously it looked like this:
      
      public final class OuterClass {
        [...]
        public static final class InnerClass extends
            com.google.protobuf.nano.MessageNano {
          [...]
          public void setId(java.lang.String value) {
            if (value == null) {
          throw new java.lang.NullPointerException();
        }
        id_ = value;
            bitfield0_ |= 0x00000001;
          [...]
        }
        [...]
      }
      
      Now it looks like this:
      
      public final class OuterClass {
        [...]
        public static final class InnerClass extends
            com.google.protobuf.nano.MessageNano {
          [...]
          public void setId(java.lang.String value) {
            if (value == null) throw new java.lang.NullPointerException();
            id_ = value;
            bitfield0_ |= 0x00000001;
          [...]
        }
        [...]
      }
      
      Change-Id: I2a9289b528f785c846210d558206d677aa13e9be
      0b86e55f
  16. 07 Oct, 2013 1 commit
  17. 04 Oct, 2013 1 commit