<commit_before>﻿// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Microsoft.Fx.Portability.Resources;
using System;

namespace Microsoft.Fx.Portability.ObjectModel
{
    public sealed class AssemblyInfo
    {
        private bool _hashComputed;
        private int _hashCode;

        private string _assemblyIdentity;
        private string _targetFrameworkVersion;
        private string _fileVersion;

        public string AssemblyIdentity
        {
            get { return _assemblyIdentity; }
            set
            {
                _assemblyIdentity = value;
                _hashComputed = false;
            }
        }

        public string FileVersion
        {
            get { return _fileVersion; }
            set
            {
                _fileVersion = value;
                _hashComputed = false;
            }
        }

        public string TargetFrameworkMoniker
        {
            get { return _targetFrameworkVersion; }
            set
            {
                _targetFrameworkVersion = value;
                _hashComputed = false;
            }
        }

        public override bool Equals(object obj)
        {
            AssemblyInfo other = obj as AssemblyInfo;
            if (other == null)
                return false;

            return StringComparer.Ordinal.Equals(other.AssemblyIdentity, AssemblyIdentity)
                && StringComparer.Ordinal.Equals(other.TargetFrameworkMoniker, TargetFrameworkMoniker);
        }

        public override int GetHashCode()
        {
            if (!_hashComputed)
            {
                _hashCode = (AssemblyIdentity ?? string.Empty + (TargetFrameworkMoniker ?? string.Empty)).GetHashCode();
                _hashComputed = true;
            }
            return _hashCode;
        }

        public override string ToString()
        {
            return AssemblyIdentity;
        }

        public string GetFullAssemblyIdentity()
        {
            return string.Format(LocalizedStrings.FullAssemblyIdentity, AssemblyIdentity, FileVersion);
        }
    }
}<commit_msg>Add IComparable implementation to AssemblyInfo<commit_after>﻿// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Microsoft.Fx.Portability.Resources;
using System;

namespace Microsoft.Fx.Portability.ObjectModel
{
    public sealed class AssemblyInfo : IComparable
    {
        private bool _hashComputed;
        private int _hashCode;

        private string _assemblyIdentity;
        private string _targetFrameworkVersion;
        private string _fileVersion;

        public string AssemblyIdentity
        {
            get { return _assemblyIdentity; }
            set
            {
                _assemblyIdentity = value;
                _hashComputed = false;
            }
        }

        public string FileVersion
        {
            get { return _fileVersion; }
            set
            {
                _fileVersion = value;
                _hashComputed = false;
            }
        }

        public string TargetFrameworkMoniker
        {
            get { return _targetFrameworkVersion; }
            set
            {
                _targetFrameworkVersion = value;
                _hashComputed = false;
            }
        }

        public override bool Equals(object obj)
        {
            AssemblyInfo other = obj as AssemblyInfo;
            if (other == null)
                return false;

            return StringComparer.Ordinal.Equals(other.AssemblyIdentity, AssemblyIdentity)
                && StringComparer.Ordinal.Equals(other.TargetFrameworkMoniker, TargetFrameworkMoniker);
        }

        public override int GetHashCode()
        {
            if (!_hashComputed)
            {
                _hashCode = (AssemblyIdentity ?? string.Empty + (TargetFrameworkMoniker ?? string.Empty)).GetHashCode();
                _hashComputed = true;
            }
            return _hashCode;
        }

        public override string ToString()
        {
            return AssemblyIdentity;
        }

        public string GetFullAssemblyIdentity()
        {
            return string.Format(LocalizedStrings.FullAssemblyIdentity, AssemblyIdentity, FileVersion);
        }

        public int CompareTo(object obj)
        {
            var obj2 = obj as AssemblyInfo;
            return AssemblyIdentity.CompareTo(obj2.AssemblyIdentity);
        }
    }
}
{'fraction_non_alphanumeric': 0.06069802731411229, 'fraction_numerical': 0.00043355733795794494, 'mean_word_length': 1.6245733788395904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6740344', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1036, 'n_words': 274}