From 4e169bf0e57107d864c26960d5720d203e3768e8 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 27 Jul 2016 10:46:00 +0100 Subject: Bring C#'s ToPascalCase method in line with C++. (This still doesn't fix the conformance tests, but at least we're now consistent with the C++ code.) --- csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs | 6 ++++++ csharp/src/Google.Protobuf/JsonFormatter.cs | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'csharp') diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index 51b3ca2d..261ac6a7 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -230,6 +230,12 @@ namespace Google.Protobuf [TestCase("foo_bar", "fooBar")] [TestCase("bananaBanana", "bananaBanana")] [TestCase("BANANABanana", "bananaBanana")] + [TestCase("simple", "simple")] + [TestCase("ACTION_AND_ADVENTURE", "actionAndAdventure")] + [TestCase("action_and_adventure", "actionAndAdventure")] + [TestCase("kFoo", "kFoo")] + [TestCase("HTTPServer", "httpServer")] + [TestCase("CLIENT", "client")] public void ToCamelCase(string original, string expected) { Assert.AreEqual(expected, JsonFormatter.ToCamelCase(original)); diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs index a894ffa1..d8a814d9 100644 --- a/csharp/src/Google.Protobuf/JsonFormatter.cs +++ b/csharp/src/Google.Protobuf/JsonFormatter.cs @@ -274,7 +274,6 @@ namespace Google.Protobuf } // Converted from src/google/protobuf/util/internal/utility.cc ToCamelCase - // TODO: Use the new field in FieldDescriptor. internal static string ToCamelCase(string input) { bool capitalizeNext = false; @@ -305,6 +304,7 @@ namespace Google.Protobuf (!wasCap || (i + 1 < input.Length && char.IsLower(input[i + 1])))) { firstWord = false; + result.Append(input[i]); } else { @@ -320,8 +320,16 @@ namespace Google.Protobuf result.Append(char.ToUpperInvariant(input[i])); continue; } + else + { + result.Append(input[i]); + continue; + } + } + else + { + result.Append(char.ToLowerInvariant(input[i])); } - result.Append(input[i]); } return result.ToString(); } -- cgit v1.2.3 From 6e11540b329c363b614afe9dbfd92d6d1f8ba674 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Fri, 2 Sep 2016 11:57:49 -0700 Subject: Bump version number to 3.0.2 --- configure.ac | 2 +- csharp/Google.Protobuf.Tools.nuspec | 2 +- csharp/src/Google.Protobuf/project.json | 2 +- java/core/pom.xml | 2 +- java/pom.xml | 2 +- java/util/pom.xml | 2 +- js/package.json | 2 +- protoc-artifacts/pom.xml | 2 +- python/google/protobuf/__init__.py | 2 +- ruby/google-protobuf.gemspec | 2 +- ruby/pom.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'csharp') diff --git a/configure.ac b/configure.ac index 41887997..757f55c9 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.0.0],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.0.2],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 24b4a776..ce7514b4 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -5,7 +5,7 @@ Google Protocol Buffers tools Tools for Protocol Buffers - Google's data interchange format. See project site for more info. - 3.0.0 + 3.0.2 Google Inc. protobuf-packages https://github.com/google/protobuf/blob/master/LICENSE diff --git a/csharp/src/Google.Protobuf/project.json b/csharp/src/Google.Protobuf/project.json index 9b831f12..607b65ef 100644 --- a/csharp/src/Google.Protobuf/project.json +++ b/csharp/src/Google.Protobuf/project.json @@ -1,5 +1,5 @@ { - "version": "3.0.0", + "version": "3.0.2", "title": "Google Protocol Buffers", "description": "See project site for more info.", "authors": [ "Google Inc." ], diff --git a/java/core/pom.xml b/java/core/pom.xml index 39d67818..28bc99a0 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -6,7 +6,7 @@ com.google.protobuf protobuf-parent - 3.0.0 + 3.0.2 protobuf-java diff --git a/java/pom.xml b/java/pom.xml index 3a91a0ba..ccfb229e 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -11,7 +11,7 @@ com.google.protobuf protobuf-parent - 3.0.0 + 3.0.2 pom Protocol Buffers [Parent] diff --git a/java/util/pom.xml b/java/util/pom.xml index 0d5e8e37..58cc4b30 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -6,7 +6,7 @@ com.google.protobuf protobuf-parent - 3.0.0 + 3.0.2 protobuf-java-util diff --git a/js/package.json b/js/package.json index 3f51d96b..5df7283c 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.0.0", + "version": "3.0.2", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 840bc60a..c4f0a73d 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf protoc - 3.0.0 + 3.0.2 pom Protobuf Compiler diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 6210a404..30ee6e81 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -30,7 +30,7 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.0.0' +__version__ = '3.0.2' if __name__ != '__main__': try: diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 286d8fe3..67b15c33 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.0.0" + s.version = "3.0.2" s.licenses = ["BSD"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." diff --git a/ruby/pom.xml b/ruby/pom.xml index 99e8449b..7b896137 100644 --- a/ruby/pom.xml +++ b/ruby/pom.xml @@ -86,7 +86,7 @@ com.google.protobuf protobuf-java - 3.0.0-beta-4 + 3.0.0 -- cgit v1.2.3