[ 
https://issues.apache.org/jira/browse/AVRO-3335?focusedWorklogId=717775&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-717775
 ]

ASF GitHub Bot logged work on AVRO-3335:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Jan/22 07:07
            Start Date: 31/Jan/22 07:07
    Worklog Time Spent: 10m 
      Work Description: martin-g commented on a change in pull request #1485:
URL: https://github.com/apache/avro/pull/1485#discussion_r795389873



##########
File path: lang/csharp/src/apache/main/CodeGen/CodeGen.cs
##########
@@ -219,8 +219,14 @@ protected virtual void processProtocols()
         /// <returns>
         /// List of named schemas.
         /// </returns>
-        protected virtual SchemaNames generateNames(Protocol protocol)
+        /// <exception cref="System.ArgumentNullException">protocol - Protocol 
can not be null.</exception>
+        protected virtual SchemaNames GenerateNames(Protocol protocol)
         {
+            if (protocol == null)
+            {
+                throw new ArgumentNullException(nameof(protocol), "Protocol 
can not be null");

Review comment:
       What does `nameof()` returns for `null` ?

##########
File path: lang/csharp/src/apache/main/CodeGen/CodeGen.cs
##########
@@ -237,7 +243,7 @@ protected virtual SchemaNames generateNames(Protocol 
protocol)
         /// <returns>
         /// List of named schemas.
         /// </returns>
-        protected virtual SchemaNames generateNames(Schema schema)
+        protected virtual SchemaNames GenerateNames(Schema schema)

Review comment:
       As above.

##########
File path: lang/csharp/src/apache/main/CodeGen/CodeGen.cs
##########
@@ -219,8 +219,14 @@ protected virtual void processProtocols()
         /// <returns>
         /// List of named schemas.
         /// </returns>
-        protected virtual SchemaNames generateNames(Protocol protocol)
+        /// <exception cref="System.ArgumentNullException">protocol - Protocol 
can not be null.</exception>
+        protected virtual SchemaNames GenerateNames(Protocol protocol)

Review comment:
       For backward compatibility we need to keep the old method deprecated for 
few releases.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 717775)
    Time Spent: 20m  (was: 10m)

> Throw exception for null parameter in GenerateNames
> ---------------------------------------------------
>
>                 Key: AVRO-3335
>                 URL: https://issues.apache.org/jira/browse/AVRO-3335
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: csharp
>    Affects Versions: 1.11.1
>            Reporter: Kyle Schoonover
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> GenerateNames(Protocol protocol) needs evaluation of the input.  Because this 
> CodeGen class can be inherited from it is good practice to evaluate input.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to