Skip to content

Commit 438c4c2

Browse files
committed
Fixed a few issues with hashcode checking
1 parent ee09309 commit 438c4c2

File tree

11 files changed

+12
-68
lines changed

11 files changed

+12
-68
lines changed

Source/Shared/Models/Client/Data/EnvironmentInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public override int GetHashCode() {
128128
hashCode = (hashCode * 397) ^ (MachineName == null ? 0 : MachineName.GetHashCode());
129129
hashCode = (hashCode * 397) ^ (InstallId == null ? 0 : InstallId.GetHashCode());
130130
hashCode = (hashCode * 397) ^ (RuntimeVersion == null ? 0 : RuntimeVersion.GetHashCode());
131-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
131+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
132132
return hashCode;
133133
}
134134
}

Source/Shared/Models/Client/Data/InnerError.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public override int GetHashCode() {
6161
var hashCode = Message == null ? 0 : Message.GetHashCode();
6262
hashCode = (hashCode * 397) ^ (Type == null ? 0 : Type.GetHashCode());
6363
hashCode = (hashCode * 397) ^ (Code == null ? 0 : Code.GetHashCode());
64-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
64+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
6565
hashCode = (hashCode * 397) ^ (Inner == null ? 0 : Inner.GetHashCode());
6666
hashCode = (hashCode * 397) ^ (StackTrace == null ? 0 : StackTrace.GetCollectionHashCode());
6767
hashCode = (hashCode * 397) ^ (TargetMethod == null ? 0 : TargetMethod.GetHashCode());

Source/Shared/Models/Client/Data/Method.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override int GetHashCode() {
3939
hashCode = (hashCode * 397) ^ (DeclaringNamespace == null ? 0 : DeclaringNamespace.GetHashCode());
4040
hashCode = (hashCode * 397) ^ (DeclaringType == null ? 0 : DeclaringType.GetHashCode());
4141
hashCode = (hashCode * 397) ^ (Name == null ? 0 : Name.GetHashCode());
42-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
42+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode(new[] { "ILOffset" }));
4343
hashCode = (hashCode * 397) ^ (GenericArguments == null ? 0 : GenericArguments.GetCollectionHashCode());
4444
hashCode = (hashCode * 397) ^ (Parameters == null ? 0 : Parameters.GetCollectionHashCode());
4545
return hashCode;

Source/Shared/Models/Client/Data/Module.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public override int GetHashCode() {
4848
hashCode = (hashCode * 397) ^ IsEntry.GetHashCode();
4949
hashCode = (hashCode * 397) ^ CreatedDate.GetHashCode();
5050
hashCode = (hashCode * 397) ^ ModifiedDate.GetHashCode();
51-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
51+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
5252
return hashCode;
5353
}
5454
}

Source/Shared/Models/Client/Data/Parameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public override int GetHashCode() {
3333
var hashCode = Name == null ? 0 : Name.GetHashCode();
3434
hashCode = (hashCode * 397) ^ (Type == null ? 0 : Type.GetHashCode());
3535
hashCode = (hashCode * 397) ^ (TypeNamespace == null ? 0 : TypeNamespace.GetHashCode());
36-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
36+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
3737
hashCode = (hashCode * 397) ^ (GenericArguments == null ? 0 : GenericArguments.GetCollectionHashCode());
3838
return hashCode;
3939
}

Source/Shared/Models/Client/Data/RequestInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public override int GetHashCode() {
9797
hashCode = (hashCode * 397) ^ (ClientIpAddress == null ? 0 : ClientIpAddress.GetHashCode());
9898
hashCode = (hashCode * 397) ^ (Cookies == null ? 0 : Cookies.GetCollectionHashCode(_cookieHashCodeExclusions));
9999
hashCode = (hashCode * 397) ^ (QueryString == null ? 0 : QueryString.GetCollectionHashCode());
100-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
100+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
101101
return hashCode;
102102
}
103103
}

Source/Shared/Models/Client/Data/SimpleError.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public override int GetHashCode() {
5050
var hashCode = Message == null ? 0 : Message.GetHashCode();
5151
hashCode = (hashCode * 397) ^ (Type == null ? 0 : Type.GetHashCode());
5252
hashCode = (hashCode * 397) ^ (StackTrace == null ? 0 : StackTrace.GetHashCode());
53-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
53+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
5454
hashCode = (hashCode * 397) ^ (Inner == null ? 0 : Inner.GetHashCode());
5555
return hashCode;
5656
}

Source/Shared/Models/Client/Data/UserDescription.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public override int GetHashCode() {
4040
unchecked {
4141
var hashCode = EmailAddress == null ? 0 : EmailAddress.GetHashCode();
4242
hashCode = (hashCode * 397) ^ (Description == null ? 0 : Description.GetHashCode());
43-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
43+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
4444
return hashCode;
4545
}
4646
}

Source/Shared/Models/Client/Data/UserInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public override int GetHashCode() {
4949
unchecked {
5050
var hashCode = Identity == null ? 0 : Identity.GetHashCode();
5151
hashCode = (hashCode * 397) ^ (Name == null ? 0 : Name.GetHashCode());
52-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
52+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
5353
return hashCode;
5454
}
5555
}

Source/Shared/Models/Client/Event.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23

34
namespace Exceptionless.Models {
45
public class Event : IData {
@@ -71,6 +72,7 @@ public override bool Equals(object obj) {
7172
return Equals((Event)obj);
7273
}
7374

75+
private static readonly List<string> _exclusions = new List<string> { KnownDataKeys.TraceLog };
7476
public override int GetHashCode() {
7577
unchecked {
7678
var hashCode = Type == null ? 0 : Type.GetHashCode();
@@ -79,7 +81,7 @@ public override int GetHashCode() {
7981
hashCode = (hashCode * 397) ^ (Message == null ? 0 : Message.GetHashCode());
8082
hashCode = (hashCode * 397) ^ (Geo == null ? 0 : Geo.GetHashCode());
8183
hashCode = (hashCode * 397) ^ Value.GetHashCode();
82-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetHashCode());
84+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode(_exclusions));
8385
return hashCode;
8486
}
8587
}

0 commit comments

Comments
 (0)