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/02/02 07:34:06 UTC

[avro] branch branch-1.11 updated: AVRO-3349 Updated ProcessProtocols to meet style guidelines. (#1499)

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 ba27d3f  AVRO-3349 Updated ProcessProtocols to meet style guidelines. (#1499)
ba27d3f is described below

commit ba27d3f9bd77ce06ae562fa53fc8e6cd7c8f68b0
Author: Kyle Schoonover <ky...@minmaxcorp.com>
AuthorDate: Tue Feb 1 23:32:55 2022 -0800

    AVRO-3349 Updated ProcessProtocols to meet style guidelines. (#1499)
    
    * AVRO-3349 Updated ProcessProtocols to meet style guidelines.
    
    * Updated messaging
    
    Co-authored-by: Kyle T. Schoonover <Ky...@nordstrom.com>
    Co-authored-by: Martin Grigorov <ma...@users.noreply.github.com>
    (cherry picked from commit df720718aee6832b056c4c26f6f470f8ed4107e0)
---
 lang/csharp/src/apache/main/CodeGen/CodeGen.cs | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/lang/csharp/src/apache/main/CodeGen/CodeGen.cs b/lang/csharp/src/apache/main/CodeGen/CodeGen.cs
index 669094b..faf4513 100644
--- a/lang/csharp/src/apache/main/CodeGen/CodeGen.cs
+++ b/lang/csharp/src/apache/main/CodeGen/CodeGen.cs
@@ -170,7 +170,7 @@ namespace Avro
             CompileUnit = new CodeCompileUnit();
 
             ProcessSchemas();
-            processProtocols();
+            ProcessProtocols();
 
             return CompileUnit;
         }
@@ -212,7 +212,8 @@ namespace Avro
         /// <summary>
         /// Generates code for the protocol objects.
         /// </summary>
-        protected virtual void processProtocols()
+        /// <exception cref="CodeGenException">Names in protocol should only be of type NamedSchema, type found {sn.Value.Tag}</exception>
+        protected virtual void ProcessProtocols()
         {
             foreach (Protocol protocol in Protocols)
             {
@@ -226,7 +227,7 @@ namespace Avro
                         case Schema.Type.Record: processRecord(sn.Value); break;
                         case Schema.Type.Error: processRecord(sn.Value); break;
                         default:
-                            throw new CodeGenException("Names in protocol should only be of type NamedSchema, type found " + sn.Value.Tag);
+                            throw new CodeGenException($"Names in protocol should only be of type NamedSchema, type found {sn.Value.Tag}");
                     }
                 }
 
@@ -235,6 +236,16 @@ namespace Avro
         }
 
         /// <summary>
+        /// Generates code for the protocol objects.
+        /// </summary>
+        /// <exception cref="CodeGenException">Names in protocol should only be of type NamedSchema, type found {sn.Value.Tag}</exception>
+        [Obsolete("This method will be deprecated in a future release. Please change call to ProcessProtocols().")]
+        protected virtual void processProtocols()
+        {
+            ProcessProtocols();
+        }
+
+        /// <summary>
         /// Generate list of named schemas from given protocol.
         /// </summary>
         /// <param name="protocol">protocol to process.</param>