Skip to content

Commit b101554

Browse files
author
Edward Meng
committed
Revert all the equality compare changes.
1 parent 08a3363 commit b101554

File tree

16 files changed

+12
-147
lines changed

16 files changed

+12
-147
lines changed

src/Exceptionless/Extensions/CollectionEqualityExtensions.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ public static bool CollectionEquals<T>(this IEnumerable<T> source, IEnumerable<T
4040
}
4141

4242
public static bool CollectionEquals<TKey,TValue>(this IDictionary<TKey, TValue> source, IDictionary<TKey, TValue> other) {
43-
if (ReferenceEquals(null, source) && ReferenceEquals(null, other)) {
44-
return true;
45-
}
46-
47-
if (ReferenceEquals(null, source) || ReferenceEquals(null, other)) {
48-
return false;
49-
}
50-
51-
if (ReferenceEquals(source, other)) {
52-
return true;
53-
}
54-
5543
if (source.Count != other.Count) {
5644
return false;
5745
}

src/Exceptionless/Models/Client/Data/EnvironmentInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public EnvironmentInfo() {
101101
public DataDictionary Data { get; set; }
102102

103103
protected bool Equals(EnvironmentInfo other) {
104-
return ProcessorCount == other.ProcessorCount && TotalPhysicalMemory == other.TotalPhysicalMemory && AvailablePhysicalMemory == other.AvailablePhysicalMemory && string.Equals(CommandLine, other.CommandLine) && string.Equals(ProcessName, other.ProcessName) && string.Equals(ProcessId, other.ProcessId) && ProcessMemorySize == other.ProcessMemorySize && string.Equals(ThreadName, other.ThreadName) && string.Equals(ThreadId, other.ThreadId) && string.Equals(Architecture, other.Architecture) && string.Equals(OSName, other.OSName) && string.Equals(OSVersion, other.OSVersion) && string.Equals(IpAddress, other.IpAddress) && string.Equals(MachineName, other.MachineName) && string.Equals(InstallId, other.InstallId) && string.Equals(RuntimeVersion, other.RuntimeVersion) && Data.CollectionEquals(other.Data);
104+
return ProcessorCount == other.ProcessorCount && TotalPhysicalMemory == other.TotalPhysicalMemory && AvailablePhysicalMemory == other.AvailablePhysicalMemory && string.Equals(CommandLine, other.CommandLine) && string.Equals(ProcessName, other.ProcessName) && string.Equals(ProcessId, other.ProcessId) && ProcessMemorySize == other.ProcessMemorySize && string.Equals(ThreadName, other.ThreadName) && string.Equals(ThreadId, other.ThreadId) && string.Equals(Architecture, other.Architecture) && string.Equals(OSName, other.OSName) && string.Equals(OSVersion, other.OSVersion) && string.Equals(IpAddress, other.IpAddress) && string.Equals(MachineName, other.MachineName) && string.Equals(InstallId, other.InstallId) && string.Equals(RuntimeVersion, other.RuntimeVersion) && Equals(Data, other.Data);
105105
}
106106

107107
public override bool Equals(object obj) {

src/Exceptionless/Models/Client/Data/InnerError.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public InnerError() {
4343
public Method TargetMethod { get; set; }
4444

4545
protected bool Equals(InnerError other) {
46-
return string.Equals(Message, other.Message) && string.Equals(Type, other.Type) && string.Equals(Code, other.Code) && Data.CollectionEquals(other.Data) && Equals(Inner, other.Inner) && StackTrace.CollectionEquals(other.StackTrace) && Equals(TargetMethod, other.TargetMethod);
46+
return string.Equals(Message, other.Message) && string.Equals(Type, other.Type) && string.Equals(Code, other.Code) && Equals(Data, other.Data) && Equals(Inner, other.Inner) && StackTrace.CollectionEquals(other.StackTrace) && Equals(TargetMethod, other.TargetMethod);
4747
}
4848

4949
public override bool Equals(object obj) {

src/Exceptionless/Models/Client/Data/ManualStackingInfo.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,5 @@ public ManualStackingInfo(IDictionary<string, string> signatureData) : this(null
2929
/// Key value pair that determines how the event is stacked.
3030
/// </summary>
3131
public IDictionary<string, string> SignatureData { get; set; }
32-
33-
protected bool Equals(ManualStackingInfo other) {
34-
return string.Equals(Title, other.Title) && SignatureData.CollectionEquals(other.SignatureData);
35-
}
36-
37-
public override bool Equals(object obj) {
38-
if (ReferenceEquals(null, obj))
39-
return false;
40-
if (ReferenceEquals(this, obj))
41-
return true;
42-
if (obj.GetType() != this.GetType())
43-
return false;
44-
return Equals((ManualStackingInfo)obj);
45-
}
46-
47-
public override int GetHashCode() {
48-
unchecked {
49-
return ((Title != null ? Title.GetHashCode() : 0) * 397) ^ (SignatureData != null ? SignatureData.GetCollectionHashCode() : 0);
50-
}
51-
}
5232
}
5333
}

src/Exceptionless/Models/Client/Data/Method.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public Method() {
2020
public ParameterCollection Parameters { get; set; }
2121

2222
protected bool Equals(Method other) {
23-
return IsSignatureTarget == other.IsSignatureTarget && string.Equals(DeclaringNamespace, other.DeclaringNamespace) && string.Equals(DeclaringType, other.DeclaringType) && string.Equals(Name, other.Name) && Data.CollectionEquals(other.Data) && GenericArguments.CollectionEquals(other.GenericArguments) && Parameters.CollectionEquals(other.Parameters);
23+
return IsSignatureTarget == other.IsSignatureTarget && string.Equals(DeclaringNamespace, other.DeclaringNamespace) && string.Equals(DeclaringType, other.DeclaringType) && string.Equals(Name, other.Name) && Equals(Data, other.Data) && GenericArguments.CollectionEquals(other.GenericArguments) && Parameters.CollectionEquals(other.Parameters);
2424
}
2525

2626
public override bool Equals(object obj) {

src/Exceptionless/Models/Client/Data/Module.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override string ToString() {
2727
}
2828

2929
protected bool Equals(Module other) {
30-
return ModuleId == other.ModuleId && string.Equals(Name, other.Name) && string.Equals(Version, other.Version) && IsEntry == other.IsEntry && CreatedDate.Equals(other.CreatedDate) && ModifiedDate.Equals(other.ModifiedDate) && Data.CollectionEquals(other.Data);
30+
return ModuleId == other.ModuleId && string.Equals(Name, other.Name) && string.Equals(Version, other.Version) && IsEntry == other.IsEntry && CreatedDate.Equals(other.CreatedDate) && ModifiedDate.Equals(other.ModifiedDate) && Equals(Data, other.Data);
3131
}
3232

3333
public override bool Equals(object obj) {

src/Exceptionless/Models/Client/Data/Parameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public Parameter() {
1515
public GenericArguments GenericArguments { get; set; }
1616

1717
protected bool Equals(Parameter other) {
18-
return string.Equals(Name, other.Name) && string.Equals(Type, other.Type) && string.Equals(TypeNamespace, other.TypeNamespace) && Data.CollectionEquals(other.Data) && GenericArguments.CollectionEquals(other.GenericArguments);
18+
return string.Equals(Name, other.Name) && string.Equals(Type, other.Type) && string.Equals(TypeNamespace, other.TypeNamespace) && Equals(Data, other.Data) && GenericArguments.CollectionEquals(other.GenericArguments);
1919
}
2020

2121
public override bool Equals(object obj) {

src/Exceptionless/Models/Client/Data/RequestInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public RequestInfo() {
7070
public DataDictionary Data { get; set; }
7171

7272
protected bool Equals(RequestInfo other) {
73-
return string.Equals(UserAgent, other.UserAgent) && string.Equals(HttpMethod, other.HttpMethod) && IsSecure == other.IsSecure && string.Equals(Host, other.Host) && Port == other.Port && string.Equals(Path, other.Path) && string.Equals(Referrer, other.Referrer) && string.Equals(ClientIpAddress, other.ClientIpAddress) && Cookies.CollectionEquals(other.Cookies) && QueryString.CollectionEquals(other.QueryString) && Data.CollectionEquals(other.Data);
73+
return string.Equals(UserAgent, other.UserAgent) && string.Equals(HttpMethod, other.HttpMethod) && IsSecure == other.IsSecure && string.Equals(Host, other.Host) && Port == other.Port && string.Equals(Path, other.Path) && string.Equals(Referrer, other.Referrer) && string.Equals(ClientIpAddress, other.ClientIpAddress) && Cookies.CollectionEquals(other.Cookies) && QueryString.CollectionEquals(other.QueryString) && Equals(Data, other.Data);
7474
}
7575

7676
public override bool Equals(object obj) {

src/Exceptionless/Models/Client/Data/SimpleError.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public SimpleError() {
3232
public SimpleError Inner { get; set; }
3333

3434
protected bool Equals(SimpleError other) {
35-
return string.Equals(Message, other.Message) && string.Equals(Type, other.Type) && string.Equals(StackTrace, other.StackTrace) && Data.CollectionEquals(other.Data) && Equals(Inner, other.Inner);
35+
return string.Equals(Message, other.Message) && string.Equals(Type, other.Type) && string.Equals(StackTrace, other.StackTrace) && Equals(Data, other.Data) && Equals(Inner, other.Inner);
3636
}
3737

3838
public override bool Equals(object obj) {

src/Exceptionless/Models/Client/Data/StackFrame.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class StackFrame : Method {
77
public int Column { get; set; }
88

99
protected bool Equals(StackFrame other) {
10-
return base.Equals(other) && string.Equals(FileName, other.FileName) && LineNumber == other.LineNumber && Column == other.Column;
10+
return base.Equals(other) && string.Equals(FileName, other.FileName);
1111
}
1212

1313
public override bool Equals(object obj) {
@@ -24,8 +24,6 @@ public override int GetHashCode() {
2424
unchecked {
2525
int hashCode = base.GetHashCode();
2626
hashCode = (hashCode * 397) ^ (FileName == null ? 0 : FileName.GetHashCode());
27-
hashCode = (hashCode * 397) ^ LineNumber.GetHashCode();
28-
hashCode = (hashCode * 397) ^ Column.GetHashCode();
2927
return hashCode;
3028
}
3129
}

0 commit comments

Comments
 (0)