You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/02/25 20:02:08 UTC

[GitHub] [avro] KyleSchoonover commented on a change in pull request #1569: Avro 3421

KyleSchoonover commented on a change in pull request #1569:
URL: https://github.com/apache/avro/pull/1569#discussion_r815085685



##########
File path: lang/csharp/src/apache/main/Schema/ArraySchema.cs
##########
@@ -38,24 +38,27 @@ public class ArraySchema : UnnamedSchema
         /// <param name="props">dictionary that provides access to custom properties</param>
         /// <param name="names">list of named schemas already parsed</param>
         /// <param name="encspace">enclosing namespace for the array schema</param>
-        /// <returns></returns>
+        /// <returns>New instance of Array Schema</returns>
         internal static ArraySchema NewInstance(JToken jtok, PropertyMap props, SchemaNames names, string encspace)
         {
             JToken jitem = jtok["items"];
-            if (null == jitem) throw new AvroTypeException($"Array does not have 'items' at '{jtok.Path}'");
-            var schema = Schema.ParseJson(jitem, names, encspace);
+            if (jitem == null)
+            {
+                throw new AvroTypeException($"Array does not have 'items' at '{jtok.Path}'");
+            }
+
+            Schema schema = Schema.ParseJson(jitem, names, encspace);
             return new ArraySchema(schema, props);
         }
 
         /// <summary>
-        /// Constructor
+        /// Initializes a new instance of the <see cref="ArraySchema"/> class.
         /// </summary>
         /// <param name="items">schema for the array items type</param>
         /// <param name="props">dictionary that provides access to custom properties</param>
         private ArraySchema(Schema items, PropertyMap props) : base(Type.Array, props)
         {
-            if (null == items) throw new ArgumentNullException(nameof(items));

Review comment:
       This exception is basically unreachable since the entry point is NewInstance




-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org