[
https://issues.apache.org/jira/browse/AVRO-3497?focusedWorklogId=759427&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-759427
]
ASF GitHub Bot logged work on AVRO-3497:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Apr/22 17:18
Start Date: 20/Apr/22 17:18
Worklog Time Spent: 10m
Work Description: zcsizmadia commented on code in PR #1658:
URL: https://github.com/apache/avro/pull/1658#discussion_r854376908
##########
lang/csharp/src/apache/main/Generic/GenericEnum.cs:
##########
@@ -70,10 +70,13 @@ 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.GetType() == typeof(GenericEnum)
Review Comment:
There should be a null check here IMO
Issue Time Tracking
-------------------
Worklog Id: (was: 759427)
Time Spent: 1h 20m (was: 1h 10m)
> 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: 1h 20m
> 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)