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

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

                Author: ASF GitHub Bot
            Created on: 31/Jan/22 16:30
            Start Date: 31/Jan/22 16:30
    Worklog Time Spent: 10m 
      Work Description: KyleSchoonover commented on a change in pull request 
#1485:
URL: https://github.com/apache/avro/pull/1485#discussion_r795845967



##########
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:
       Honestly, it's a weird pattern, but really it's to make sure your 
messaging is up to date when you change the name of a variable.  It's the 
equivalent of "protocol."  It's literally the name of the variable as a string.




-- 
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: 718063)
    Time Spent: 0.5h  (was: 20m)

> 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: 0.5h
>  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