From 68380f0f6681c72a5d4ab5e69abc9670e9d99838 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 30 Jul 2015 13:03:45 +0100 Subject: Rename ThrowHelper to Preconditions and make it public - we'll want to use it from the generated code soon. Additionally, change it to return the value passed, and make it generic with a class constraint. A separate method doesn't have the class constraint, for more unusual scenarios. --- csharp/src/Google.Protobuf/JsonFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'csharp/src/Google.Protobuf/JsonFormatter.cs') diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs index f624b090..438af4df 100644 --- a/csharp/src/Google.Protobuf/JsonFormatter.cs +++ b/csharp/src/Google.Protobuf/JsonFormatter.cs @@ -120,7 +120,7 @@ namespace Google.Protobuf public string Format(IMessage message) { - ThrowHelper.ThrowIfNull(message, "message"); + Preconditions.CheckNotNull(message, "message"); StringBuilder builder = new StringBuilder(); // TODO(jonskeet): Handle well-known types here. // Our reflection support needs improving so that we can get at the descriptor -- cgit v1.2.3