aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf
diff options
context:
space:
mode:
authorJisi Liu <liujisi@google.com>2016-09-02 11:36:30 -0700
committerGitHub <noreply@github.com>2016-09-02 11:36:30 -0700
commita098e809336c5fbad7a8ff8f1210e5e0ac8d29b2 (patch)
tree7a7a5294705329baf7b6d39f46470d0ca487abfa /csharp/src/Google.Protobuf
parent9befe479241614a2cd4a9f9a0646b1b0b6a3cf0c (diff)
parent4e169bf0e57107d864c26960d5720d203e3768e8 (diff)
downloadprotobuf-a098e809336c5fbad7a8ff8f1210e5e0ac8d29b2.tar.gz
protobuf-a098e809336c5fbad7a8ff8f1210e5e0ac8d29b2.tar.bz2
protobuf-a098e809336c5fbad7a8ff8f1210e5e0ac8d29b2.zip
Merge pull request #1862 from pherl/3.0.0-GA
Cherry pick c# changes from master
Diffstat (limited to 'csharp/src/Google.Protobuf')
-rw-r--r--csharp/src/Google.Protobuf/JsonFormatter.cs12
1 files changed, 10 insertions, 2 deletions
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();
}