From e5428d9350a1c73d0df7a6cc0bdc14eab1e27eca Mon Sep 17 00:00:00 2001 From: jbevain Date: Thu, 8 Apr 2010 14:08:01 +0000 Subject: [PATCH] 2010-04-08 Jb Evain * FrameworkName.cs: add missing Equals override. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@155047 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/System/System.Runtime.Versioning/ChangeLog | 4 ++++ class/System/System.Runtime.Versioning/FrameworkName.cs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/class/System/System.Runtime.Versioning/ChangeLog b/class/System/System.Runtime.Versioning/ChangeLog index 66df0a78af..873b6e297e 100644 --- a/class/System/System.Runtime.Versioning/ChangeLog +++ b/class/System/System.Runtime.Versioning/ChangeLog @@ -1,3 +1,7 @@ +2010-04-08 Jb Evain + + * FrameworkName.cs: add missing Equals override. + 2010-04-06 Jb Evain * FrameworkName.cs: moved here from corlib where it was pre-RC. diff --git a/class/System/System.Runtime.Versioning/FrameworkName.cs b/class/System/System.Runtime.Versioning/FrameworkName.cs index 2c15444f72..35253ba5fa 100644 --- a/class/System/System.Runtime.Versioning/FrameworkName.cs +++ b/class/System/System.Runtime.Versioning/FrameworkName.cs @@ -107,11 +107,19 @@ namespace System.Runtime.Versioning public bool Equals (FrameworkName other) { + if (Object.ReferenceEquals (other, null)) + return false; + return (other.Version == this.Version && String.Compare (other.Identifier, this.Identifier, StringComparison.Ordinal) == 0 && String.Compare (other.Profile, this.Profile, StringComparison.Ordinal) == 0); } + public override bool Equals (object obj) + { + return Equals (obj as FrameworkName); + } + public override int GetHashCode () { if (hashCode == null) { -- 2.11.4.GIT