Don't use conditional annotations

Don't use conditional annotations

--- src/Shared/JetBrains.Annotations.cs
+++ src/Shared/JetBrains.Annotations.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Diagnostics;

 #pragma warning disable 1591
 // ReSharper disable UnusedMember.Global
@@ -11,1055 +10,999 @@

 namespace JetBrains.Annotations
 {
-  ///
-  /// Indicates that the value of the marked element could be <c>null</c> sometimes,
-  /// so the check for <c>null</c> is necessary before its usage.
-  ///
-  /// <example>
-  /// [CanBeNull] object Test() => null;
-  ///
-  /// void UseTest() {
-  ///   var p = Test();
-  ///   var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
-  /// }
-  /// </example>
-  [AttributeUsage(
-    AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
-    AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class CanBeNullAttribute : Attribute { }
-
-  ///
-  /// Indicates that the value of the marked element could never be <c>null</c>.
-  ///
-  /// <example>
-  /// [NotNull] object Foo() {
-  ///   return null; // Warning: Possible 'null' assignment
-  /// }
-  /// </example>
-  [AttributeUsage(
-    AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
-    AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class NotNullAttribute : Attribute { }
-
-  ///
-  /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task
-  /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
-  /// or of the Lazy.Value property can never be null.
-  ///
-  [AttributeUsage(
-    AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
-    AttributeTargets.Delegate | AttributeTargets.Field)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class ItemNotNullAttribute : Attribute { }
-
-  ///
-  /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task
-  /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
-  /// or of the Lazy.Value property can be null.
-  ///
-  [AttributeUsage(
-    AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
-    AttributeTargets.Delegate | AttributeTargets.Field)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class ItemCanBeNullAttribute : Attribute { }
-
-  ///
-  /// Indicates that the marked method builds string by format pattern and (optional) arguments.
-  /// Parameter, which contains format string, should be given in constructor. The format string
-  /// should be in <see cref="string.Format(IFormatProvider,string,object[])"/>-like form.
-  ///
-  /// <example>
-  /// [StringFormatMethod("message")]
-  /// void ShowError(string message, params object[] args) { /* do something */ }
-  ///
-  /// void Foo() {
-  ///   ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
-  /// }
-  /// </example>
-  [AttributeUsage(
-    AttributeTargets.Constructor | AttributeTargets.Method |
-    AttributeTargets.Property | AttributeTargets.Delegate)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class StringFormatMethodAttribute : Attribute
-  {
-    /// <param name="formatParameterName">
-    /// Specifies which parameter of an annotated method should be treated as format-string
-    /// </param>
-    public StringFormatMethodAttribute(string formatParameterName)
-    {
-      FormatParameterName = formatParameterName;
-    }
-
-    public string FormatParameterName { get; private set; }
-  }
-
-  ///
-  /// For a parameter that is expected to be one of the limited set of values.
-  /// Specify fields of which type should be used as values for this parameter.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class ValueProviderAttribute : Attribute
-  {
-    public ValueProviderAttribute(string name)
-    {
-      Name = name;
-    }
-
-    [NotNull] public string Name { get; private set; }
-  }
-
-  ///
-  /// Indicates that the function argument should be string literal and match one
-  /// of the parameters of the caller function. For example, ReSharper annotates
-  /// the parameter of <see cref="System.ArgumentNullException"/>.
-  ///
-  /// <example>
-  /// void Foo(string param) {
-  ///   if (param == null)
-  ///     throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
-  /// }
-  /// </example>
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class InvokerParameterNameAttribute : Attribute { }
-
-  ///
-  /// Indicates that the method is contained in a type that implements
-  /// <c>System.ComponentModel.INotifyPropertyChanged</c> interface and this method
-  /// is used to notify that some property value changed.
-  ///
-  /// <remarks>
-  /// The method should be non-static and conform to one of the supported signatures:
-  /// <list>
-  /// <item><c>NotifyChanged(string)</c></item>
-  /// <item><c>NotifyChanged(params string[])</c></item>
-  /// <item><c>NotifyChanged{T}(Expression{Func{T}})</c></item>
-  /// <item><c>NotifyChanged{T,U}(Expression{Func{T,U}})</c></item>
-  /// <item><c>SetProperty{T}(ref T, T, string)</c></item>
-  /// </list>
-  /// </remarks>
-  /// <example>
-  /// public class Foo : INotifyPropertyChanged {
-  ///   public event PropertyChangedEventHandler PropertyChanged;
-  ///
-  ///   [NotifyPropertyChangedInvocator]
-  ///   protected virtual void NotifyChanged(string propertyName) { ... }
-  ///
-  ///   string _name;
-  ///
-  ///   public string Name {
-  ///     get { return _name; }
-  ///     set { _name = value; NotifyChanged("LastName"); /* Warning */ }
-  ///   }
-  /// }
-  ///
-  /// Examples of generated notifications:
-  /// <list>
-  /// <item><c>NotifyChanged("Property")</c></item>
-  /// <item><c>NotifyChanged(() => Property)</c></item>
-  /// <item><c>NotifyChanged((VM x) => x.Property)</c></item>
-  /// <item><c>SetProperty(ref myField, value, "Property")</c></item>
-  /// </list>
-  /// </example>
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
-  {
-    public NotifyPropertyChangedInvocatorAttribute() { }
-    public NotifyPropertyChangedInvocatorAttribute(string parameterName)
-    {
-      ParameterName = parameterName;
-    }
-
-    public string ParameterName { get; private set; }
-  }
-
-  ///
-  /// Describes dependency between method input and output.
-  ///
-  /// <syntax>
-  ///
Function Definition Table syntax:

-  /// <list>
-  /// <item>FDT      ::= FDTRow [;FDTRow]*</item>
-  /// <item>FDTRow   ::= Input => Output | Output <= Input</item>
-  /// <item>Input    ::= ParameterName: Value [, Input]*</item>
-  /// <item>Output   ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}</item>
-  /// <item>Value    ::= true | false | null | notnull | canbenull</item>
-  /// </list>
-  /// If method has single input parameter, it's name could be omitted.

-  /// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same)
-  /// for method output means that the methos doesn't return normally.

-  /// <c>canbenull</c> annotation is only applicable for output parameters.

-  /// You can use multiple <c>[ContractAnnotation]</c> for each FDT row,
-  /// or use single attribute with rows separated by semicolon.

-  /// </syntax>
-  /// <examples><list>
-  /// <item>
-  /// [ContractAnnotation("=> halt")]
-  /// public void TerminationMethod()
-  /// </item>
-  /// <item>
-  /// [ContractAnnotation("halt <= condition: false")]
-  /// public void Assert(bool condition, string text) // regular assertion method
-  /// </item>
-  /// <item>
-  /// [ContractAnnotation("s:null => true")]
-  /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
-  /// </item>
-  /// <item>
-  /// // A method that returns null if the parameter is null,
-  /// // and not null if the parameter is not null
-  /// [ContractAnnotation("null => null; notnull => notnull")]
-  /// public object Transform(object data)
-  /// </item>
-  /// <item>
-  /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
-  /// public bool TryParse(string s, out Person result)
-  /// </item>
-  /// </list></examples>
-  [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class ContractAnnotationAttribute : Attribute
-  {
-    public ContractAnnotationAttribute([NotNull] string contract)
-      : this(contract, false) { }
-
-    public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates)
-    {
-      Contract = contract;
-      ForceFullStates = forceFullStates;
-    }
-
-    public string Contract { get; private set; }
-    public bool ForceFullStates { get; private set; }
-  }
-
-  ///
-  /// Indicates that marked element should be localized or not.
-  ///
-  /// <example>
-  /// [LocalizationRequiredAttribute(true)]
-  /// class Foo {
-  ///   string str = "my string"; // Warning: Localizable string
-  /// }
-  /// </example>
-  [AttributeUsage(AttributeTargets.All)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class LocalizationRequiredAttribute : Attribute
-  {
-    public LocalizationRequiredAttribute() : this(true) { }
-    public LocalizationRequiredAttribute(bool required)
-    {
-      Required = required;
-    }
-
-    public bool Required { get; private set; }
-  }
-
-  ///
-  /// Indicates that the value of the marked type (or its derivatives)
-  /// cannot be compared using '==' or '!=' operators and <c>Equals()</c>
-  /// should be used instead. However, using '==' or '!=' for comparison
-  /// with <c>null</c> is always permitted.
-  ///
-  /// <example>
-  /// [CannotApplyEqualityOperator]
-  /// class NoEquality { }
-  ///
-  /// class UsesNoEquality {
-  ///   void Test() {
-  ///     var ca1 = new NoEquality();
-  ///     var ca2 = new NoEquality();
-  ///     if (ca1 != null) { // OK
-  ///       bool condition = ca1 == ca2; // Warning
-  ///     }
-  ///   }
-  /// }
-  /// </example>
-  [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class CannotApplyEqualityOperatorAttribute : Attribute { }
-
-  ///
-  /// When applied to a target attribute, specifies a requirement for any type marked
-  /// with the target attribute to implement or inherit specific type or types.
-  ///
-  /// <example>
-  /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement
-  /// class ComponentAttribute : Attribute { }
-  ///
-  /// [Component] // ComponentAttribute requires implementing IComponent interface
-  /// class MyComponent : IComponent { }
-  /// </example>
-  [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-  [BaseTypeRequired(typeof(Attribute))]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class BaseTypeRequiredAttribute : Attribute
-  {
-    public BaseTypeRequiredAttribute([NotNull] Type baseType)
-    {
-      BaseType = baseType;
-    }
-
-    [NotNull] public Type BaseType { get; private set; }
-  }
-
-  ///
-  /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library),
-  /// so this symbol will not be marked as unused (as well as by other usage inspections).
-  ///
-  [AttributeUsage(AttributeTargets.All)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class UsedImplicitlyAttribute : Attribute
-  {
-    public UsedImplicitlyAttribute()
-      : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
-
-    public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)
-      : this(useKindFlags, ImplicitUseTargetFlags.Default) { }
-
-    public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)
-      : this(ImplicitUseKindFlags.Default, targetFlags) { }
-
-    public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
-    {
-      UseKindFlags = useKindFlags;
-      TargetFlags = targetFlags;
-    }
-
-    public ImplicitUseKindFlags UseKindFlags { get; private set; }
-    public ImplicitUseTargetFlags TargetFlags { get; private set; }
-  }
-
-  ///
-  /// Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes
-  /// as unused (as well as by other usage inspections)
-  ///
-  [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class MeansImplicitUseAttribute : Attribute
-  {
-    public MeansImplicitUseAttribute()
-      : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
-
-    public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)
-      : this(useKindFlags, ImplicitUseTargetFlags.Default) { }
-
-    public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)
-      : this(ImplicitUseKindFlags.Default, targetFlags) { }
-
-    public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
-    {
-      UseKindFlags = useKindFlags;
-      TargetFlags = targetFlags;
-    }
-
-    [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; }
-    [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; }
-  }
-
-  [Flags]
-internal enum ImplicitUseKindFlags
-  {
-    Default = Access | Assign | InstantiatedWithFixedConstructorSignature,
-    /// Only entity marked with attribute considered used.
-    Access = 1,
-    /// Indicates implicit assignment to a member.
-    Assign = 2,
-    ///
-    /// Indicates implicit instantiation of a type with fixed constructor signature.
-    /// That means any unused constructor parameters won't be reported as such.
-    ///
-    InstantiatedWithFixedConstructorSignature = 4,
-    /// Indicates implicit instantiation of a type.
-    InstantiatedNoFixedConstructorSignature = 8,
-  }
-
-  ///
-  /// Specify what is considered used implicitly when marked
-  /// with <see cref="MeansImplicitUseAttribute"/> or <see cref="UsedImplicitlyAttribute"/>.
-  ///
-  [Flags]
-internal enum ImplicitUseTargetFlags
-  {
-    Default = Itself,
-    Itself = 1,
-    /// Members of entity marked with attribute are considered used.
-    Members = 2,
-    /// Entity marked with attribute and all its members considered used.
-    WithMembers = Itself | Members
-  }
-
-  ///
-  /// This attribute is intended to mark publicly available API
-  /// which should not be removed and so is treated as used.
-  ///
-  [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class PublicAPIAttribute : Attribute
-  {
-    public PublicAPIAttribute() { }
-    public PublicAPIAttribute([NotNull] string comment)
-    {
-      Comment = comment;
-    }
-
-    public string Comment { get; private set; }
-  }
-
-  ///
-  /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack.
-  /// If the parameter is a delegate, indicates that delegate is executed while the method is executed.
-  /// If the parameter is an enumerable, indicates that it is enumerated while the method is executed.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class InstantHandleAttribute : Attribute { }
-
-  ///
-  /// Indicates that a method does not make any observable state changes.
-  /// The same as <c>System.Diagnostics.Contracts.PureAttribute</c>.
-  ///
-  /// <example>
-  /// [Pure] int Multiply(int x, int y) => x * y;
-  ///
-  /// void M() {
-  ///   Multiply(123, 42); // Waring: Return value of pure method is not used
-  /// }
-  /// </example>
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class PureAttribute : Attribute { }
-
-  ///
-  /// Indicates that the return value of method invocation must be used.
-  ///
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class MustUseReturnValueAttribute : Attribute
-  {
-    public MustUseReturnValueAttribute() { }
-    public MustUseReturnValueAttribute([NotNull] string justification)
-    {
-      Justification = justification;
-    }
-
-    public string Justification { get; private set; }
-  }
-
-  ///
-  /// Indicates the type member or parameter of some type, that should be used instead of all other ways
-  /// to get the value that type. This annotation is useful when you have some "context" value evaluated
-  /// and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one.
-  ///
-  /// <example>
-  /// class Foo {
-  ///   [ProvidesContext] IBarService _barService = ...;
-  ///
-  ///   void ProcessNode(INode node) {
-  ///     DoSomething(node, node.GetGlobalServices().Bar);
-  ///     //              ^ Warning: use value of '_barService' field
-  ///   }
-  /// }
-  /// </example>
-  [AttributeUsage(
-    AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter |
-    AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class ProvidesContextAttribute : Attribute { }
-
-  ///
-  /// Indicates that a parameter is a path to a file or a folder within a web project.
-  /// Path can be relative or absolute, starting from web root (~).
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class PathReferenceAttribute : Attribute
-  {
-    public PathReferenceAttribute() { }
-    public PathReferenceAttribute([PathReference] string basePath)
-    {
-      BasePath = basePath;
-    }
-
-    public string BasePath { get; private set; }
-  }
-
-  ///
-  /// An extension method marked with this attribute is processed by ReSharper code completion
-  /// as a 'Source Template'. When extension method is completed over some expression, it's source code
-  /// is automatically expanded like a template at call site.
-  ///
-  /// <remarks>
-  /// Template method body can contain valid source code and/or special comments starting with '$'.
-  /// Text inside these comments is added as source code when the template is applied. Template parameters
-  /// can be used either as additional method parameters or as identifiers wrapped in two '$' signs.
-  /// Use the <see cref="MacroAttribute"/> attribute to specify macros for parameters.
-  /// </remarks>
-  /// <example>
-  /// In this example, the 'forEach' method is a source template available over all values
-  /// of enumerable types, producing ordinary C# 'foreach' statement and placing caret inside block:
-  ///
-  /// [SourceTemplate]
-  /// public static void forEach<T>(this IEnumerable<T> xs) {
-  ///   foreach (var x in xs) {
-  ///      //$ $END$
-  ///   }
-  /// }
-  ///
-  /// </example>
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class SourceTemplateAttribute : Attribute { }
-
-  ///
-  /// Allows specifying a macro for a parameter of a <see cref="SourceTemplateAttribute">source template</see>.
-  ///
-  /// <remarks>
-  /// You can apply the attribute on the whole method or on any of its additional parameters. The macro expression
-  /// is defined in the <see cref="MacroAttribute.Expression"/> property. When applied on a method, the target
-  /// template parameter is defined in the <see cref="MacroAttribute.Target"/> property. To apply the macro silently
-  /// for the parameter, set the <see cref="MacroAttribute.Editable"/> property value = -1.
-  /// </remarks>
-  /// <example>
-  /// Applying the attribute on a source template method:
-  ///
-  /// [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")]
-  /// public static void forEach<T>(this IEnumerable<T> collection) {
-  ///   foreach (var item in collection) {
-  ///     //$ $END$
-  ///   }
-  /// }
-  ///
-  /// Applying the attribute on a template method parameter:
-  ///
-  /// [SourceTemplate]
-  /// public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) {
-  ///   /*$ var $x$Id = "$newguid$" + x.ToString();
-  ///   x.DoSomething($x$Id); */
-  /// }
-  ///
-  /// </example>
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class MacroAttribute : Attribute
-  {
-    ///
-    /// Allows specifying a macro that will be executed for a <see cref="SourceTemplateAttribute">source template</see>
-    /// parameter when the template is expanded.
-    ///
-    public string Expression { get; set; }
-
-    ///
-    /// Allows specifying which occurrence of the target parameter becomes editable when the template is deployed.
+    ///
+    /// Indicates that the value of the marked element could be <c>null</c> sometimes,
+    /// so the check for <c>null</c> is necessary before its usage.
+    ///
+    /// <example>
+    /// [CanBeNull] object Test() => null;
+    ///
+    /// void UseTest() {
+    ///   var p = Test();
+    ///   var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
+    /// }
+    /// </example>
+    [AttributeUsage(
+      AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
+      AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]
+    internal sealed class CanBeNullAttribute : Attribute { }
+
+    ///
+    /// Indicates that the value of the marked element could never be <c>null</c>.
+    ///
+    /// <example>
+    /// [NotNull] object Foo() {
+    ///   return null; // Warning: Possible 'null' assignment
+    /// }
+    /// </example>
+    [AttributeUsage(
+      AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
+      AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]
+    internal sealed class NotNullAttribute : Attribute { }
+
+    ///
+    /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task
+    /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
+    /// or of the Lazy.Value property can never be null.
+    ///
+    [AttributeUsage(
+      AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
+      AttributeTargets.Delegate | AttributeTargets.Field)]
+    internal sealed class ItemNotNullAttribute : Attribute { }
+
+    ///
+    /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task
+    /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property
+    /// or of the Lazy.Value property can be null.
+    ///
+    [AttributeUsage(
+      AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |
+      AttributeTargets.Delegate | AttributeTargets.Field)]
+    internal sealed class ItemCanBeNullAttribute : Attribute { }
+
+    ///
+    /// Indicates that the marked method builds string by format pattern and (optional) arguments.
+    /// Parameter, which contains format string, should be given in constructor. The format string
+    /// should be in <see cref="string.Format(IFormatProvider,string,object[])"/>-like form.
+    ///
+    /// <example>
+    /// [StringFormatMethod("message")]
+    /// void ShowError(string message, params object[] args) { /* do something */ }
+    ///
+    /// void Foo() {
+    ///   ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
+    /// }
+    /// </example>
+    [AttributeUsage(
+      AttributeTargets.Constructor | AttributeTargets.Method |
+      AttributeTargets.Property | AttributeTargets.Delegate)]
+    internal sealed class StringFormatMethodAttribute : Attribute
+    {
+        /// <param name="formatParameterName">
+        /// Specifies which parameter of an annotated method should be treated as format-string
+        /// </param>
+        public StringFormatMethodAttribute(string formatParameterName)
+        {
+            FormatParameterName = formatParameterName;
+        }
+
+        public string FormatParameterName { get; private set; }
+    }
+
+    ///
+    /// For a parameter that is expected to be one of the limited set of values.
+    /// Specify fields of which type should be used as values for this parameter.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]
+    internal sealed class ValueProviderAttribute : Attribute
+    {
+        public ValueProviderAttribute(string name)
+        {
+            Name = name;
+        }
+
+        [NotNull]
+        public string Name { get; private set; }
+    }
+
+    ///
+    /// Indicates that the function argument should be string literal and match one
+    /// of the parameters of the caller function. For example, ReSharper annotates
+    /// the parameter of <see cref="System.ArgumentNullException"/>.
+    ///
+    /// <example>
+    /// void Foo(string param) {
+    ///   if (param == null)
+    ///     throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
+    /// }
+    /// </example>
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class InvokerParameterNameAttribute : Attribute { }
+
+    ///
+    /// Indicates that the method is contained in a type that implements
+    /// <c>System.ComponentModel.INotifyPropertyChanged</c> interface and this method
+    /// is used to notify that some property value changed.
     ///
     /// <remarks>
-    /// If the target parameter is used several times in the template, only one occurrence becomes editable;
-    /// other occurrences are changed synchronously. To specify the zero-based index of the editable occurrence,
-    /// use values >= 0. To make the parameter non-editable when the template is expanded, use -1.
-    /// </remarks>>
-    public int Editable { get; set; }
-
-    ///
-    /// Identifies the target parameter of a <see cref="SourceTemplateAttribute">source template</see> if the
-    /// <see cref="MacroAttribute"/> is applied on a template method.
-    ///
-    public string Target { get; set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute
-  {
-    public AspMvcAreaMasterLocationFormatAttribute(string format)
-    {
-      Format = format;
-    }
-
-    public string Format { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute
-  {
-    public AspMvcAreaPartialViewLocationFormatAttribute(string format)
-    {
-      Format = format;
-    }
-
-    public string Format { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcAreaViewLocationFormatAttribute : Attribute
-  {
-    public AspMvcAreaViewLocationFormatAttribute(string format)
-    {
-      Format = format;
-    }
-
-    public string Format { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcMasterLocationFormatAttribute : Attribute
-  {
-    public AspMvcMasterLocationFormatAttribute(string format)
-    {
-      Format = format;
-    }
-
-    public string Format { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcPartialViewLocationFormatAttribute : Attribute
-  {
-    public AspMvcPartialViewLocationFormatAttribute(string format)
-    {
-      Format = format;
-    }
-
-    public string Format { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcViewLocationFormatAttribute : Attribute
-  {
-    public AspMvcViewLocationFormatAttribute(string format)
-    {
-      Format = format;
-    }
-
-    public string Format { get; private set; }
-  }
-
-  ///
-  /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
-  /// is an MVC action. If applied to a method, the MVC action name is calculated
-  /// implicitly from the context. Use this attribute for custom wrappers similar to
-  /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcActionAttribute : Attribute
-  {
-    public AspMvcActionAttribute() { }
-    public AspMvcActionAttribute(string anonymousProperty)
-    {
-      AnonymousProperty = anonymousProperty;
-    }
-
-    public string AnonymousProperty { get; private set; }
-  }
-
-  ///
-  /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area.
-  /// Use this attribute for custom wrappers similar to
-  /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcAreaAttribute : Attribute
-  {
-    public AspMvcAreaAttribute() { }
-    public AspMvcAreaAttribute(string anonymousProperty)
-    {
-      AnonymousProperty = anonymousProperty;
-    }
-
-    public string AnonymousProperty { get; private set; }
-  }
-
-  ///
-  /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is
-  /// an MVC controller. If applied to a method, the MVC controller name is calculated
-  /// implicitly from the context. Use this attribute for custom wrappers similar to
-  /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcControllerAttribute : Attribute
-  {
-    public AspMvcControllerAttribute() { }
-    public AspMvcControllerAttribute(string anonymousProperty)
-    {
-      AnonymousProperty = anonymousProperty;
-    }
-
-    public string AnonymousProperty { get; private set; }
-  }
-
-  ///
-  /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute
-  /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcMasterAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute
-  /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, Object)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcModelTypeAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC
-  /// partial view. If applied to a method, the MVC partial view name is calculated implicitly
-  /// from the context. Use this attribute for custom wrappers similar to
-  /// <c>System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcPartialViewAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method.
-  ///
-  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcSuppressViewErrorAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.
-  /// Use this attribute for custom wrappers similar to
-  /// <c>System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcDisplayTemplateAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template.
-  /// Use this attribute for custom wrappers similar to
-  /// <c>System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcEditorTemplateAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template.
-  /// Use this attribute for custom wrappers similar to
-  /// <c>System.ComponentModel.DataAnnotations.UIHintAttribute(System.String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcTemplateAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
-  /// is an MVC view component. If applied to a method, the MVC view name is calculated implicitly
-  /// from the context. Use this attribute for custom wrappers similar to
-  /// <c>System.Web.Mvc.Controller.View(Object)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcViewAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
-  /// is an MVC view component name.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcViewComponentAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
-  /// is an MVC view component view. If applied to a method, the MVC view component view name is default.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcViewComponentViewAttribute : Attribute { }
-
-  ///
-  /// ASP.NET MVC attribute. When applied to a parameter of an attribute,
-  /// indicates that this parameter is an MVC action name.
-  ///
-  /// <example>
-  /// [ActionName("Foo")]
-  /// public ActionResult Login(string returnUrl) {
-  ///   ViewBag.ReturnUrl = Url.Action("Foo"); // OK
-  ///   return RedirectToAction("Bar"); // Error: Cannot resolve action
-  /// }
-  /// </example>
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMvcActionSelectorAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class HtmlElementAttributesAttribute : Attribute
-  {
-    public HtmlElementAttributesAttribute() { }
-    public HtmlElementAttributesAttribute(string name)
-    {
-      Name = name;
-    }
-
-    public string Name { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class HtmlAttributeValueAttribute : Attribute
-  {
-    public HtmlAttributeValueAttribute([NotNull] string name)
-    {
-      Name = name;
-    }
-
-    [NotNull] public string Name { get; private set; }
-  }
-
-  ///
-  /// Razor attribute. Indicates that a parameter or a method is a Razor section.
-  /// Use this attribute for custom wrappers similar to
-  /// <c>System.Web.WebPages.WebPageBase.RenderSection(String)</c>.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorSectionAttribute : Attribute { }
-
-  ///
-  /// Indicates how method, constructor invocation or property access
-  /// over collection type affects content of the collection.
-  ///
-  [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class CollectionAccessAttribute : Attribute
-  {
-    public CollectionAccessAttribute(CollectionAccessType collectionAccessType)
-    {
-      CollectionAccessType = collectionAccessType;
-    }
-
-    public CollectionAccessType CollectionAccessType { get; private set; }
-  }
-
-  [Flags]
-internal enum CollectionAccessType
-  {
-    /// Method does not use or modify content of the collection.
-    None = 0,
-    /// Method only reads content of the collection but does not modify it.
-    Read = 1,
-    /// Method can change content of the collection but does not add new elements.
-    ModifyExistingContent = 2,
-    /// Method can add new elements to the collection.
-    UpdatedContent = ModifyExistingContent | 4
-  }
-
-  ///
-  /// Indicates that the marked method is assertion method, i.e. it halts control flow if
-  /// one of the conditions is satisfied. To set the condition, mark one of the parameters with
-  /// <see cref="AssertionConditionAttribute"/> attribute.
-  ///
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AssertionMethodAttribute : Attribute { }
-
-  ///
-  /// Indicates the condition parameter of the assertion method. The method itself should be
-  /// marked by <see cref="AssertionMethodAttribute"/> attribute. The mandatory argument of
-  /// the attribute is the assertion type.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AssertionConditionAttribute : Attribute
-  {
-    public AssertionConditionAttribute(AssertionConditionType conditionType)
-    {
-      ConditionType = conditionType;
-    }
-
-    public AssertionConditionType ConditionType { get; private set; }
-  }
-
-  ///
-  /// Specifies assertion type. If the assertion method argument satisfies the condition,
-  /// then the execution continues. Otherwise, execution is assumed to be halted.
-  ///
-internal enum AssertionConditionType
-  {
-    /// Marked parameter should be evaluated to true.
-    IS_TRUE = 0,
-    /// Marked parameter should be evaluated to false.
-    IS_FALSE = 1,
-    /// Marked parameter should be evaluated to null value.
-    IS_NULL = 2,
-    /// Marked parameter should be evaluated to not null value.
-    IS_NOT_NULL = 3,
-  }
-
-  ///
-  /// Indicates that the marked method unconditionally terminates control flow execution.
-  /// For example, it could unconditionally throw exception.
-  ///
-  [Obsolete("Use [ContractAnnotation('=> halt')] instead")]
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class TerminatesProgramAttribute : Attribute { }
-
-  ///
-  /// Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select,
-  /// .Where). This annotation allows inference of [InstantHandle] annotation for parameters
-  /// of delegate type by analyzing LINQ method chains.
-  ///
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class LinqTunnelAttribute : Attribute { }
-
-  ///
-  /// Indicates that IEnumerable, passed as parameter, is not enumerated.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class NoEnumerationAttribute : Attribute { }
-
-  ///
-  /// Indicates that parameter is regular expression pattern.
-  ///
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RegexPatternAttribute : Attribute { }
-
-  ///
-  /// XAML attribute. Indicates the type that has <c>ItemsSource</c> property and should be treated
-  /// as <c>ItemsControl</c>-derived type, to enable inner items <c>DataContext</c> type resolve.
-  ///
-  [AttributeUsage(AttributeTargets.Class)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class XamlItemsControlAttribute : Attribute { }
-
-  ///
-  /// XAML attribute. Indicates the property of some <c>BindingBase</c>-derived type, that
-  /// is used to bind some item of <c>ItemsControl</c>-derived type. This annotation will
-  /// enable the <c>DataContext</c> type resolve for XAML bindings for such properties.
-  ///
-  /// <remarks>
-  /// Property should have the tree ancestor of the <c>ItemsControl</c> type or
-  /// marked with the <see cref="XamlItemsControlAttribute"/> attribute.
-  /// </remarks>
-  [AttributeUsage(AttributeTargets.Property)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class XamlItemBindingOfItemsControlAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspChildControlTypeAttribute : Attribute
-  {
-    public AspChildControlTypeAttribute(string tagName, Type controlType)
-    {
-      TagName = tagName;
-      ControlType = controlType;
-    }
-
-    public string TagName { get; private set; }
-    public Type ControlType { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspDataFieldAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspDataFieldsAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Property)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspMethodPropertyAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspRequiredAttributeAttribute : Attribute
-  {
-    public AspRequiredAttributeAttribute([NotNull] string attribute)
-    {
-      Attribute = attribute;
-    }
-
-    public string Attribute { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Property)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class AspTypePropertyAttribute : Attribute
-  {
-    public bool CreateConstructorReferences { get; private set; }
-
-    public AspTypePropertyAttribute(bool createConstructorReferences)
-    {
-      CreateConstructorReferences = createConstructorReferences;
-    }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorImportNamespaceAttribute : Attribute
-  {
-    public RazorImportNamespaceAttribute(string name)
-    {
-      Name = name;
-    }
-
-    public string Name { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorInjectionAttribute : Attribute
-  {
-    public RazorInjectionAttribute(string type, string fieldName)
-    {
-      Type = type;
-      FieldName = fieldName;
-    }
-
-    public string Type { get; private set; }
-    public string FieldName { get; private set; }
-  }
-
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorHelperCommonAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Property)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorLayoutAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorWriteLiteralMethodAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Method)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorWriteMethodAttribute : Attribute { }
-
-  [AttributeUsage(AttributeTargets.Parameter)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class RazorWriteMethodParameterAttribute : Attribute { }
-
-  ///
-  /// Prevents the Member Reordering feature from tossing members of the marked class.
-  ///
-  /// <remarks>
-  /// The attribute must be mentioned in your member reordering patterns
-  /// </remarks>
-  [AttributeUsage(AttributeTargets.All)]
-  [Conditional("JETBRAINS_ANNOTATIONS")]
-internal sealed class NoReorder : Attribute { }
+    /// The method should be non-static and conform to one of the supported signatures:
+    /// <list>
+    /// <item><c>NotifyChanged(string)</c></item>
+    /// <item><c>NotifyChanged(params string[])</c></item>
+    /// <item><c>NotifyChanged{T}(Expression{Func{T}})</c></item>
+    /// <item><c>NotifyChanged{T,U}(Expression{Func{T,U}})</c></item>
+    /// <item><c>SetProperty{T}(ref T, T, string)</c></item>
+    /// </list>
+    /// </remarks>
+    /// <example>
+    /// public class Foo : INotifyPropertyChanged {
+    ///   public event PropertyChangedEventHandler PropertyChanged;
+    ///
+    ///   [NotifyPropertyChangedInvocator]
+    ///   protected virtual void NotifyChanged(string propertyName) { ... }
+    ///
+    ///   string _name;
+    ///
+    ///   public string Name {
+    ///     get { return _name; }
+    ///     set { _name = value; NotifyChanged("LastName"); /* Warning */ }
+    ///   }
+    /// }
+    ///
+    /// Examples of generated notifications:
+    /// <list>
+    /// <item><c>NotifyChanged("Property")</c></item>
+    /// <item><c>NotifyChanged(() => Property)</c></item>
+    /// <item><c>NotifyChanged((VM x) => x.Property)</c></item>
+    /// <item><c>SetProperty(ref myField, value, "Property")</c></item>
+    /// </list>
+    /// </example>
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
+    {
+        public NotifyPropertyChangedInvocatorAttribute() { }
+        public NotifyPropertyChangedInvocatorAttribute(string parameterName)
+        {
+            ParameterName = parameterName;
+        }
+
+        public string ParameterName { get; private set; }
+    }
+
+    ///
+    /// Describes dependency between method input and output.
+    ///
+    /// <syntax>
+    ///
Function Definition Table syntax:

+    /// <list>
+    /// <item>FDT      ::= FDTRow [;FDTRow]*</item>
+    /// <item>FDTRow   ::= Input => Output | Output <= Input</item>
+    /// <item>Input    ::= ParameterName: Value [, Input]*</item>
+    /// <item>Output   ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}</item>
+    /// <item>Value    ::= true | false | null | notnull | canbenull</item>
+    /// </list>
+    /// If method has single input parameter, it's name could be omitted.

+    /// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same)
+    /// for method output means that the methos doesn't return normally.

+    /// <c>canbenull</c> annotation is only applicable for output parameters.

+    /// You can use multiple <c>[ContractAnnotation]</c> for each FDT row,
+    /// or use single attribute with rows separated by semicolon.

+    /// </syntax>
+    /// <examples><list>
+    /// <item>
+    /// [ContractAnnotation("=> halt")]
+    /// public void TerminationMethod()
+    /// </item>
+    /// <item>
+    /// [ContractAnnotation("halt <= condition: false")]
+    /// public void Assert(bool condition, string text) // regular assertion method
+    /// </item>
+    /// <item>
+    /// [ContractAnnotation("s:null => true")]
+    /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
+    /// </item>
+    /// <item>
+    /// // A method that returns null if the parameter is null,
+    /// // and not null if the parameter is not null
+    /// [ContractAnnotation("null => null; notnull => notnull")]
+    /// public object Transform(object data)
+    /// </item>
+    /// <item>
+    /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
+    /// public bool TryParse(string s, out Person result)
+    /// </item>
+    /// </list></examples>
+    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
+    internal sealed class ContractAnnotationAttribute : Attribute
+    {
+        public ContractAnnotationAttribute([NotNull] string contract)
+          : this(contract, false)
+        { }
+
+        public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates)
+        {
+            Contract = contract;
+            ForceFullStates = forceFullStates;
+        }
+
+        public string Contract { get; private set; }
+        public bool ForceFullStates { get; private set; }
+    }
+
+    ///
+    /// Indicates that marked element should be localized or not.
+    ///
+    /// <example>
+    /// [LocalizationRequiredAttribute(true)]
+    /// class Foo {
+    ///   string str = "my string"; // Warning: Localizable string
+    /// }
+    /// </example>
+    [AttributeUsage(AttributeTargets.All)]
+    internal sealed class LocalizationRequiredAttribute : Attribute
+    {
+        public LocalizationRequiredAttribute() : this(true) { }
+        public LocalizationRequiredAttribute(bool required)
+        {
+            Required = required;
+        }
+
+        public bool Required { get; private set; }
+    }
+
+    ///
+    /// Indicates that the value of the marked type (or its derivatives)
+    /// cannot be compared using '==' or '!=' operators and <c>Equals()</c>
+    /// should be used instead. However, using '==' or '!=' for comparison
+    /// with <c>null</c> is always permitted.
+    ///
+    /// <example>
+    /// [CannotApplyEqualityOperator]
+    /// class NoEquality { }
+    ///
+    /// class UsesNoEquality {
+    ///   void Test() {
+    ///     var ca1 = new NoEquality();
+    ///     var ca2 = new NoEquality();
+    ///     if (ca1 != null) { // OK
+    ///       bool condition = ca1 == ca2; // Warning
+    ///     }
+    ///   }
+    /// }
+    /// </example>
+    [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct)]
+    internal sealed class CannotApplyEqualityOperatorAttribute : Attribute { }
+
+    ///
+    /// When applied to a target attribute, specifies a requirement for any type marked
+    /// with the target attribute to implement or inherit specific type or types.
+    ///
+    /// <example>
+    /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement
+    /// class ComponentAttribute : Attribute { }
+    ///
+    /// [Component] // ComponentAttribute requires implementing IComponent interface
+    /// class MyComponent : IComponent { }
+    /// </example>
+    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
+    [BaseTypeRequired(typeof(Attribute))]
+    internal sealed class BaseTypeRequiredAttribute : Attribute
+    {
+        public BaseTypeRequiredAttribute([NotNull] Type baseType)
+        {
+            BaseType = baseType;
+        }
+
+        [NotNull]
+        public Type BaseType { get; private set; }
+    }
+
+    ///
+    /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library),
+    /// so this symbol will not be marked as unused (as well as by other usage inspections).
+    ///
+    [AttributeUsage(AttributeTargets.All)]
+    internal sealed class UsedImplicitlyAttribute : Attribute
+    {
+        public UsedImplicitlyAttribute()
+          : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default)
+        { }
+
+        public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)
+          : this(useKindFlags, ImplicitUseTargetFlags.Default)
+        { }
+
+        public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)
+          : this(ImplicitUseKindFlags.Default, targetFlags)
+        { }
+
+        public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
+        {
+            UseKindFlags = useKindFlags;
+            TargetFlags = targetFlags;
+        }
+
+        public ImplicitUseKindFlags UseKindFlags { get; private set; }
+        public ImplicitUseTargetFlags TargetFlags { get; private set; }
+    }
+
+    ///
+    /// Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes
+    /// as unused (as well as by other usage inspections)
+    ///
+    [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter)]
+    internal sealed class MeansImplicitUseAttribute : Attribute
+    {
+        public MeansImplicitUseAttribute()
+          : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default)
+        { }
+
+        public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)
+          : this(useKindFlags, ImplicitUseTargetFlags.Default)
+        { }
+
+        public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)
+          : this(ImplicitUseKindFlags.Default, targetFlags)
+        { }
+
+        public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
+        {
+            UseKindFlags = useKindFlags;
+            TargetFlags = targetFlags;
+        }
+
+        [UsedImplicitly]
+        public ImplicitUseKindFlags UseKindFlags { get; private set; }
+        [UsedImplicitly]
+        public ImplicitUseTargetFlags TargetFlags { get; private set; }
+    }
+
+    [Flags]
+    internal enum ImplicitUseKindFlags
+    {
+        Default = Access | Assign | InstantiatedWithFixedConstructorSignature,
+        /// Only entity marked with attribute considered used.
+        Access = 1,
+        /// Indicates implicit assignment to a member.
+        Assign = 2,
+        ///
+        /// Indicates implicit instantiation of a type with fixed constructor signature.
+        /// That means any unused constructor parameters won't be reported as such.
+        ///
+        InstantiatedWithFixedConstructorSignature = 4,
+        /// Indicates implicit instantiation of a type.
+        InstantiatedNoFixedConstructorSignature = 8,
+    }
+
+    ///
+    /// Specify what is considered used implicitly when marked
+    /// with <see cref="MeansImplicitUseAttribute"/> or <see cref="UsedImplicitlyAttribute"/>.
+    ///
+    [Flags]
+    internal enum ImplicitUseTargetFlags
+    {
+        Default = Itself,
+        Itself = 1,
+        /// Members of entity marked with attribute are considered used.
+        Members = 2,
+        /// Entity marked with attribute and all its members considered used.
+        WithMembers = Itself | Members
+    }
+
+    ///
+    /// This attribute is intended to mark publicly available API
+    /// which should not be removed and so is treated as used.
+    ///
+    [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)]
+    internal sealed class PublicAPIAttribute : Attribute
+    {
+        public PublicAPIAttribute() { }
+        public PublicAPIAttribute([NotNull] string comment)
+        {
+            Comment = comment;
+        }
+
+        public string Comment { get; private set; }
+    }
+
+    ///
+    /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack.
+    /// If the parameter is a delegate, indicates that delegate is executed while the method is executed.
+    /// If the parameter is an enumerable, indicates that it is enumerated while the method is executed.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class InstantHandleAttribute : Attribute { }
+
+    ///
+    /// Indicates that a method does not make any observable state changes.
+    /// The same as <c>System.Diagnostics.Contracts.PureAttribute</c>.
+    ///
+    /// <example>
+    /// [Pure] int Multiply(int x, int y) => x * y;
+    ///
+    /// void M() {
+    ///   Multiply(123, 42); // Waring: Return value of pure method is not used
+    /// }
+    /// </example>
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class PureAttribute : Attribute { }
+
+    ///
+    /// Indicates that the return value of method invocation must be used.
+    ///
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class MustUseReturnValueAttribute : Attribute
+    {
+        public MustUseReturnValueAttribute() { }
+        public MustUseReturnValueAttribute([NotNull] string justification)
+        {
+            Justification = justification;
+        }
+
+        public string Justification { get; private set; }
+    }
+
+    ///
+    /// Indicates the type member or parameter of some type, that should be used instead of all other ways
+    /// to get the value that type. This annotation is useful when you have some "context" value evaluated
+    /// and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one.
+    ///
+    /// <example>
+    /// class Foo {
+    ///   [ProvidesContext] IBarService _barService = ...;
+    ///
+    ///   void ProcessNode(INode node) {
+    ///     DoSomething(node, node.GetGlobalServices().Bar);
+    ///     //              ^ Warning: use value of '_barService' field
+    ///   }
+    /// }
+    /// </example>
+    [AttributeUsage(
+      AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter |
+      AttributeTargets.Method)]
+    internal sealed class ProvidesContextAttribute : Attribute { }
+
+    ///
+    /// Indicates that a parameter is a path to a file or a folder within a web project.
+    /// Path can be relative or absolute, starting from web root (~).
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class PathReferenceAttribute : Attribute
+    {
+        public PathReferenceAttribute() { }
+        public PathReferenceAttribute([PathReference] string basePath)
+        {
+            BasePath = basePath;
+        }
+
+        public string BasePath { get; private set; }
+    }
+
+    ///
+    /// An extension method marked with this attribute is processed by ReSharper code completion
+    /// as a 'Source Template'. When extension method is completed over some expression, it's source code
+    /// is automatically expanded like a template at call site.
+    ///
+    /// <remarks>
+    /// Template method body can contain valid source code and/or special comments starting with '$'.
+    /// Text inside these comments is added as source code when the template is applied. Template parameters
+    /// can be used either as additional method parameters or as identifiers wrapped in two '$' signs.
+    /// Use the <see cref="MacroAttribute"/> attribute to specify macros for parameters.
+    /// </remarks>
+    /// <example>
+    /// In this example, the 'forEach' method is a source template available over all values
+    /// of enumerable types, producing ordinary C# 'foreach' statement and placing caret inside block:
+    ///
+    /// [SourceTemplate]
+    /// public static void forEach<T>(this IEnumerable<T> xs) {
+    ///   foreach (var x in xs) {
+    ///      //$ $END$
+    ///   }
+    /// }
+    ///
+    /// </example>
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class SourceTemplateAttribute : Attribute { }
+
+    ///
+    /// Allows specifying a macro for a parameter of a <see cref="SourceTemplateAttribute">source template</see>.
+    ///
+    /// <remarks>
+    /// You can apply the attribute on the whole method or on any of its additional parameters. The macro expression
+    /// is defined in the <see cref="MacroAttribute.Expression"/> property. When applied on a method, the target
+    /// template parameter is defined in the <see cref="MacroAttribute.Target"/> property. To apply the macro silently
+    /// for the parameter, set the <see cref="MacroAttribute.Editable"/> property value = -1.
+    /// </remarks>
+    /// <example>
+    /// Applying the attribute on a source template method:
+    ///
+    /// [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")]
+    /// public static void forEach<T>(this IEnumerable<T> collection) {
+    ///   foreach (var item in collection) {
+    ///     //$ $END$
+    ///   }
+    /// }
+    ///
+    /// Applying the attribute on a template method parameter:
+    ///
+    /// [SourceTemplate]
+    /// public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) {
+    ///   /*$ var $x$Id = "$newguid$" + x.ToString();
+    ///   x.DoSomething($x$Id); */
+    /// }
+    ///
+    /// </example>
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = true)]
+    internal sealed class MacroAttribute : Attribute
+    {
+        ///
+        /// Allows specifying a macro that will be executed for a <see cref="SourceTemplateAttribute">source template</see>
+        /// parameter when the template is expanded.
+        ///
+        public string Expression { get; set; }
+
+        ///
+        /// Allows specifying which occurrence of the target parameter becomes editable when the template is deployed.
+        ///
+        /// <remarks>
+        /// If the target parameter is used several times in the template, only one occurrence becomes editable;
+        /// other occurrences are changed synchronously. To specify the zero-based index of the editable occurrence,
+        /// use values >= 0. To make the parameter non-editable when the template is expanded, use -1.
+        /// </remarks>>
+        public int Editable { get; set; }
+
+        ///
+        /// Identifies the target parameter of a <see cref="SourceTemplateAttribute">source template</see> if the
+        /// <see cref="MacroAttribute"/> is applied on a template method.
+        ///
+        public string Target { get; set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute
+    {
+        public AspMvcAreaMasterLocationFormatAttribute(string format)
+        {
+            Format = format;
+        }
+
+        public string Format { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute
+    {
+        public AspMvcAreaPartialViewLocationFormatAttribute(string format)
+        {
+            Format = format;
+        }
+
+        public string Format { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class AspMvcAreaViewLocationFormatAttribute : Attribute
+    {
+        public AspMvcAreaViewLocationFormatAttribute(string format)
+        {
+            Format = format;
+        }
+
+        public string Format { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class AspMvcMasterLocationFormatAttribute : Attribute
+    {
+        public AspMvcMasterLocationFormatAttribute(string format)
+        {
+            Format = format;
+        }
+
+        public string Format { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class AspMvcPartialViewLocationFormatAttribute : Attribute
+    {
+        public AspMvcPartialViewLocationFormatAttribute(string format)
+        {
+            Format = format;
+        }
+
+        public string Format { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class AspMvcViewLocationFormatAttribute : Attribute
+    {
+        public AspMvcViewLocationFormatAttribute(string format)
+        {
+            Format = format;
+        }
+
+        public string Format { get; private set; }
+    }
+
+    ///
+    /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
+    /// is an MVC action. If applied to a method, the MVC action name is calculated
+    /// implicitly from the context. Use this attribute for custom wrappers similar to
+    /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
+    internal sealed class AspMvcActionAttribute : Attribute
+    {
+        public AspMvcActionAttribute() { }
+        public AspMvcActionAttribute(string anonymousProperty)
+        {
+            AnonymousProperty = anonymousProperty;
+        }
+
+        public string AnonymousProperty { get; private set; }
+    }
+
+    ///
+    /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area.
+    /// Use this attribute for custom wrappers similar to
+    /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AspMvcAreaAttribute : Attribute
+    {
+        public AspMvcAreaAttribute() { }
+        public AspMvcAreaAttribute(string anonymousProperty)
+        {
+            AnonymousProperty = anonymousProperty;
+        }
+
+        public string AnonymousProperty { get; private set; }
+    }
+
+    ///
+    /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is
+    /// an MVC controller. If applied to a method, the MVC controller name is calculated
+    /// implicitly from the context. Use this attribute for custom wrappers similar to
+    /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
+    internal sealed class AspMvcControllerAttribute : Attribute
+    {
+        public AspMvcControllerAttribute() { }
+        public AspMvcControllerAttribute(string anonymousProperty)
+        {
+            AnonymousProperty = anonymousProperty;
+        }
+
+        public string AnonymousProperty { get; private set; }
+    }
+
+    ///
+    /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute
+    /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AspMvcMasterAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute
+    /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, Object)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AspMvcModelTypeAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC
+    /// partial view. If applied to a method, the MVC partial view name is calculated implicitly
+    /// from the context. Use this attribute for custom wrappers similar to
+    /// <c>System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
+    internal sealed class AspMvcPartialViewAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method.
+    ///
+    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
+    internal sealed class AspMvcSuppressViewErrorAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.
+    /// Use this attribute for custom wrappers similar to
+    /// <c>System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AspMvcDisplayTemplateAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template.
+    /// Use this attribute for custom wrappers similar to
+    /// <c>System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AspMvcEditorTemplateAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template.
+    /// Use this attribute for custom wrappers similar to
+    /// <c>System.ComponentModel.DataAnnotations.UIHintAttribute(System.String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AspMvcTemplateAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
+    /// is an MVC view component. If applied to a method, the MVC view name is calculated implicitly
+    /// from the context. Use this attribute for custom wrappers similar to
+    /// <c>System.Web.Mvc.Controller.View(Object)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
+    internal sealed class AspMvcViewAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
+    /// is an MVC view component name.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AspMvcViewComponentAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
+    /// is an MVC view component view. If applied to a method, the MVC view component view name is default.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
+    internal sealed class AspMvcViewComponentViewAttribute : Attribute { }
+
+    ///
+    /// ASP.NET MVC attribute. When applied to a parameter of an attribute,
+    /// indicates that this parameter is an MVC action name.
+    ///
+    /// <example>
+    /// [ActionName("Foo")]
+    /// public ActionResult Login(string returnUrl) {
+    ///   ViewBag.ReturnUrl = Url.Action("Foo"); // OK
+    ///   return RedirectToAction("Bar"); // Error: Cannot resolve action
+    /// }
+    /// </example>
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
+    internal sealed class AspMvcActionSelectorAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]
+    internal sealed class HtmlElementAttributesAttribute : Attribute
+    {
+        public HtmlElementAttributesAttribute() { }
+        public HtmlElementAttributesAttribute(string name)
+        {
+            Name = name;
+        }
+
+        public string Name { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
+    internal sealed class HtmlAttributeValueAttribute : Attribute
+    {
+        public HtmlAttributeValueAttribute([NotNull] string name)
+        {
+            Name = name;
+        }
+
+        [NotNull]
+        public string Name { get; private set; }
+    }
+
+    ///
+    /// Razor attribute. Indicates that a parameter or a method is a Razor section.
+    /// Use this attribute for custom wrappers similar to
+    /// <c>System.Web.WebPages.WebPageBase.RenderSection(String)</c>.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
+    internal sealed class RazorSectionAttribute : Attribute { }
+
+    ///
+    /// Indicates how method, constructor invocation or property access
+    /// over collection type affects content of the collection.
+    ///
+    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
+    internal sealed class CollectionAccessAttribute : Attribute
+    {
+        public CollectionAccessAttribute(CollectionAccessType collectionAccessType)
+        {
+            CollectionAccessType = collectionAccessType;
+        }
+
+        public CollectionAccessType CollectionAccessType { get; private set; }
+    }
+
+    [Flags]
+    internal enum CollectionAccessType
+    {
+        /// Method does not use or modify content of the collection.
+        None = 0,
+        /// Method only reads content of the collection but does not modify it.
+        Read = 1,
+        /// Method can change content of the collection but does not add new elements.
+        ModifyExistingContent = 2,
+        /// Method can add new elements to the collection.
+        UpdatedContent = ModifyExistingContent | 4
+    }
+
+    ///
+    /// Indicates that the marked method is assertion method, i.e. it halts control flow if
+    /// one of the conditions is satisfied. To set the condition, mark one of the parameters with
+    /// <see cref="AssertionConditionAttribute"/> attribute.
+    ///
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class AssertionMethodAttribute : Attribute { }
+
+    ///
+    /// Indicates the condition parameter of the assertion method. The method itself should be
+    /// marked by <see cref="AssertionMethodAttribute"/> attribute. The mandatory argument of
+    /// the attribute is the assertion type.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class AssertionConditionAttribute : Attribute
+    {
+        public AssertionConditionAttribute(AssertionConditionType conditionType)
+        {
+            ConditionType = conditionType;
+        }
+
+        public AssertionConditionType ConditionType { get; private set; }
+    }
+
+    ///
+    /// Specifies assertion type. If the assertion method argument satisfies the condition,
+    /// then the execution continues. Otherwise, execution is assumed to be halted.
+    ///
+    internal enum AssertionConditionType
+    {
+        /// Marked parameter should be evaluated to true.
+        IS_TRUE = 0,
+        /// Marked parameter should be evaluated to false.
+        IS_FALSE = 1,
+        /// Marked parameter should be evaluated to null value.
+        IS_NULL = 2,
+        /// Marked parameter should be evaluated to not null value.
+        IS_NOT_NULL = 3,
+    }
+
+    ///
+    /// Indicates that the marked method unconditionally terminates control flow execution.
+    /// For example, it could unconditionally throw exception.
+    ///
+    [Obsolete("Use [ContractAnnotation('=> halt')] instead")]
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class TerminatesProgramAttribute : Attribute { }
+
+    ///
+    /// Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select,
+    /// .Where). This annotation allows inference of [InstantHandle] annotation for parameters
+    /// of delegate type by analyzing LINQ method chains.
+    ///
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class LinqTunnelAttribute : Attribute { }
+
+    ///
+    /// Indicates that IEnumerable, passed as parameter, is not enumerated.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class NoEnumerationAttribute : Attribute { }
+
+    ///
+    /// Indicates that parameter is regular expression pattern.
+    ///
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class RegexPatternAttribute : Attribute { }
+
+    ///
+    /// XAML attribute. Indicates the type that has <c>ItemsSource</c> property and should be treated
+    /// as <c>ItemsControl</c>-derived type, to enable inner items <c>DataContext</c> type resolve.
+    ///
+    [AttributeUsage(AttributeTargets.Class)]
+    internal sealed class XamlItemsControlAttribute : Attribute { }
+
+    ///
+    /// XAML attribute. Indicates the property of some <c>BindingBase</c>-derived type, that
+    /// is used to bind some item of <c>ItemsControl</c>-derived type. This annotation will
+    /// enable the <c>DataContext</c> type resolve for XAML bindings for such properties.
+    ///
+    /// <remarks>
+    /// Property should have the tree ancestor of the <c>ItemsControl</c> type or
+    /// marked with the <see cref="XamlItemsControlAttribute"/> attribute.
+    /// </remarks>
+    [AttributeUsage(AttributeTargets.Property)]
+    internal sealed class XamlItemBindingOfItemsControlAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
+    internal sealed class AspChildControlTypeAttribute : Attribute
+    {
+        public AspChildControlTypeAttribute(string tagName, Type controlType)
+        {
+            TagName = tagName;
+            ControlType = controlType;
+        }
+
+        public string TagName { get; private set; }
+        public Type ControlType { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
+    internal sealed class AspDataFieldAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]
+    internal sealed class AspDataFieldsAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Property)]
+    internal sealed class AspMethodPropertyAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
+    internal sealed class AspRequiredAttributeAttribute : Attribute
+    {
+        public AspRequiredAttributeAttribute([NotNull] string attribute)
+        {
+            Attribute = attribute;
+        }
+
+        public string Attribute { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Property)]
+    internal sealed class AspTypePropertyAttribute : Attribute
+    {
+        public bool CreateConstructorReferences { get; private set; }
+
+        public AspTypePropertyAttribute(bool createConstructorReferences)
+        {
+            CreateConstructorReferences = createConstructorReferences;
+        }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class RazorImportNamespaceAttribute : Attribute
+    {
+        public RazorImportNamespaceAttribute(string name)
+        {
+            Name = name;
+        }
+
+        public string Name { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+    internal sealed class RazorInjectionAttribute : Attribute
+    {
+        public RazorInjectionAttribute(string type, string fieldName)
+        {
+            Type = type;
+            FieldName = fieldName;
+        }
+
+        public string Type { get; private set; }
+        public string FieldName { get; private set; }
+    }
+
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class RazorHelperCommonAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Property)]
+    internal sealed class RazorLayoutAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class RazorWriteLiteralMethodAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Method)]
+    internal sealed class RazorWriteMethodAttribute : Attribute { }
+
+    [AttributeUsage(AttributeTargets.Parameter)]
+    internal sealed class RazorWriteMethodParameterAttribute : Attribute { }
+
+    ///
+    /// Prevents the Member Reordering feature from tossing members of the marked class.
+    ///
+    /// <remarks>
+    /// The attribute must be mentioned in your member reordering patterns
+    /// </remarks>
+    [AttributeUsage(AttributeTargets.All)]
+    internal sealed class NoReorder : Attribute { }
 }


Fixes merge issue

Fixes merge issue

--- src/Umbraco.Web/Mvc/UmbracoViewPage.cs
+++ src/Umbraco.Web/Mvc/UmbracoViewPage.cs
@@ -1,5 +1,5 @@
 using System;
-using Sytem.Text;
+using System.Text;
 using System.Web.Mvc;
 using Umbraco.Core;
 using Umbraco.Core.Configuration;


Use Vector instead of direct intrinsics (#41790)

--- src/Shared/QueryStringEnumerable.cs
+++ src/Shared/QueryStringEnumerable.cs
@@ -184,17 +184,32 @@
                 var i = (nint)0;
                 var n = (nint)(uint)buffer.Length;

-                if (Sse41.IsSupported && n >= Vector128<ushort>.Count)
+                if (Vector256.IsHardwareAccelerated && n >= Vector256<ushort>.Count)
+                {
+                    var vecPlus = Vector256.Create((ushort)'+');
+                    var vecSpace = Vector256.Create((ushort)' ');
+
+                    do
+                    {
+                        var vec = Vector256.Load(input + i);
+                        var mask = Vector256.Equals(vec, vecPlus);
+                        var res = Vector256.ConditionalSelect(mask, vecSpace, vec);
+                        res.Store(output + i);
+                        i += Vector256<ushort>.Count;
+                    } while (i <= n - Vector256<ushort>.Count);
+                }
+
+                if (Vector128.IsHardwareAccelerated && n - i >= Vector128<ushort>.Count)
                 {
                     var vecPlus = Vector128.Create((ushort)'+');
                     var vecSpace = Vector128.Create((ushort)' ');

                     do
                     {
-                        var vec = Sse2.LoadVector128(input + i);
-                        var mask = Sse2.CompareEqual(vec, vecPlus);
-                        var res = Sse41.BlendVariable(vec, vecSpace, mask);
-                        Sse2.Store(output + i, res);
+                        var vec = Vector128.Load(input + i);
+                        var mask = Vector128.Equals(vec, vecPlus);
+                        var res = Vector128.ConditionalSelect(mask, vecSpace, vec);
+                        res.Store(output + i);
                         i += Vector128<ushort>.Count;
                     } while (i <= n - Vector128<ushort>.Count);
                 }


Ensure no clipping of marks

Ensure no clipping of marks

--- src/SixLabors.Fonts/TextMeasurer.cs
+++ src/SixLabors.Fonts/TextMeasurer.cs
@@ -71,7 +71,9 @@

             float top = glyphLayouts.Min(x => x.Location.Y);
             float left = glyphLayouts.Min(x => x.Location.X);
-            float right = glyphLayouts.Max(x => x.Location.X + x.Width);
+
+            // Avoid trimming zero-width marks that extend past the bounds of their base.
+            float right = glyphLayouts.Max(x => Math.Max(x.Location.X + x.Width, x.BoundingBox(Vector2.One).Right));
             float bottom = glyphLayouts.Max(x => x.Location.Y + x.LineHeight);

             Vector2 topLeft = new Vector2(left, top) * dpi;


Fixed #89 default unknown writing system to 'zxx', was 'unknown'

--- src/SolidEngine/ProcessStructure.cs
+++ src/SolidEngine/ProcessStructure.cs
@@ -121,7 +121,7 @@
                     XmlAttribute writingSystemAttribute = destination.CreateAttribute("writingsystem");
                     if (setting.WritingSystem == "")
                     {
-                        writingSystemAttribute.Value = "unknown";
+                        writingSystemAttribute.Value = "zxx";
                     }
                     else
                     {


TSS-57 Add the override version to the cache, so it gets logged only once

--- src/Aquarius.Client/AquariusSystemDetector.cs
+++ src/Aquarius.Client/AquariusSystemDetector.cs
@@ -105,6 +105,9 @@
             if (_overrideVersions.TryGetValue(hostname, out aquariusServerVersion))
             {
                 Log.WarnFormat("Version probe bypassed for hostname={0}. Using fakeVersion={1}", hostname, aquariusServerVersion);
+
+                _knownServerVersions.GetOrAdd(hostname, aquariusServerVersion);
+
                 return aquariusServerVersion;
             }


Fixed region name

Fixed region name

--- src/SwissArmyKnife/IntExtensions.cs
+++ src/SwissArmyKnife/IntExtensions.cs
@@ -7,6 +7,8 @@
     /// </summary>
     public static class IntExtensions
     {
+        #region TimeSpan
+
         /// <summary>
         /// Gets a <see cref="TimeSpan"/> for the specified number of milliseconds
         /// </summary>
@@ -67,5 +69,6 @@
         public static TimeSpan Days(this int value) =>
           TimeSpan.FromDays(value);

+        #endregion
     }
 }


Don't return value unnecessarily.

Don't return value unnecessarily.

--- src/Compilers/CSharp/Portable/Parser/Lexer.cs
+++ src/Compilers/CSharp/Portable/Parser/Lexer.cs
@@ -3126,7 +3126,7 @@

                 case '\r':
                 case '\n':
-                    info = ScanXmlTextLiteralNewLineToken(ref info);
+                    ScanXmlTextLiteralNewLineToken(ref info);
                     break;

                 case SlidingTextWindow.InvalidCharacter:
@@ -3153,13 +3153,12 @@
             return info.Kind != SyntaxKind.None;
         }

-        private TokenInfo ScanXmlTextLiteralNewLineToken(ref TokenInfo info)
+        private void ScanXmlTextLiteralNewLineToken(ref TokenInfo info)
         {
             this.ScanEndOfLine();
             info.StringValue = info.Text = TextWindow.GetText(intern: false);
             info.Kind = SyntaxKind.XmlTextLiteralNewLineToken;
             this.MutateLocation(XmlDocCommentLocation.Exterior);
-            return info;
         }

         private void ScanXmlTagStart(ref TokenInfo info)


adjusted nnmf training time

adjusted nnmf training time

--- SampleCode/TextClustering.cs
+++ SampleCode/TextClustering.cs
@@ -117,7 +117,7 @@
                 _WriteClusters(outputPath + "kmeans.txt", vectorList.KMeans(allGroups.Count), lookupTable);

                 Console.WriteLine("NNMF clustering...");
-                _WriteClusters(outputPath + "nnmf.txt", vectorList.NNMF(lap, allGroups.Count, 200), lookupTable);
+                _WriteClusters(outputPath + "nnmf.txt", vectorList.NNMF(lap, allGroups.Count, 100), lookupTable);

                 var matrix = lap.CreateMatrix(vectorList.Select(v => v.Data).ToList());
                 vectorList.ForEach(v => v.Dispose());


comment update

comment update

--- src/Core/Utilities/EncryptedValueAttribute.cs
+++ src/Core/Utilities/EncryptedValueAttribute.cs
@@ -4,7 +4,7 @@
 namespace Bit.Core.Utilities
 {
     /// <summary>
-    /// Validates a string that is in encrypted form: "b64iv=|b64ct="
+    /// Validates a string that is in encrypted form: "head.b64iv=|b64ct=|b64mac="
     /// </summary>
     public class EncryptedStringAttribute : ValidationAttribute
     {


[Exclude] additional SQLite tests.

[Exclude] additional SQLite tests.

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@1098 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Test/Providers/ReadTest_Complex.cs
+++ src/DbLinq/Test/Providers/ReadTest_Complex.cs
@@ -397,6 +397,9 @@
         }

+#if SQLITE
+        [Explicit]
+#endif
         [Test]
         public void F19_ExceptWithCount_ViaToList()
         {


Suppress GC garbage

Suppress GC garbage

--- src/DeclarativeSql/Helpers/PredicateParser.cs
+++ src/DeclarativeSql/Helpers/PredicateParser.cs
@@ -63,7 +63,7 @@
                 case ExpressionType.OrElse:
                     {
                         var element = new PredicateElement(node.NodeType.ToPredicateOperator());
-                        return this.VisitCore(element, () => base.VisitBinary(node));
+                        return this.VisitCore(element, base.VisitBinary, node);
                     }

                 case ExpressionType.LessThan:
@@ -74,7 +74,7 @@
                 case ExpressionType.NotEqual:
                     {
                         var element = this.ParseBinary(node);
-                        return this.VisitCore(element, () => base.VisitBinary(node));
+                        return this.VisitCore(element, base.VisitBinary, node);
                     }
             }
             return base.VisitBinary(node);
@@ -97,7 +97,7 @@
                 if (parent == null)
                 {
                     var element = new PredicateElement(PredicateOperator.Equal, info.PropertyType, info.Name, true);
-                    return this.VisitCore(element, () => base.VisitMember(node));
+                    return this.VisitCore(element, base.VisitMember, node);
                 }

                 switch (parent.Operator)
@@ -107,7 +107,7 @@
                     case PredicateOperator.OrElse:
                         {
                             var element = new PredicateElement(PredicateOperator.Equal, info.PropertyType, info.Name, true);
-                            return this.VisitCore(element, () => base.VisitMember(node));
+                            return this.VisitCore(element, base.VisitMember, node);
                         }

                     //--- == / != / !x.CanPlay の場合
@@ -162,7 +162,7 @@
                     }
                     root = new PredicateElement(PredicateOperator.Contains, this.Parameter.Type, propertyName, x);
                 }
-                return this.VisitCore(root, () => base.VisitMethodCall(node));
+                return this.VisitCore(root, base.VisitMethodCall, node);
             }

             //--- default
@@ -182,7 +182,7 @@
             if (this.IsBooleanProperty(node.Operand as MemberExpression))
             {
                 var element = new PredicateElement(PredicateOperator.NotEqual);
-                return this.VisitCore(element, () => base.VisitUnary(node));
+                return this.VisitCore(element, base.VisitUnary, node);
             }
            return base.VisitUnary(node);
         }
@@ -196,7 +196,7 @@
         /// <param name="element">要素生成</param>
         /// <param name="baseCall">基底メソッド呼び出しデリゲート</param>
         /// <returns>式またはいずれかの部分式が変更された場合は変更された式。それ以外の場合は元の式。</returns>
-        private Expression VisitCore(PredicateElement element, Func<Expression> baseCall)
+        private Expression VisitCore<TState>(PredicateElement element, Func<TState, Expression> baseCall, TState state)
         {
             //--- 親要素と関連付け
             var parent = this.Cache.Count == 0 ? null : this.Cache.Peek();
@@ -209,7 +209,7 @@

             //--- 子要素を解析
             this.Cache.Push(element);
-            var result = baseCall();
+            var result = baseCall(state);
             this.Cache.Pop();

             //--- キャッシュがなくなった場合 (= Root)


fix: Add .map ext to SetupMiddleware #286

--- src/Fan.Web/Infrastructure/SetupMiddleware.cs
+++ src/Fan.Web/Infrastructure/SetupMiddleware.cs
@@ -33,8 +33,8 @@
                 var setupUrl = $"{context.Request.Scheme}://{context.Request.Host}/setup";
                 var currentUrl = $"{context.Request.Scheme}://{context.Request.Host}{context.Request.Path}";

-                // skip setup page itself and ico, js, css files
-                string[] exts = { ".ico", ".js", ".css" };
+                // don't redirect to setup if url is setup itself or certain types of files
+                string[] exts = { ".ico", ".js", ".css", ".map" };
                 if (!currentUrl.Equals(setupUrl, StringComparison.OrdinalIgnoreCase) &&
                     !exts.Any(ext=> currentUrl.EndsWith(ext, StringComparison.OrdinalIgnoreCase)))
                 {


Add language declaration to layout

Add language declaration to layout

--- src/FavRocks.Site/Views/Shared/_Layout.cshtml
+++ src/FavRocks.Site/Views/Shared/_Layout.cshtml
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html>
+<html lang="en-us">
 <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />


add url validation to SnapshotService

add url validation to SnapshotService

--- src/FilterLists.Services/Snapshot/Snapshot.cs
+++ src/FilterLists.Services/Snapshot/Snapshot.cs
@@ -42,6 +42,8 @@
         public async Task TrySaveAsync()
         {
             await AddSnapEntity();
+            if (!IsViewUrlValid())
+                return;
             try
             {
                 await SaveAsync();
@@ -57,6 +59,10 @@
             dbContext.Snapshots.Add(snapEntity);
             await dbContext.SaveChangesAsync();
         }
+
+        private bool IsViewUrlValid() =>
+            Uri.TryCreate(list.ViewUrl, UriKind.Absolute, out var uriResult) &&
+            (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);

         private async Task SaveAsync()
         {


fixes stylecop error.

fixes stylecop error.

--- src/FlubuCore/Scripting/DefaultBuildScript.cs
+++ src/FlubuCore/Scripting/DefaultBuildScript.cs
@@ -341,7 +341,6 @@
                      flubuSession.LogError($"error: {(flubuSession.Args.Debug ? e.ToString() : e.Message)}");
 #endif
                 }
-
             }
             while (flubuSession.InteractiveMode);
         }


Repair lost action for sync button

Repair lost action for sync button

--- src/HearThis/UI/AndroidSyncDialog.Designer.cs
+++ src/HearThis/UI/AndroidSyncDialog.Designer.cs
@@ -142,6 +142,7 @@
 			this._syncButton.Size = new System.Drawing.Size(75, 23);
 			this._syncButton.TabIndex = 0;
 			this._syncButton.Text = "Synchronize";
+			this._syncButton.Click += new System.EventHandler(this._syncButton_Click);
 			//
 			// okButton
 			//


Changed the only reference to Support's PQ. Changed the corresponding method calls.

--- src/Lucene.Net.Core/Search/TopTermsRewrite.cs
+++ src/Lucene.Net.Core/Search/TopTermsRewrite.cs
@@ -5,7 +5,7 @@

 namespace Lucene.Net.Search
 {
-    using Lucene.Net.Support;
+    using Lucene.Net.Util;
     using ArrayUtil = Lucene.Net.Util.ArrayUtil;
     using BytesRef = Lucene.Net.Util.BytesRef;

@@ -71,7 +71,7 @@
         public override Query Rewrite(IndexReader reader, MultiTermQuery query)
         {
             int maxSize = Math.Min(size, MaxSize);
-            PriorityQueue<ScoreTerm> stQueue = new PriorityQueue<ScoreTerm>();
+            PriorityQueue<ScoreTerm> stQueue = new ScoreTermPQ();
             CollectTerms(reader, query, new TermCollectorAnonymousInnerClassHelper(this, maxSize, stQueue));

             var q = TopLevelQuery;
@@ -161,9 +161,9 @@

                 //System.out.println("TTR.collect term=" + bytes.utf8ToString() + " boost=" + boost + " ord=" + readerContext.ord);
                 // ignore uncompetitive hits
-                if (StQueue.Count == MaxSize)
-                {
-                    ScoreTerm t = StQueue.Peek();
+                if (StQueue.Size() == MaxSize)
+                {
+                    ScoreTerm t = StQueue.Top();
                     if (boost < t.Boost)
                     {
                         return true;
@@ -190,11 +190,11 @@
                     visitedTerms[st.Bytes] = st;
                     Debug.Assert(st.TermState.DocFreq == 0);
                     st.TermState.Register(state, ReaderContext.Ord, termsEnum.DocFreq(), termsEnum.TotalTermFreq());
-                    StQueue.Offer(st);
+                    StQueue.Add(st);
                     // possibly drop entries from queue
-                    if (StQueue.Count > MaxSize)
-                    {
-                        st = StQueue.Poll();
+                    if (StQueue.Size() > MaxSize)
+                    {
+                        st = StQueue.Pop();
                         visitedTerms.Remove(st.Bytes);
                         st.TermState.Clear(); // reset the termstate!
                     }
@@ -202,11 +202,11 @@
                     {
                         st = new ScoreTerm(termComp, new TermContext(TopReaderContext));
                     }
-                    Debug.Assert(StQueue.Count <= MaxSize, "the PQ size must be limited to maxSize");
+                    Debug.Assert(StQueue.Size() <= MaxSize, "the PQ size must be limited to maxSize");
                     // set maxBoostAtt with values to help FuzzyTermsEnum to optimize
-                    if (StQueue.Count == MaxSize)
-                    {
-                        t2 = StQueue.Peek();
+                    if (StQueue.Size() == MaxSize)
+                    {
+                        t2 = StQueue.Top();
                         maxBoostAtt.MaxNonCompetitiveBoost = t2.Boost;
                         maxBoostAtt.CompetitiveTerm = t2.Bytes;
                     }
@@ -283,5 +283,14 @@
                 }
             }
         }
+
+        private class ScoreTermPQ : PriorityQueue<ScoreTerm>
+        {
+            public override bool LessThan(ScoreTerm a, ScoreTerm b)
+            {
+                return (a.CompareTo(b) < 0) ? true : false;
+            }
+        }
+
     }
 }