Skip to content

Commit a70fa5c

Browse files
committed
Amend comment of complex mapping test
1 parent ff372d5 commit a70fa5c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Slapper.AutoMapper.Tests/ComplexMapTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,16 @@ public void Can_Map_Complex_Nested_Members()
117117
}
118118

119119
/// <summary>
120+
/// OLD SUMMARY ===
120121
/// When mapping, it internally keeps a cache of instantiated objects with the key being the
121122
/// hash of the objects identifier hashes summed together so when another record with the exact
122123
/// same identifier hash is detected, it will re-use the existing instantiated object instead of
123124
/// creating a second one alleviating the burden of the consumer of the library to group objects
124125
/// by their identifier.
126+
/// ===
127+
/// This was flawed as SAME HASHCODE DOESN'T MEAN SAME VALUE. Hash collisions would lead to
128+
/// wrongly reusing an instance instead of creating a new one (issue #48).
129+
/// It's now fixed as real identifier values are compared, not their hashes anymore.
125130
/// </summary>
126131
[Test]
127132
public void Can_Detect_Duplicate_Parent_Members_And_Properly_Instantiate_The_Object_Only_Once()

0 commit comments

Comments
 (0)