You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/08/30 12:10:26 UTC

[avro] branch branch-1.11 updated: AVRO-3001 AVRO-3274 AVRO-3568 AVRO-3613: Add JSON encoder/decoder for C#

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch branch-1.11
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/branch-1.11 by this push:
     new a60b748c1 AVRO-3001 AVRO-3274 AVRO-3568 AVRO-3613: Add JSON encoder/decoder for C#
a60b748c1 is described below

commit a60b748c1694dcf3fd2b617e75fcc9c1634fd150
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Tue Aug 30 15:09:34 2022 +0300

    AVRO-3001 AVRO-3274 AVRO-3568 AVRO-3613: Add JSON encoder/decoder for C#
    
    Remove Encoder#Flush() method for backward compatibility
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 lang/csharp/src/apache/main/IO/Encoder.cs        | 5 -----
 lang/csharp/src/apache/main/IO/JsonEncoder.cs    | 2 +-
 lang/csharp/src/apache/test/IO/JsonCodecTests.cs | 4 ++--
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/lang/csharp/src/apache/main/IO/Encoder.cs b/lang/csharp/src/apache/main/IO/Encoder.cs
index 0c1712af4..84a2099a1 100644
--- a/lang/csharp/src/apache/main/IO/Encoder.cs
+++ b/lang/csharp/src/apache/main/IO/Encoder.cs
@@ -187,10 +187,5 @@ namespace Avro.IO
         /// <param name="start">Position within data where the contents start.</param>
         /// <param name="len">Number of bytes to write.</param>
         void WriteFixed(byte[] data, int start, int len);
-
-        /// <summary>
-        /// Flushes the encoder.
-        /// </summary>
-        void Flush();
     }
 }
diff --git a/lang/csharp/src/apache/main/IO/JsonEncoder.cs b/lang/csharp/src/apache/main/IO/JsonEncoder.cs
index c159a013e..48415d7cd 100644
--- a/lang/csharp/src/apache/main/IO/JsonEncoder.cs
+++ b/lang/csharp/src/apache/main/IO/JsonEncoder.cs
@@ -28,7 +28,7 @@ namespace Avro.IO
     /// An <see cref="Encoder"/> for Avro's JSON data encoding.
     ///
     /// JsonEncoder buffers output, and data may not appear on the output until
-    /// <see cref="Encoder.Flush()"/> is called.
+    /// <see cref="Flush()"/> is called.
     ///
     /// JsonEncoder is not thread-safe.
     /// </summary>
diff --git a/lang/csharp/src/apache/test/IO/JsonCodecTests.cs b/lang/csharp/src/apache/test/IO/JsonCodecTests.cs
index 7c3ec3c2d..58d047f5e 100644
--- a/lang/csharp/src/apache/test/IO/JsonCodecTests.cs
+++ b/lang/csharp/src/apache/test/IO/JsonCodecTests.cs
@@ -291,8 +291,8 @@ namespace Avro.Test
             GenericDatumWriter<object> writer = new GenericDatumWriter<object>(schema);
             MemoryStream output = new MemoryStream();
 
-            Decoder decoder = new JsonDecoder(schema, json);
-            Encoder encoder = new BinaryEncoder(output);
+            JsonDecoder decoder = new JsonDecoder(schema, json);
+            BinaryEncoder encoder = new BinaryEncoder(output);
 
             object datum = reader.Read(null, decoder);