Skip to content

Commit 612d1b6

Browse files
committed
Merge branch '3.3.x'
2 parents d2735b6 + 0aba60f commit 612d1b6

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

src/NHibernate.Test/MappingByCode/CustomizerHolderMergeTest.cs

+14
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ public void MergeShouldMergeManyToManyMapper()
105105
called.Should().Be.True();
106106
}
107107

108+
[Test]
109+
public void MergeShouldMergeManyToAnyMapper()
110+
{
111+
var emptyHolder = new CustomizersHolder();
112+
var holder = new CustomizersHolder();
113+
var called = false;
114+
115+
holder.AddCustomizer(propertyPath, (IManyToAnyMapper x) => called = true);
116+
emptyHolder.Merge(holder);
117+
emptyHolder.InvokeCustomizers(propertyPath, (IManyToAnyMapper) null);
118+
119+
called.Should().Be.True();
120+
}
121+
108122
[Test]
109123
public void MergeShouldMergeOneToManyMapper()
110124
{

src/NHibernate/Hql/Ast/ANTLR/Tree/ASTNode.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ASTNode : IASTNode, ITree
1717
private readonly IToken _token;
1818
private List<IASTNode> _children;
1919

20-
public ASTNode()
20+
public ASTNode()
2121
: this((IToken)null) {}
2222

2323
public ASTNode(IToken token)
@@ -425,7 +425,6 @@ object ITree.DeleteChild(int i)
425425
{
426426
object node = _children[i];
427427
RemoveChild(i);
428-
429428
return node;
430429
}
431430

@@ -469,7 +468,11 @@ ITree ITree.DupNode()
469468
return (ITree) DupNode();
470469
}
471470

472-
int ITree.ChildIndex { get; set; }
471+
int ITree.ChildIndex
472+
{
473+
get { return _childIndex; }
474+
set { _childIndex = value; }
475+
}
473476

474477
ITree ITree.Parent
475478
{
@@ -513,6 +516,7 @@ IEnumerator IEnumerable.GetEnumerator()
513516
{
514517
return GetEnumerator();
515518
}
519+
516520
#endregion
517521

518522
// //////////////////////////////////////////////////////////

src/NHibernate/Mapping/ByCode/Impl/CustomizersHolder.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ public void Merge(CustomizersHolder source)
364364
MergeDictionary(collectionRelationManyToManyCustomizers, source.collectionRelationManyToManyCustomizers);
365365
MergeDictionary(collectionRelationElementCustomizers, source.collectionRelationElementCustomizers);
366366
MergeDictionary(collectionRelationOneToManyCustomizers, source.collectionRelationOneToManyCustomizers);
367+
MergeDictionary(collectionRelationManyToAnyCustomizers, source.collectionRelationManyToAnyCustomizers);
367368
MergeDictionary(mapKeyManyToManyCustomizers, source.mapKeyManyToManyCustomizers);
368369
MergeDictionary(mapKeyElementCustomizers, source.mapKeyElementCustomizers);
369370
MergeDictionary(dynamicComponentCustomizers, source.dynamicComponentCustomizers);
@@ -387,7 +388,7 @@ private void MergeDictionary<TSubject, TCustomizable>(Dictionary<TSubject, List<
387388
}
388389

389390
private void AddCustomizer<TSubject, TCustomizable>(IDictionary<TSubject, List<Action<TCustomizable>>> customizers,
390-
TSubject member, Action<TCustomizable> customizer)
391+
TSubject member, Action<TCustomizable> customizer)
391392
{
392393
List<Action<TCustomizable>> actions;
393394
if (!customizers.TryGetValue(member, out actions))

0 commit comments

Comments
 (0)