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

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

                Author: ASF GitHub Bot
            Created on: 20/Apr/22 16:55
            Start Date: 20/Apr/22 16:55
    Worklog Time Spent: 10m 
      Work Description: KyleSchoonover commented on code in PR #1653:
URL: https://github.com/apache/avro/pull/1653#discussion_r854358030


##########
lang/csharp/src/apache/main/Generic/GenericEnum.cs:
##########
@@ -70,10 +70,12 @@ public GenericEnum(EnumSchema schema, string value)
         /// <inheritdoc/>
         public override bool Equals(object obj)
         {
-            if (obj == this) return true;
-            return (obj != null && obj is GenericEnum)
-                ? Value.Equals((obj as GenericEnum).Value, 
System.StringComparison.Ordinal)
-                : false;
+            if (obj == this)
+            {
+                return true;
+            }
+
+            return obj != null && obj is GenericEnum && Value.Equals((obj as 
GenericEnum).Value, System.StringComparison.Ordinal);
         }

Review Comment:
   Let me write an inheritance test.  I'm not really changing what is already 
there.  It's the exact same checks.  Potentially, any class that inherits may 
have to override equals.  
   
   I will be recreating the MR, and address the testing there.





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

    Worklog Id:     (was: 759404)
    Time Spent: 0.5h  (was: 20m)

> Fix IDE0075 Simplify conditional expression
> -------------------------------------------
>
>                 Key: AVRO-3497
>                 URL: https://issues.apache.org/jira/browse/AVRO-3497
>             Project: Apache Avro
>          Issue Type: Sub-task
>          Components: csharp
>            Reporter: Kyle Schoonover
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {code:java}
> // dotnet_style_prefer_simplified_boolean_expressions = true
> var result1 = M1() && M2();
> var result2 = M1() || M2();
> // dotnet_style_prefer_simplified_boolean_expressions = false
> var result1 = M1() && M2() ? true : false;
> var result2 = M1() ? true : M2(); {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to