diff options
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/OpenId/XriIdentifier.cs')
-rw-r--r-- | src/DotNetOpenAuth.OpenId/OpenId/XriIdentifier.cs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/XriIdentifier.cs b/src/DotNetOpenAuth.OpenId/OpenId/XriIdentifier.cs index aa41a04..4222726 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/XriIdentifier.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/XriIdentifier.cs @@ -21,7 +21,6 @@ namespace DotNetOpenAuth.OpenId { /// An XRI style of OpenID Identifier. /// </summary> [Serializable] - [ContractVerification(true)] [Pure] public sealed class XriIdentifier : Identifier { /// <summary> @@ -61,7 +60,7 @@ namespace DotNetOpenAuth.OpenId { : base(xri, requireSsl) { Requires.NotNullOrEmpty(xri, "xri"); RequiresEx.Format(IsValidXri(xri), OpenIdStrings.InvalidXri); - Contract.Assume(xri != null); // Proven by IsValidXri + Assumes.True(xri != null); // Proven by IsValidXri this.OriginalXri = xri; this.canonicalXri = CanonicalizeXri(xri); } @@ -76,7 +75,6 @@ namespace DotNetOpenAuth.OpenId { /// </summary> internal string CanonicalXri { get { - Contract.Ensures(Contract.Result<string>() != null); return this.canonicalXri; } } @@ -170,7 +168,6 @@ namespace DotNetOpenAuth.OpenId { /// True if the secure conversion was successful. /// False if the Identifier was originally created with an explicit HTTP scheme. /// </returns> - [ContractVerification(false)] // bugs/limitations in CC static analysis internal override bool TryRequireSsl(out Identifier secureIdentifier) { secureIdentifier = IsDiscoverySecureEndToEnd ? this : new XriIdentifier(this, true); return true; @@ -184,10 +181,9 @@ namespace DotNetOpenAuth.OpenId { /// <remarks>The canonical form, per the OpenID spec, is no scheme and no whitespace on either end.</remarks> private static string CanonicalizeXri(string xri) { Requires.NotNull(xri, "xri"); - Contract.Ensures(Contract.Result<string>() != null); xri = xri.Trim(); if (xri.StartsWith(XriScheme, StringComparison.OrdinalIgnoreCase)) { - Contract.Assume(XriScheme.Length <= xri.Length); // should be implied by StartsWith + Assumes.True(XriScheme.Length <= xri.Length); // should be implied by StartsWith xri = xri.Substring(XriScheme.Length); } return xri; |