From: NHibernate J. <mik...@us...> - 2006-11-02 06:56:31
|
[ http://jira.nhibernate.org/browse/NH-544?page=all ] Sergey Koshcheyev closed NH-544: -------------------------------- Fix Version: (was: 1.0.3) Resolution: Fixed Won't fix in 1.0.3 since it's not that important. > Small Issue about Iesi.Collection.Set > ------------------------------------- > > Key: NH-544 > URL: http://jira.nhibernate.org/browse/NH-544 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.0.2 > Reporter: Kailuo Wang > Priority: Trivial > Fix For: 1.2.0.Alpha1 > Attachments: Set.cs.rar > > In the set class, the method ExclusiveOr was writen as follow > public static ISet ExclusiveOr(ISet a, ISet b) > { > if(a == null && b == null) > return null; > else if(a == null) > return (Set)b.Clone(); > else if(b == null) > return (Set)a.Clone(); > else > return a.ExclusiveOr(b); > } > Note that the clones of a and b were uneccessarily down cast to Set, while in the Union method of this class, these two clones are down cast to ISet. Although this won't affect any current usage, but for people who wants to have their own implementations of ISet ( an example[^]), this could be a problem. > I did try modify the code to > return (ISet)b.Clone(); > ... > return (ISet)a.Clone(); > And all the Unit Tests from Nhibernate were passed > Attached is the modified Set.cs, these two lines are the only change from the original one -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |