lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject [5/9] adding resharper & ghostdoc settings. refactoring code for consistency.
Date Wed, 20 Aug 2014 02:32:09 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/BytesRef.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/BytesRef.cs b/src/Lucene.Net.Core/Util/BytesRef.cs
index 1b2b008..4e56c8b 100644
--- a/src/Lucene.Net.Core/Util/BytesRef.cs
+++ b/src/Lucene.Net.Core/Util/BytesRef.cs
@@ -17,57 +17,56 @@
 
 namespace Lucene.Net.Util
 {
-    using Lucene.Net.Support;
     using System;
     using System.Collections.Generic;
     using System.Diagnostics;
     using System.Text;
 
     /// <summary>
-    /// <see cref="BytesRef"/> represents a byte array as a slice of an existing byte array.  
+    ///     <see cref="BytesRef" /> represents a byte array as a slice of an existing byte array.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         The <seealso cref="#Bytes"/> property should never be null;
-    ///         Use <seealso cref="#EMPTY_BYTES"/> if necessary.
+    ///         The <seealso cref="Bytes" /> property should never be null;
+    ///         Use <seealso cref="EMPTY_BYTES" /> if necessary.
     ///     </para>
     ///     <para>
-    ///         Important note:</b> Unless otherwise noted, Lucene uses this class to
+    ///         <strong>Important note</strong>: Unless otherwise noted, Lucene uses this class to
     ///         represent terms that are encoded as <b>UTF8</b> bytes in the index. To
-    ///         convert them to a Java <seealso cref="String"/> (which is UTF16), use <seealso cref="#Utf8ToString"/>.
-    ///     
+    ///         convert them to a Java <seealso cref="string" /> (which is UTF16), use <seealso cref="Utf8ToString" />.
     ///         Using code like <c>new String(bytes, offset, length)</c> to do this
     ///         is <b>wrong</b>. It does not respect the correct character set
     ///         and may return wrong results (depending on the platform's defaults)!
     ///     </para>
     /// </remarks>
-    public sealed class BytesRef : 
-        System.IComparable, 
-        Lucene.Net.Support.ICloneable,
+    // ReSharper disable CSharpWarnings::CS1574
+    public sealed class BytesRef :
+        IComparable,
+        Support.ICloneable,
         IEnumerable<Byte>
     {
         /// <summary>
-        /// An empty byte array for convenience 
+        ///     An empty byte array for convenience
         /// </summary>
         public static readonly byte[] EMPTY_BYTES = new byte[0];
 
         /// <summary>
-        /// The contents of <see cref="BytesRef"/> 
+        ///     The contents of <see cref="BytesRef" />
         /// </summary>
         public byte[] Bytes { get; internal set; }
 
         /// <summary>
-        /// Offset of first valid byte.
+        ///     Offset of first valid byte.
         /// </summary>
         public int Offset { get; internal set; }
 
         /// <summary>
-        /// Length of used bytes. 
+        ///     Length of used bytes.
         /// </summary>
         public int Length { get; internal set; }
 
         /// <summary>
-        /// Create a BytesRef with <seealso cref="#EMPTY_BYTES"/> 
+        ///     Create a BytesRef with <seealso cref="EMPTY_BYTES" />
         /// </summary>
         public BytesRef()
             : this(EMPTY_BYTES)
@@ -75,9 +74,9 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Initializes a new instance of <see cref="BytesRef"/> that
-        /// references the <paramref name="bytes"/> instead of making
-        /// a copy.
+        ///     Initializes a new instance of <see cref="BytesRef" /> that
+        ///     references the <paramref name="bytes" /> instead of making
+        ///     a copy.
         /// </summary>
         /// <param name="bytes">The array of bytes to be references.</param>
         /// <param name="offset">The starting position of the first valid byte.</param>
@@ -92,9 +91,9 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Initializes a new instance of <see cref="BytesRef"/> that
-        /// references the <paramref name="bytes"/> instead of making
-        /// a copy. 
+        ///     Initializes a new instance of <see cref="BytesRef" /> that
+        ///     references the <paramref name="bytes" /> instead of making
+        ///     a copy.
         /// </summary>
         /// <param name="bytes">The array of bytes to be references.</param>
         public BytesRef(byte[] bytes)
@@ -103,8 +102,8 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        ///  Initializes a new instance of <see cref="BytesRef"/> that creates an empty array
-        ///  with the specified <paramref name="capacity"/>.
+        ///     Initializes a new instance of <see cref="BytesRef" /> that creates an empty array
+        ///     with the specified <paramref name="capacity" />.
         /// </summary>
         public BytesRef(int capacity)
         {
@@ -112,11 +111,13 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        ///  Initializes a new instance of <see cref="BytesRef"/> from the UTF8 bytes
-        ///  from the given <see cref="CharsRef"/>.
+        ///     Initializes a new instance of <see cref="BytesRef" /> from the UTF8 bytes
+        ///     from the given <see cref="CharsRef" />.
         /// </summary>
-        /// <param name="text"> this must be well-formed
-        /// unicode text, with no unpaired surrogates. </param>
+        /// <param name="text">
+        ///     this must be well-formed
+        ///     unicode text, with no unpaired surrogates.
+        /// </param>
         public BytesRef(CharsRef text)
             : this()
         {
@@ -124,11 +125,13 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        ///  Initializes a new instance of <see cref="BytesRef"/> from the UTF8 bytes
-        ///  from the given <see cref="System.String"/>.
+        ///     Initializes a new instance of <see cref="BytesRef" /> from the UTF8 bytes
+        ///     from the given <see cref="string" />.
         /// </summary>
-        /// <param name="text"> this must be well-formed
-        /// unicode text, with no unpaired surrogates. </param>
+        /// <param name="text">
+        ///     this must be well-formed
+        ///     unicode text, with no unpaired surrogates.
+        /// </param>
         public BytesRef(string text)
             : this()
         {
@@ -136,62 +139,65 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Copies the UTF8 bytes for this string.
+        ///     Copies the UTF8 bytes for this string.
         /// </summary>
-        /// <param name="text"> Must be well-formed unicode text, with no
-        /// unpaired surrogates or invalid UTF16 code units. </param>
+        /// <param name="text">
+        ///     Must be well-formed unicode text, with no
+        ///     unpaired surrogates or invalid UTF16 code units.
+        /// </param>
         public void CopyChars(CharsRef text)
         {
-            Debug.Assert(this.Offset == 0); // TODO broken if offset != 0
-            UnicodeUtil.UTF16toUTF8(text, 0, text.Length, this);
+            Debug.Assert(this.Offset == 0);
+            UnicodeUtil.Utf16ToUtf8(text, 0, text.Length, this);
         }
 
         /// <summary>
-        /// Copies the UTF8 bytes for this string.
+        ///     Copies the UTF8 bytes for this string.
         /// </summary>
-        /// <param name="text"> Must be well-formed unicode text, with no
-        /// unpaired surrogates or invalid UTF16 code units. </param>
+        /// <param name="text">
+        ///     Must be well-formed unicode text, with no
+        ///     unpaired surrogates or invalid UTF16 code units.
+        /// </param>
         public void CopyChars(string text)
         {
-            Debug.Assert(this.Offset == 0); // TODO broken if offset != 0
-            UnicodeUtil.UTF16toUTF8(text.ToCharArray(0, text.Length), 0, text.Length, this);
+            Debug.Assert(this.Offset == 0);
+            UnicodeUtil.Utf16ToUtf8(text.ToCharArray(0, text.Length), 0, text.Length, this);
         }
 
         /// <summary>
-        /// Compares the bytes against another BytesRef,
-        /// returning true if the bytes are equal.
+        ///     Compares the bytes against another BytesRef,
+        ///     returning true if the bytes are equal.
         /// </summary>
-        /// <param name="other"> Another BytesRef, should not be null.
-        /// @lucene.internal </param>
+        /// <param name="other">
+        ///     Another BytesRef, should not be null.
+        ///     @lucene.internal
+        /// </param>
         public bool BytesEquals(BytesRef other)
         {
             Debug.Assert(other != null);
             if (Length == other.Length)
             {
-                int otherUpto = other.Offset;
-                byte[] otherBytes = other.Bytes;
-                int end = this.Offset + this.Length;
-                for (int upto = Offset; upto < end; upto++, otherUpto++)
+                var otherOffset = other.Offset;
+                var otherBytes = other.Bytes;
+                var end = this.Offset + this.Length;
+                for (var offset = Offset; offset < end; offset++, otherOffset++)
                 {
-                    if (this.Bytes[upto] != otherBytes[otherUpto])
+                    if (this.Bytes[offset] != otherBytes[otherOffset])
                     {
                         return false;
                     }
                 }
                 return true;
             }
-            else
-            {
-                return false;
-            }
+            return false;
         }
 
         /// <summary>
-        /// Returns a shallow clone of this instance (the underlying bytes are
-        /// <b>not</b> copied and will be shared by both the returned object and this
-        /// object.
+        ///     Returns a shallow clone of this instance (the underlying bytes are
+        ///     <b>not</b> copied and will be shared by both the returned object and this
+        ///     object.
         /// </summary>
-        /// <param name="deepClone">Instructs <see cref="Clone"/> to perform a deep clone when true.</param>
+        /// <param name="deepClone">Instructs <see cref="Clone" /> to perform a deep clone when true.</param>
         /// <returns>A clone copy of this instance.</returns>
         public object Clone(bool deepClone = false)
         {
@@ -206,18 +212,19 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Calculates the hash code as required by TermsHash during indexing.
+        ///     Calculates the hash code as required by TermsHash during indexing.
         /// </summary>
         /// <remarks>
         ///     <para>
-        ///         This is currently implemented as MurmurHash3 (32bit), 
-        ///         using the seed from <see cref="StringHelper.GOOD_FAST_HASH_SEED"/>, but is subject to
+        ///         This is currently implemented as MurmurHash3 (32bit),
+        ///         using the seed from <see cref="StringHelper.GOOD_FAST_HASH_SEED" />, but is subject to
         ///         change from release to release.
         ///     </para>
         /// </remarks>
         public override int GetHashCode()
         {
-            return StringHelper.MurmurHash3_x86_32(this.Bytes, this.Offset, this.Length, StringHelper.GOOD_FAST_HASH_SEED);
+            return StringHelper.MurmurHash3_x86_32(this.Bytes, this.Offset, this.Length,
+                StringHelper.GOOD_FAST_HASH_SEED);
         }
 
         public override bool Equals(object other)
@@ -228,31 +235,31 @@ namespace Lucene.Net.Util
             }
             if (other is BytesRef)
             {
-                return this.BytesEquals((BytesRef)other);
+                return this.BytesEquals((BytesRef) other);
             }
             return false;
         }
 
         /// <summary>
-        /// Interprets stored bytes as UTF8 bytes.
+        ///     Interprets stored bytes as UTF8 bytes.
         /// </summary>
         /// <returns>A utf16 string.</returns>
         public string Utf8ToString()
         {
-            CharsRef @ref = new CharsRef(Length);
-            UnicodeUtil.UTF8toUTF16(this.Bytes, this.Offset, this.Length, @ref);
+            var @ref = new CharsRef(Length);
+            UnicodeUtil.Utf8ToUtf16(this.Bytes, this.Offset, this.Length, @ref);
             return @ref.ToString();
         }
 
         /// <summary>
-        /// Returns hex encoded bytes, eg [0x6c 0x75 0x63 0x65 0x6e 0x65] 
+        ///     Returns hex encoded bytes, eg [0x6c 0x75 0x63 0x65 0x6e 0x65]
         /// </summary>
         public override string ToString()
         {
-            StringBuilder sb = new StringBuilder();
+            var sb = new StringBuilder();
             sb.Append('[');
-            int end = this.Offset + Length;
-            for (int i = this.Offset; i < end; i++)
+            var end = this.Offset + Length;
+            for (var i = this.Offset; i < end; i++)
             {
                 if (i > this.Offset)
                 {
@@ -265,9 +272,9 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Copies the bytes from the given <seealso cref="BytesRef"/>
+        ///     Copies the bytes from the given <seealso cref="BytesRef" />
         /// </summary>
-        /// <param name="other">The <see cref="BytesRef"/> to copy into this instance.</param>
+        /// <param name="other">The <see cref="BytesRef" /> to copy into this instance.</param>
         /// <remarks>
         ///     <para>
         ///         NOTE: if this would exceed the array size, this method creates a
@@ -286,7 +293,7 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Appends the bytes from the given <seealso cref="BytesRef"/>
+        ///     Appends the bytes from the given <seealso cref="BytesRef" />
         /// </summary>
         /// <remarks>
         ///     <para>
@@ -296,10 +303,10 @@ namespace Lucene.Net.Util
         /// </remarks>
         public void Append(BytesRef other)
         {
-            int newLen = Length + other.Length;
+            var newLen = Length + other.Length;
             if (this.Bytes.Length - this.Offset < newLen)
             {
-                byte[] newBytes = new byte[newLen];
+                var newBytes = new byte[newLen];
                 Array.Copy(this.Bytes, this.Offset, newBytes, 0, Length);
                 Offset = 0;
                 Bytes = newBytes;
@@ -309,7 +316,7 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Used to grow the reference array.
+        ///     Used to grow the reference array.
         /// </summary>
         internal void Grow(int newLength)
         {
@@ -318,49 +325,43 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Unsigned byte order comparison.
+        ///     Unsigned byte order comparison.
         /// </summary>
         public int CompareTo(object other)
         {
-            BytesRef br = other as BytesRef;
+            var br = other as BytesRef;
             Debug.Assert(br != null);
-            return Utf8SortedAsUnicodeSortOrder.Compare(this, br);
+            return UTF8_SORTED_AS_UNICODE_SORT_ORDER.Compare(this, br);
         }
 
-        private static readonly IComparer<BytesRef> Utf8SortedAsUnicodeSortOrder = new UTF8SortedAsUnicodeComparator();
+        private static readonly IComparer<BytesRef> UTF8_SORTED_AS_UNICODE_SORT_ORDER = new Utf8SortedAsUnicodeComparator();
 
         /// <summary>
-        /// Gets a a comparer for <see cref="BytesRef"/> to sort Utf8 as Unicode.
+        ///     Gets a a comparer for <see cref="BytesRef" /> to sort Utf8 as Unicode.
         /// </summary>
-        public static IComparer<BytesRef> UTF8SortedAsUnicodeComparer
+        public static IComparer<BytesRef> Utf8SortedAsUnicodeComparer
         {
-            get
-            {
-                return Utf8SortedAsUnicodeSortOrder;
-            }
+            get { return UTF8_SORTED_AS_UNICODE_SORT_ORDER; }
         }
 
-        private class UTF8SortedAsUnicodeComparator : IComparer<BytesRef>
+        private class Utf8SortedAsUnicodeComparator : IComparer<BytesRef>
         {
             // Only singleton
-            internal UTF8SortedAsUnicodeComparator()
-            {
-            }
 
-            public virtual int Compare(BytesRef a, BytesRef b)
+            public int Compare(BytesRef a, BytesRef b)
             {
-                byte[] aBytes = a.Bytes;
-                int aUpto = a.Offset;
-                byte[] bBytes = b.Bytes;
-                int bUpto = b.Offset;
+                var aBytes = a.Bytes;
+                var aOffset = a.Offset;
+                var bBytes = b.Bytes;
+                var bOffset = b.Offset;
 
-                int aStop = aUpto + Math.Min(a.Length, b.Length);
-                while (aUpto < aStop)
+                var aStop = aOffset + Math.Min(a.Length, b.Length);
+                while (aOffset < aStop)
                 {
-                    int aByte = aBytes[aUpto++] & 0xff;
-                    int bByte = bBytes[bUpto++] & 0xff;
+                    var aByte = aBytes[aOffset++] & 0xff;
+                    var bByte = bBytes[bOffset++] & 0xff;
 
-                    int diff = aByte - bByte;
+                    var diff = aByte - bByte;
                     if (diff != 0)
                     {
                         return diff;
@@ -374,49 +375,43 @@ namespace Lucene.Net.Util
 
         /// @deprecated this comparator is only a transition mechanism
 #pragma warning disable 0612, 0618
-        private static readonly IComparer<BytesRef> Utf8SortedAsUTF16SortOrder = new UTF8SortedAsUTF16Comparator();
+        private static readonly IComparer<BytesRef> UTF8_SORTED_AS_UTF16_SORT_ORDER = new Utf8SortedAsUtf16Comparator();
 #pragma warning restore 0612, 0618
 
         /// @deprecated this comparator is only a transition mechanism
         [Obsolete("this comparator is only a transition mechanism")]
-        public static IComparer<BytesRef> UTF8SortedAsUTF16Comparer
+        public static IComparer<BytesRef> Utf8SortedAsUtf16Comparer
         {
-            get
-            {
-                return Utf8SortedAsUTF16SortOrder;
-            }
+            get { return UTF8_SORTED_AS_UTF16_SORT_ORDER; }
         }
 
         /// @deprecated this comparator is only a transition mechanism
         [Obsolete("this comparator is only a transition mechanism")]
-        private class UTF8SortedAsUTF16Comparator : IComparer<BytesRef>
+        private class Utf8SortedAsUtf16Comparator : IComparer<BytesRef>
         {
             // Only singleton
-            internal UTF8SortedAsUTF16Comparator()
-            {
-            }
 
-            public virtual int Compare(BytesRef a, BytesRef b)
+            public int Compare(BytesRef a, BytesRef b)
             {
-                byte[] aBytes = a.Bytes;
-                int aUpto = a.Offset;
-                byte[] bBytes = b.Bytes;
-                int bUpto = b.Offset;
+                var aBytes = a.Bytes;
+                var aOffset = a.Offset;
+                var bBytes = b.Bytes;
+                var bOffset = b.Offset;
 
                 int aStop;
                 if (a.Length < b.Length)
                 {
-                    aStop = aUpto + a.Length;
+                    aStop = aOffset + a.Length;
                 }
                 else
                 {
-                    aStop = aUpto + b.Length;
+                    aStop = aOffset + b.Length;
                 }
 
-                while (aUpto < aStop)
+                while (aOffset < aStop)
                 {
-                    int aByte = aBytes[aUpto++] & 0xff;
-                    int bByte = bBytes[bUpto++] & 0xff;
+                    var aByte = aBytes[aOffset++] & 0xff;
+                    var bByte = bBytes[bOffset++] & 0xff;
 
                     if (aByte != bByte)
                     {
@@ -450,27 +445,28 @@ namespace Lucene.Net.Util
             }
         }
 
-      
 
         /// <summary>
-        /// Performs internal consistency checks.
+        ///     Performs internal consistency checks.
         /// </summary>
         /// <returns>True</returns>
         /// <exception cref="System.InvalidOperationException">
         ///     <list type="bullet">
-        ///         <item>Thrown when <see cref="BytesRef.Bytes"/> is null.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Length"/> is less than zero.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Length"/> is greater than <see cref="BytesRef.Bytes0"/>.Length.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> is less than zero.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> is greater than <see cref="BytesRef.Bytes0"/>.Length.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> and <see cref="BytesRef.Length"/> is less than zero.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> and <see cref="BytesRef.Length"/> is greater than <see cref="BytesRef.Bytes0"/>.Length.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Bytes" /> is null.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Length" /> is less than zero.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Length" /> is greater than <see cref="BytesRef.Bytes" />.Length.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Offset" /> is less than zero.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Offset" /> is greater than <see cref="BytesRef.Bytes" />.Length.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Offset" /> and <see cref="BytesRef.Length" /> is less than zero.</item>
+        ///         <item>
+        ///             Thrown when <see cref="BytesRef.Offset" /> and <see cref="BytesRef.Length" /> is greater than
+        ///             <see cref="BytesRef.Bytes" />.Length.
+        ///         </item>
         ///     </list>
         /// </exception>
         // this should be a method instead of a property due to the exceptions thrown. 
         public bool Valid()
         {
-            
             if (Bytes == null)
             {
                 throw new InvalidOperationException("bytes is null");
@@ -481,7 +477,8 @@ namespace Lucene.Net.Util
             }
             if (Length > Bytes.Length)
             {
-                throw new InvalidOperationException("length is out of bounds: " + Length + ",bytes.length=" + Bytes.Length);
+                throw new InvalidOperationException("length is out of bounds: " + Length + ",bytes.length=" +
+                                                    Bytes.Length);
             }
             if (Offset < 0)
             {
@@ -497,22 +494,22 @@ namespace Lucene.Net.Util
             }
             if (Offset + Length > Bytes.Length)
             {
-                throw new InvalidOperationException("offset+length out of bounds: offset=" + Offset + ",length=" + Length + ",bytes.length=" + Bytes.Length);
+                throw new InvalidOperationException("offset+length out of bounds: offset=" + Offset + ",length=" +
+                                                    Length + ",bytes.length=" + Bytes.Length);
             }
             return true;
-            
         }
 
         /// <summary>
-        /// Custom enumerator for <see cref="BytesRef"/> that accounts
-        /// for the the custom Length and Offset.
+        ///     Custom enumerator for <see cref="BytesRef" /> that accounts
+        ///     for the the custom Length and Offset.
         /// </summary>
         public class ByteEnumerator : IEnumerator<byte>
         {
-            private int length;
             private byte[] bytes;
+            private int length;
+            private int offset;
             private int position = -1;
-            private int offset = 0;
 
             public ByteEnumerator(byte[] bytes, int offset = 0, int length = 0)
             {
@@ -525,15 +522,15 @@ namespace Lucene.Net.Util
                 this.position = (this.offset - 1);
             }
 
-
+            public int Length
+            {
+                get { return this.length; }
+            }
 
 
             public byte Current
             {
-                get
-                {
-                    return this.bytes[this.position];
-                }
+                get { return this.bytes[this.position]; }
             }
 
             object System.Collections.IEnumerator.Current
@@ -572,11 +569,6 @@ namespace Lucene.Net.Util
             {
                 this.Dispose(false);
             }
-
-            public int Length
-            {
-                get { return this.length; }
-            }
         }
 
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/CharsRef.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/CharsRef.cs b/src/Lucene.Net.Core/Util/CharsRef.cs
index 02afe39..878bca1 100644
--- a/src/Lucene.Net.Core/Util/CharsRef.cs
+++ b/src/Lucene.Net.Core/Util/CharsRef.cs
@@ -17,52 +17,52 @@
 
 namespace Lucene.Net.Util
 {
-    using Lucene.Net.Support;
     using System;
     using System.Collections.Generic;
     using System.Diagnostics;
-    using System.Linq;
+    using Lucene.Net.Support;
+    using ICloneable = Lucene.Net.Support.ICloneable; 
 
     /// <summary>
-    /// <see cref="CharsRef"/> represents a <see cref="System.Char"/> array as a slice from an existing array.
-    /// This class is for internal use only.
+    ///     <see cref="CharsRef" /> represents a <see cref="char" /> array as a slice from an existing array.
+    ///     This class is for internal use only.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///            The <seealso cref="#chars"/> member should never be null; use
-    ///             <seealso cref="CharsRef.EMPTY_CHARS"/> if necessary.
+    ///         The <seealso cref="Chars" /> member should never be null; use
+    ///         <seealso cref="CharsRef.EMPTY_CHARS" /> if necessary.
     ///     </para>
     /// </remarks>
-    public sealed class CharsRef : IComparable<CharsRef>, 
-        ICharSequence, 
-        Lucene.Net.Support.ICloneable, 
+    // ReSharper disable CSharpWarnings::CS1574
+    public sealed class CharsRef : IComparable<CharsRef>,
+        ICharSequence,
+        // ReSharper disable once RedundantNameQualifier
+        ICloneable,
         IEnumerable<char>
     {
-       
-
         /// <summary>
-        /// An empty character array for convenience 
+        ///     An empty character array for convenience
         /// </summary>
         public static readonly char[] EMPTY_CHARS = new char[0];
 
         /// <summary>
-        /// The contents of the CharsRef. Should never be <see cref="Null"/>. 
+        ///     The contents of the CharsRef. Should never be <c>null</c>.
         /// </summary>
         public char[] Chars { get; internal set; }
 
         /// <summary>
-        /// Offset of first valid character. 
+        ///     Offset of first valid character.
         /// </summary>
-        public int Offset {get; internal set;}
+        public int Offset { get; internal set; }
 
         /// <summary>
-        /// Length of used characters. 
+        ///     Length of used characters.
         /// </summary>
         public int Length { get; internal set; }
 
-     
+
         /// <summary>
-        /// Initializes a new instance of <seealso cref="CharsRef"/> with an empty array.
+        ///     Initializes a new instance of <seealso cref="CharsRef" /> with an empty array.
         /// </summary>
         public CharsRef()
             : this(EMPTY_CHARS, 0, 0)
@@ -70,8 +70,8 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        ///  Initializes a new instance of <seealso cref="CharsRef"/> with an empty array with the
-        ///  specified <paramref name="capacity"/>.
+        ///     Initializes a new instance of <seealso cref="CharsRef" /> with an empty array with the
+        ///     specified <paramref name="capacity" />.
         /// </summary>
         /// <param name="capacity">The size of the internal array.</param>
         public CharsRef(int capacity)
@@ -80,10 +80,10 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        ///  Initializes a new instance of <seealso cref="CharsRef"/> that 
-        ///  references the <paramref name="chars"/> instead of makinga copy.
+        ///     Initializes a new instance of <seealso cref="CharsRef" /> that
+        ///     references the <paramref name="chars" /> instead of makinga copy.
         /// </summary>
-        /// <param name="bytes">The array of chars to reference.</param>
+        /// <param name="chars">The array of chars to reference.</param>
         /// <param name="offset">The starting position of the first valid byte.</param>
         /// <param name="length">The number of bytes to use.</param>
         public CharsRef(char[] chars, int offset, int length)
@@ -95,7 +95,7 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Initializes a new instance of <seealso cref="CharsRef"/> with the specified <paramref name="value"/>.
+        ///     Initializes a new instance of <seealso cref="CharsRef" /> with the specified <paramref name="value" />.
         /// </summary>
         /// <param name="value">The string that be referenced.</param>
         public CharsRef(string value)
@@ -106,11 +106,11 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Returns a shallow clone of this instance (the underlying characters are
-        /// <b>not</b> copied and will be shared by both the returned object and this
-        /// object.
+        ///     Returns a shallow clone of this instance (the underlying characters are
+        ///     <b>not</b> copied and will be shared by both the returned object and this
+        ///     object.
         /// </summary>
-        /// <seealso cref="Lucene.Net.Support.ICloneable"/>
+        /// <seealso cref="Lucene.Net.Support.ICloneable" />
         public object Clone(bool deepClone = false)
         {
             if (deepClone)
@@ -128,11 +128,11 @@ namespace Lucene.Net.Util
         public override int GetHashCode()
         {
             const int prime = 31;
-            int result = 0;
-            int end = Offset + Length;
-            for (int i = Offset; i < end; i++)
+            var result = 0;
+            var end = Offset + Length;
+            for (var i = Offset; i < end; i++)
             {
-                result = prime * result + Chars[i];
+                result = prime*result + Chars[i];
             }
             return result;
         }
@@ -146,13 +146,13 @@ namespace Lucene.Net.Util
             }
             if (other is CharsRef)
             {
-                return this.CharsEquals((CharsRef)other);
+                return this.CharsEquals((CharsRef) other);
             }
             return false;
         }
 
         /// <summary>
-        /// Determines if the other <see cref="CharsRef"/> is equal to the current instance.
+        ///     Determines if the other <see cref="CharsRef" /> is equal to the current instance.
         /// </summary>
         /// <param name="other">The instance to compare.</param>
         /// <returns>True, if the other instance is equal to the current instance, otherwise false.</returns>
@@ -160,51 +160,52 @@ namespace Lucene.Net.Util
         {
             if (Length == other.Length)
             {
-                int otherUpto = other.Offset;
-                char[] otherChars = other.Chars;
-                int end = this.Offset + this.Length;
-                for (int upto = Offset; upto < end; upto++, otherUpto++)
+                // upto = Offset;
+                var otherOffset = other.Offset;
+                var otherChars = other.Chars;
+                var end = this.Offset + this.Length;
+                for (var offset = Offset; offset < end; offset++, otherOffset++)
                 {
-                    if (this.Chars[upto] != otherChars[otherUpto])
+                    if (this.Chars[offset] != otherChars[otherOffset])
                     {
                         return false;
                     }
                 }
                 return true;
             }
-            else
-            {
-                return false;
-            }
+
+            return false;
         }
 
         /// <summary>
-        /// Signed int order comparison 
+        ///     Signed int order comparison
         /// </summary>
         /// <param name="other">The reference that will be compared to this instance.</param>
         public int CompareTo(CharsRef other)
         {
+            // ReSharper disable once PossibleUnintendedReferenceComparison
             if (this == other)
             {
                 return 0;
             }
 
-            char[] aChars = this.Chars;
-            int aUpto = this.Offset;
-            char[] bChars = other.Chars;
-            int bUpto = other.Offset;
+            var aChars = this.Chars;
+            var aOffset = this.Offset;
+            var bChars = other.Chars;
+            var bOffset = other.Offset;
 
-            int aStop = aUpto + Math.Min(this.Length, other.Length);
+            var aStop = aOffset + Math.Min(this.Length, other.Length);
 
-            while (aUpto < aStop)
+            while (aOffset < aStop)
             {
-                int aInt = aChars[aUpto++];
-                int bInt = bChars[bUpto++];
+                int aInt = aChars[aOffset++];
+                int bInt = bChars[bOffset++];
                 if (aInt > bInt)
                 {
                     return 1;
                 }
-                else if (aInt < bInt)
+                
+                if (aInt < bInt)
                 {
                     return -1;
                 }
@@ -215,16 +216,16 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Copies the given <seealso cref="CharsRef"/> referenced content into this instance.
+        ///     Copies the given <seealso cref="CharsRef" /> referenced content into this instance.
         /// </summary>
-        /// <param name="other">the <seealso cref="CharsRef"/> to copy </param>
+        /// <param name="other">the <seealso cref="CharsRef" /> to copy </param>
         public void CopyChars(CharsRef other)
         {
             CopyChars(other.Chars, other.Offset, other.Length);
         }
 
         /// <summary>
-        /// Used to grow the reference array.
+        ///     Used to grow the reference array.
         /// </summary>
         /// <param name="newLength">The minimum length to grow the internal array.</param>
         internal void Grow(int newLength)
@@ -237,7 +238,7 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Copies the given array into this CharsRef.
+        ///     Copies the given array into this CharsRef.
         /// </summary>
         public void CopyChars(char[] otherChars, int otherOffset, int otherLength)
         {
@@ -251,14 +252,14 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Appends the given array to this instance.
+        ///     Appends the given array to this instance.
         /// </summary>
         public void Append(char[] otherChars, int otherOffset, int otherLength)
         {
-            int newLen = Length + otherLength;
+            var newLen = Length + otherLength;
             if (this.Chars.Length - this.Offset < newLen)
             {
-                char[] newChars = new char[newLen];
+                var newChars = new char[newLen];
                 Array.Copy(this.Chars, this.Offset, newChars, 0, Length);
                 this.Offset = 0;
                 this.Chars = newChars;
@@ -268,16 +269,18 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Returns the string representation of the <see cref="System.Char"/> array.
+        ///     Returns the string representation of the <see cref="char" /> array.
         /// </summary>
-        /// <returns><see cref="System.String"/></returns>
+        /// <returns>
+        ///     <see cref="string" />
+        /// </returns>
         public override string ToString()
         {
             return new string(this.Chars, this.Offset, this.Length);
         }
 
         /// <summary>
-        /// Returns the char at specified index.
+        ///     Returns the char at specified index.
         /// </summary>
         /// <param name="index">The index of the char to be returned.</param>
         /// <returns>A char</returns>
@@ -286,98 +289,97 @@ namespace Lucene.Net.Util
             // NOTE: must do a real check here to meet the specs of CharSequence
             if (index < 0 || index >= Length)
             {
-                throw new System.IndexOutOfRangeException();
+                throw new IndexOutOfRangeException();
             }
             return this.Chars[this.Offset + index];
         }
 
         /// <summary>
-        /// Returns a new <see cref="ICharSequence"/> of the specified range of start and end.
+        ///     Returns a new <see cref="ICharSequence" /> of the specified range of start and end.
         /// </summary>
         /// <param name="start">The position to start the new sequence.</param>
         /// <param name="end">The position to end the new sequence.</param>
-        /// <returns>A new <see cref="ICharSequence"/>.</returns>
+        /// <returns>A new <see cref="ICharSequence" />.</returns>
         public ICharSequence SubSequence(int start, int end)
         {
             // NOTE: must do a real check here to meet the specs of CharSequence
             if (start < 0 || end > Length || start > end)
             {
-                throw new System.IndexOutOfRangeException();
+                throw new IndexOutOfRangeException();
             }
             return new CharsRef(this.Chars, this.Offset + start, end - start);
         }
 
         /// @deprecated this comparator is only a transition mechanism
 #pragma warning disable 0612, 0618
-        private static readonly IComparer<CharsRef> Utf16SortedAsUTF8SortOrder = new UTF16SortedAsUTF8Comparator();
+        private static readonly IComparer<CharsRef> UTF16_SORTED_AS_UTF8_SORT_ORDER = new Utf16SortedAsUtf8Comparator();
 #pragma warning restore 0612, 0618
 
         /// @deprecated this comparator is only a transition mechanism
         [Obsolete("this comparator is only a transition mechanism")]
-        public static IComparer<CharsRef> UTF16SortedAsUTF8Comparer
+        public static IComparer<CharsRef> Utf16SortedAsUtf8Comparer
         {
-            get
-            {
-                return Utf16SortedAsUTF8SortOrder;
-            }
+            get { return UTF16_SORTED_AS_UTF8_SORT_ORDER; }
         }
 
-        
+
         [Obsolete("this comparator is only a transition mechanism")]
-        private class UTF16SortedAsUTF8Comparator : IComparer<CharsRef>
+        private sealed class Utf16SortedAsUtf8Comparator : IComparer<CharsRef>
         {
-            // Only singleton
-            internal UTF16SortedAsUTF8Comparator()
-            {
-            }
+           
 
-            public virtual int Compare(CharsRef a, CharsRef b)
+            public int Compare(CharsRef a, CharsRef b)
             {
+                // ReSharper disable once PossibleUnintendedReferenceComparison
                 if (a == b)
                 {
                     return 0;
                 }
 
-                char[] aChars = a.Chars;
-                int aUpto = a.Offset;
-                char[] bChars = b.Chars;
-                int bUpto = b.Offset;
+                var aChars = a.Chars;
+                var aOffset = a.Offset;
+                var bChars = b.Chars;
+                var bOffset = b.Offset;
 
-                int aStop = aUpto + Math.Min(a.Length, b.Length);
+                var aStop = aOffset + Math.Min(a.Length, b.Length);
 
-                while (aUpto < aStop)
+                while (aOffset < aStop)
                 {
-                    char aChar = aChars[aUpto++];
-                    char bChar = bChars[bUpto++];
-                    if (aChar != bChar)
+                    var aChar = aChars[aOffset++];
+                    var bChar = bChars[bOffset++];
+
+                    if (aChar == bChar)
+                        continue;
+
+                    
+                    // http://icu-project.org/docs/papers/utf16_code_point_order.html
+
+                    /* aChar != bChar, fix up each one if they're both in or above the surrogate range, then compare them */
+                    if (aChar < 0xd800 || bChar < 0xd800) 
+                        return aChar - bChar; // int must be 32 bits wide
+
+                    //LUCENE TO-DO possible truncation or is char 16bit?
+                    if (aChar >= 0xe000)
+                    {
+                        aChar -= (char) 0x800;
+                    }
+                    else
+                    {
+                        aChar += (char) 0x2000;
+                    }
+
+                    if (bChar >= 0xe000)
                     {
-                        // http://icu-project.org/docs/papers/utf16_code_point_order.html
-
-                        /* aChar != bChar, fix up each one if they're both in or above the surrogate range, then compare them */
-                        if (aChar >= 0xd800 && bChar >= 0xd800)
-                        {//LUCENE TO-DO possible truncation or is char 16bit?
-                            if (aChar >= 0xe000)
-                            {
-                                aChar -= (char)0x800;
-                            }
-                            else
-                            {
-                                aChar += (char)0x2000;
-                            }
-
-                            if (bChar >= 0xe000)
-                            {
-                                bChar -= (char)0x800;
-                            }
-                            else
-                            {
-                                bChar += (char)0x2000;
-                            }
-                        }
-
-                        /* now aChar and bChar are in code point order */
-                        return (int)aChar - (int)bChar; // int must be 32 bits wide
+                        bChar -= (char) 0x800;
                     }
+                    else
+                    {
+                        bChar += (char) 0x2000;
+                    }
+
+                    /* now aChar and bChar are in code point order */
+                    return aChar - bChar; // int must be 32 bits wide
+                    
                 }
 
                 // One is a prefix of the other, or, they are equal:
@@ -386,26 +388,27 @@ namespace Lucene.Net.Util
         }
 
 
-
         /// <summary>
-        /// Performs internal consistency checks.
+        ///     Performs internal consistency checks.
         /// </summary>
         /// <returns>True</returns>
         /// <exception cref="System.InvalidOperationException">
         ///     <list type="bullet">
-        ///         <item>Thrown when <see cref="BytesRef.Bytes"/> is null.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Length"/> is less than zero.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Length"/> is greater than <see cref="BytesRef.Bytes0"/>.Length.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> is less than zero.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> is greater than <see cref="BytesRef.Bytes0"/>.Length.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> and <see cref="BytesRef.Length"/> is less than zero.</item>
-        ///         <item>Thrown when <see cref="BytesRef.Offset"/> and <see cref="BytesRef.Length"/> is greater than <see cref="BytesRef.Bytes0"/>.Length.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Bytes" /> is null.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Length" /> is less than zero.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Length" /> is greater than <see cref="BytesRef.Bytes" />.Length.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Offset" /> is less than zero.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Offset" /> is greater than <see cref="BytesRef.Bytes" />.Length.</item>
+        ///         <item>Thrown when <see cref="BytesRef.Offset" /> and <see cref="BytesRef.Length" /> is less than zero.</item>
+        ///         <item>
+        ///             Thrown when <see cref="BytesRef.Offset" /> and <see cref="BytesRef.Length" /> is greater than
+        ///             <see cref="BytesRef.Bytes" />.Length.
+        ///         </item>
         ///     </list>
         /// </exception>
         // this should be a method instead of a property due to the exceptions thrown. 
         public bool Valid()
         {
-           
             if (this.Chars == null)
             {
                 throw new InvalidOperationException("chars is null");
@@ -416,7 +419,8 @@ namespace Lucene.Net.Util
             }
             if (this.Length > this.Chars.Length)
             {
-                throw new InvalidOperationException("length is out of bounds: " + Length + ",chars.length=" + Chars.Length);
+                throw new InvalidOperationException("length is out of bounds: " + Length + ",chars.length=" +
+                                                    Chars.Length);
             }
             if (this.Offset < 0)
             {
@@ -432,10 +436,10 @@ namespace Lucene.Net.Util
             }
             if (this.Offset + this.Length > this.Chars.Length)
             {
-                throw new InvalidOperationException("offset+length out of bounds: offset=" + Offset + ",length=" + Length + ",chars.length=" + Chars.Length);
+                throw new InvalidOperationException("offset+length out of bounds: offset=" + Offset + ",length=" +
+                                                    Length + ",chars.length=" + Chars.Length);
             }
             return true;
-            
         }
 
         public IEnumerator<char> GetEnumerator()
@@ -445,11 +449,11 @@ namespace Lucene.Net.Util
 
         public class CharEnumerator : IEnumerator<char>, ICharSequence
         {
-            private int length;
             private char[] chars;
+            private int length;
+            private int offset;
             private int position = -1;
-            private int offset = 0;
-      
+
             public CharEnumerator(char[] chars, int offset = 0, int length = 0)
             {
                 if (length == 0 || length > chars.Length)
@@ -461,14 +465,25 @@ namespace Lucene.Net.Util
                 this.position = (this.offset - 1);
             }
 
-      
+            public int Length
+            {
+                get { return this.length; }
+            }
+
+            public char CharAt(int index)
+            {
+                return this.chars[index];
+            }
+
+            public ICharSequence SubSequence(int start, int end)
+            {
+                return new CharEnumerator(this.chars, start, end - start);
+            }
 
 
             public char Current
             {
-                get {
-                    return this.chars[this.position];
-                }
+                get { return this.chars[this.position]; }
             }
 
             object System.Collections.IEnumerator.Current
@@ -492,9 +507,9 @@ namespace Lucene.Net.Util
                 this.Dispose(true);
             }
 
-            protected  virtual void Dispose(bool dispose)
+            protected virtual void Dispose(bool dispose)
             {
-                if(dispose)
+                if (dispose)
                 {
                     this.chars = null;
                     this.offset = 0;
@@ -507,21 +522,6 @@ namespace Lucene.Net.Util
             {
                 this.Dispose(false);
             }
-
-            public int Length
-            {
-                get { return this.length; }
-            }
-
-            public char CharAt(int index)
-            {
-                return this.chars[index];
-            }
-
-            public ICharSequence SubSequence(int start, int end)
-            {
-                return new CharEnumerator(this.chars, start, end - start);
-            }
         }
 
         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/CharsRefBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/CharsRefBuilder.cs b/src/Lucene.Net.Core/Util/CharsRefBuilder.cs
index c7cfa9c..bc51157 100644
--- a/src/Lucene.Net.Core/Util/CharsRefBuilder.cs
+++ b/src/Lucene.Net.Core/Util/CharsRefBuilder.cs
@@ -22,13 +22,14 @@ namespace Lucene.Net.Util
     using System.Diagnostics.CodeAnalysis;
 
     /// <summary>
-    /// Builds up characters for a <see cref="Lucene.Net.Util.CharRef"/>. 
+    /// Builds up characters for a <see cref="Lucene.Net.Util.CharsRef"/>. 
     /// This class is meant for internal use only. 
     /// </summary>
+    // ReSharper disable CSharpWarnings::CS1574
     public class CharsRefBuilder:
         IEnumerable<char>
     {
-        private CharsRef charsRef;
+        private readonly CharsRef charsRef;
         
         /// <summary>
         /// Initializes a new instance of <see cref="CharsRefBuilder"/>.
@@ -42,7 +43,7 @@ namespace Lucene.Net.Util
         /// Gets or sets the character value at the specified index.
         /// </summary>
         /// <param name="index">The position of the value to get or set.</param>
-        /// <returns>The value at the spcified index.</returns>
+        /// <returns>The value at the specified index.</returns>
         public char this[int index]
         {
             get { return this.charsRef.Chars[index]; }
@@ -53,7 +54,7 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Gets the internal reference of <see cref="Lucene.Net.Util.CharRef"/> 
+        /// Gets the internal reference of <see cref="Lucene.Net.Util.CharsRef"/> 
         /// that the builder uses.
         /// </summary>
         public CharsRef CharRef
@@ -105,7 +106,7 @@ namespace Lucene.Net.Util
         }
 
         /// <summary>
-        /// Copies the <see cref="Lucene.Net.Util.CharRef"/> into this instance.
+        /// Copies the <see cref="Lucene.Net.Util.CharsRef"/> into this instance.
         /// </summary>
         /// <param name="other">The instance to copy.</param>
         public void CopyChars(CharsRef other)
@@ -127,7 +128,7 @@ namespace Lucene.Net.Util
         /// </exception>
         public void CopyChars(char[] chars, int offset = 0, int length = 0)
         {
-            this.InternalCopyChars(chars, offset, length, false);
+            this.InternalCopyChars(chars, offset, length);
         }
 
         private void InternalCopyChars(char[] chars, int offset = 0, int length = 0, bool append = false)
@@ -157,7 +158,7 @@ namespace Lucene.Net.Util
         /// <summary>
         /// Copies the <see cref="Lucene.Net.Util.BytesRef"/> into this instance.
         /// </summary>
-        /// <param name="other">The instance to copy.</param>
+        /// <param name="bytes">The instance to copy.</param>
         public void CopyUtf8Bytes(BytesRef bytes)
         {
             this.CopyUtf8Bytes(bytes.Bytes, bytes.Offset, bytes.Length);
@@ -167,13 +168,13 @@ namespace Lucene.Net.Util
         /// <summary>
         /// Copies the bytes into this instance.
         /// </summary>
-        /// <param name="chars">The array of characters to copy.</param>
-        /// <param name="offset">The starting position in <paramref name="chars"/> for the copy.</param>
-        /// <param name="length">The number of characters to copy from <paramref name="chars"/>.</param>
+        /// <param name="bytes">The array of bytes to copy.</param>
+        /// <param name="offset">The starting position in <paramref name="bytes"/> for the copy.</param>
+        /// <param name="length">The number of characters to copy from <paramref name="bytes"/>.</param>
         /// <exception cref="System.ArgumentException">
         ///     <list type="bullet">
         ///         <item>Thrown when <paramref name="offset"/> is less than 0.</item>
-        ///         <item>Thrown when <paramref name="length"/> is less than 0 or greater than <paramref name="chars"/>.Length.</item>
+        ///         <item>Thrown when <paramref name="length"/> is less than 0 or greater than <paramref name="bytes"/>.Length.</item>
         ///     </list>
         /// </exception>
         public void CopyUtf8Bytes(byte[] bytes, int offset = 0, int length = 0)
@@ -187,7 +188,7 @@ namespace Lucene.Net.Util
 
             this.Grow(length);
 
-            this.charsRef.Length = UnicodeUtil.UTF8toUTF16(bytes, offset, length, this.charsRef);
+            this.charsRef.Length = UnicodeUtil.Utf8ToUtf16(bytes, offset, length, this.charsRef);
         }
 
         /// <inherits />
@@ -217,10 +218,10 @@ namespace Lucene.Net.Util
 
 
         /// <summary>
-        /// Returns a new instance of <see cref="Lucene.Net.Util.CharRef"/> that has 
+        /// Returns a new instance of <see cref="Lucene.Net.Util.CharsRef"/> that has 
         /// copy of the current state of this instance.
         /// </summary>
-        /// <returns>a new instance of <see cref="Lucene.Net.Util.CharRef"/></returns>
+        /// <returns>a new instance of <see cref="Lucene.Net.Util.CharsRef"/></returns>
         public CharsRef ToCharRef()
         {
             var copy = this.charsRef.Chars.CopyOf(this.charsRef.Length);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/Constants.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Constants.cs b/src/Lucene.Net.Core/Util/Constants.cs
index 4d1e261..1c59943 100644
--- a/src/Lucene.Net.Core/Util/Constants.cs
+++ b/src/Lucene.Net.Core/Util/Constants.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Util
         public static readonly bool MAC_OS_X = OS_NAME.StartsWith("Mac OS X");
 
         /// <summary>
-        /// Gets the proccess architechture for the current machine.
+        /// Gets the process architecture for the current machine.
         /// </summary>
         // ReSharper disable once InconsistentNaming
         public static string OS_ARCH = SystemProps.Get("PROCESSOR_ARCHITECTURE", "x86");
@@ -106,19 +106,20 @@ namespace Lucene.Net.Util
         ///     </para>
         /// </remarks>
         // ReSharper disable once InconsistentNaming
-        public static readonly System.String LUCENE_MAIN_VERSION = Ident("5.0");
+        public static readonly String LUCENE_MAIN_VERSION = Identity("5.0");
 
         /// <summary>
         /// This is the Lucene version for display purposes.
         /// </summary>
         // ReSharper disable once InconsistentNaming
-        public static System.String LUCENE_VERSION;
+        public static String LUCENE_VERSION;
 
-        // this method prevents inlining the final version constant in compiled
+        // this method prevents in lining the final version constant in compiled
         // classes,
         // see: http://www.javaworld.com/community/node/3400
-        private static System.String Ident(System.String s)
+        private static String Identity(String s)
         {
+            // ReSharper disable once RedundantToStringCall
             return s.ToString();
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/IBits.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/IBits.cs b/src/Lucene.Net.Core/Util/IBits.cs
index 366691e..2750668 100644
--- a/src/Lucene.Net.Core/Util/IBits.cs
+++ b/src/Lucene.Net.Core/Util/IBits.cs
@@ -27,6 +27,7 @@ namespace Lucene.Net.Util
     ///     </para>
     /// </remarks>
     /// <seealso cref="Bits"/>
+    // ReSharper disable CSharpWarnings::CS1574
     public interface IBits
     {
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/InPlaceMergeSorter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/InPlaceMergeSorter.cs b/src/Lucene.Net.Core/Util/InPlaceMergeSorter.cs
index 2d8fc8b..fc5ddea 100644
--- a/src/Lucene.Net.Core/Util/InPlaceMergeSorter.cs
+++ b/src/Lucene.Net.Core/Util/InPlaceMergeSorter.cs
@@ -25,9 +25,7 @@ namespace Lucene.Net.Util
     public abstract class InPlaceMergeSorter : Sorter
     {
 
-        /** Create a new {@link InPlaceMergeSorter} */
-        public InPlaceMergeSorter() { }
-
+       
        
         public sealed override void SortRange(int start, int count)
         {
@@ -44,7 +42,7 @@ namespace Lucene.Net.Util
             }
             else
             {
-                int mid = (start + end) >> 1;
+                var mid = (start + end) >> 1;
 
                 this.MergeSort(start, mid);
                 this.MergeSort(mid, end);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/PclPurgeStrategy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/PclPurgeStrategy.cs b/src/Lucene.Net.Core/Util/PclPurgeStrategy.cs
index 1d9468a..4c0381a 100644
--- a/src/Lucene.Net.Core/Util/PclPurgeStrategy.cs
+++ b/src/Lucene.Net.Core/Util/PclPurgeStrategy.cs
@@ -21,6 +21,7 @@ namespace Lucene.Net.Util
     using System.Collections.Generic;
     using System.Threading;
     using System.Threading.Tasks;
+    // ReSharper disable CSharpWarnings::CS1574
 
     /// <summary>
     /// Default <see cref="IPurgeStrategy"/> for <see cref="PurgeableThreadLocal{T}"/> that 
@@ -76,7 +77,6 @@ namespace Lucene.Net.Util
             if (Interlocked.Decrement(ref this.countUntilPurge) != 0) 
                 return;
 
-            var sem = new SemaphoreSlim(1);
             await this.semaphoreSlim.WaitAsync();
             try
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/PurgeableThreadLocal.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/PurgeableThreadLocal.cs b/src/Lucene.Net.Core/Util/PurgeableThreadLocal.cs
index bb02e40..401f7af 100644
--- a/src/Lucene.Net.Core/Util/PurgeableThreadLocal.cs
+++ b/src/Lucene.Net.Core/Util/PurgeableThreadLocal.cs
@@ -21,6 +21,8 @@ namespace Lucene.Net.Util
     using System.Reflection;
     using System.Threading;
 
+    // ReSharper disable CSharpWarnings::CS1574
+    // ReSharper disable once CSharpWarnings::CS1584
     /// <summary>
     ///     Replacement for Java's CloseableThreadLocal. Java's ThreadLocal keeps objects alive even after a thread dies.
     ///     CloseableThreadLocal was created in order to purge objects that are still in memory even though the
@@ -34,6 +36,7 @@ namespace Lucene.Net.Util
     ///         collection to do it.
     ///     </para>
     ///     <para>
+
     ///         PCL, portable class libraries, currently does not support the <see cref="System.Threading.Thread" />
     ///         class. In order to get around this, <see cref="IPurgeStrategy" /> was created so that different
     ///         purge strategies can be swapped out.  The default strategy can't investigate threads, so the
@@ -106,7 +109,7 @@ namespace Lucene.Net.Util
             get
             {
                 this.CheckDisposed();
-                WeakReference reference = this.threadLocal.Value;
+                var reference = this.threadLocal.Value;
                 if (reference == null || !reference.IsAlive)
                 {
                     T value = default(T);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/RamUsageEstimator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/RamUsageEstimator.cs b/src/Lucene.Net.Core/Util/RamUsageEstimator.cs
index 0e50820..9750ab7 100644
--- a/src/Lucene.Net.Core/Util/RamUsageEstimator.cs
+++ b/src/Lucene.Net.Core/Util/RamUsageEstimator.cs
@@ -44,7 +44,7 @@ namespace Lucene.Net.Util
     ///         
     ///         <item>
     ///             <see href="https://www.simple-talk.com/dotnet/.net-framework/object-overhead-the-hidden-.net-memory--allocation-cost/">
-    ///             Hiden Object Overhead.
+    ///             Hidden Object Overhead.
     ///             </see>
     ///         </item>
     ///         <item>
@@ -61,10 +61,11 @@ namespace Lucene.Net.Util
     /// </remarks>
     // The JVM FEATURE enum should only be ported if mono or different version of the 
     // .NET framework handle memory allocation differently.
+    // ReSharper disable CSharpWarnings::CS1574
     public static class RamUsageEstimator
     {
         /// <summary>
-        /// The number of bytes for one killabyte. 
+        /// The number of bytes for one kilobyte. 
         /// </summary>
         public const long ONE_KB = 1024L;
 
@@ -74,7 +75,7 @@ namespace Lucene.Net.Util
         public const long ONE_MB = ONE_KB * ONE_KB;
 
         /// <summary>
-        /// The number of bytes for one gigbyte. 
+        /// The number of bytes for one gigabyte. 
         /// </summary>
         public const long ONE_GB = ONE_KB * ONE_MB;
 
@@ -119,7 +120,7 @@ namespace Lucene.Net.Util
         public const int NUM_BYTES_UINT = 4;
 
         /// <summary>
-        /// The number of bytes that a <see cref="unit"/> takes up in memory.
+        /// The number of bytes that a <see cref="uint"/> takes up in memory.
         /// </summary>
         public const int NUM_BYTES_FLOAT = 4;
 
@@ -172,34 +173,34 @@ namespace Lucene.Net.Util
 
 
 
-        internal static readonly IDictionary<Type, int> PrimitiveSizes;
+        internal static readonly IDictionary<Type, int> PRIMITIVE_SIZES;
 
         static RamUsageEstimator()
         {
-            PrimitiveSizes = new HashMap<Type, int>();
+            PRIMITIVE_SIZES = new HashMap<Type, int>();
 
             // 1 
-            PrimitiveSizes[typeof(bool)] = NUM_BYTES_BOOLEAN;
-            PrimitiveSizes[typeof(byte)] = NUM_BYTES_BYTE;
-            PrimitiveSizes[typeof(sbyte)] = NUM_BYTES_SBYTE;
+            PRIMITIVE_SIZES[typeof(bool)] = NUM_BYTES_BOOLEAN;
+            PRIMITIVE_SIZES[typeof(byte)] = NUM_BYTES_BYTE;
+            PRIMITIVE_SIZES[typeof(sbyte)] = NUM_BYTES_SBYTE;
 
             // 2
-            PrimitiveSizes[typeof(char)] = NUM_BYTES_CHAR;
-            PrimitiveSizes[typeof(short)] = NUM_BYTES_SHORT;
-            PrimitiveSizes[typeof(ushort)] = NUM_BYTES_USHORT;
+            PRIMITIVE_SIZES[typeof(char)] = NUM_BYTES_CHAR;
+            PRIMITIVE_SIZES[typeof(short)] = NUM_BYTES_SHORT;
+            PRIMITIVE_SIZES[typeof(ushort)] = NUM_BYTES_USHORT;
 
             // 4
-            PrimitiveSizes[typeof(int)] = NUM_BYTES_INT;
-            PrimitiveSizes[typeof(uint)] = NUM_BYTES_UINT;
-            PrimitiveSizes[typeof(float)] = NUM_BYTES_FLOAT;
+            PRIMITIVE_SIZES[typeof(int)] = NUM_BYTES_INT;
+            PRIMITIVE_SIZES[typeof(uint)] = NUM_BYTES_UINT;
+            PRIMITIVE_SIZES[typeof(float)] = NUM_BYTES_FLOAT;
 
             // 8
-            PrimitiveSizes[typeof(long)] = NUM_BYTES_LONG;
-            PrimitiveSizes[typeof(ulong)] = NUM_BYTES_ULONG;
-            PrimitiveSizes[typeof(double)] = NUM_BYTES_DOUBLE;
+            PRIMITIVE_SIZES[typeof(long)] = NUM_BYTES_LONG;
+            PRIMITIVE_SIZES[typeof(ulong)] = NUM_BYTES_ULONG;
+            PRIMITIVE_SIZES[typeof(double)] = NUM_BYTES_DOUBLE;
 
             // 16
-            PrimitiveSizes[typeof(decimal)] = NUM_BYTES_DECIMAL;
+            PRIMITIVE_SIZES[typeof(decimal)] = NUM_BYTES_DECIMAL;
 
             // The Java Version references "sun.misc.Unsafe", the closest class to have one or two of the
             // methods that Unsafe has is System.Runtime.InteropServices.Marshal
@@ -208,12 +209,12 @@ namespace Lucene.Net.Util
             // a developer can visually see how the number of bytes are actually
             // added up.
 
-            int typeObjectPointer = 4; // 4 bytes  32 bit
-            int syncBlock = 4;
-            int arrayLength = 4;
-            int elementReferenceMethodTable = 4;
-            int memoryAlignmentSize = 4;
-            int referenceTypeSize = 4;
+            int typeObjectPointer = 4, // 4 bytes  32 bit
+                syncBlock = 4,
+                arrayLength = 4,
+                elementReferenceMethodTable = 4,
+                memoryAlignmentSize = 4,
+                referenceTypeSize = 4;
 
             if (Constants.KRE_IS_64BIT)
             {
@@ -227,9 +228,9 @@ namespace Lucene.Net.Util
 
             
 
-            int objectHeader = typeObjectPointer + syncBlock;
-            int valueTypeArrayHeader = typeObjectPointer + syncBlock + arrayLength;
-            int referenceTypeArrayHeader = typeObjectPointer + syncBlock + arrayLength + elementReferenceMethodTable;
+            int objectHeader = typeObjectPointer + syncBlock,
+                valueTypeArrayHeader = typeObjectPointer + syncBlock + arrayLength,
+                referenceTypeArrayHeader = typeObjectPointer + syncBlock + arrayLength + elementReferenceMethodTable;
 
             NUM_BYTES_OBJECT_REF = referenceTypeSize;
             NUM_BYTES_OBJECT_HEADER = objectHeader;
@@ -242,34 +243,33 @@ namespace Lucene.Net.Util
             NUM_BYTES_REFERENCE_TYPE_ARRAY_HEADER = referenceTypeArrayHeader;
         }
 
+        /// <summary>
+        /// Adjusts for field.
+        /// </summary>
+        /// <param name="sizeSoFar">The size so far.</param>
+        /// <param name="f">The f.</param>
+        /// <returns>System.Int64.</returns>
         public static long AdjustForField(long sizeSoFar, FieldInfo f)
         {
             var typeInfo = f.FieldType.GetTypeInfo();
-            int fsize = typeInfo.IsPrimitive ? PrimitiveSizes[f.FieldType] : NUM_BYTES_OBJECT_REF;
+            var fieldSize = typeInfo.IsPrimitive ? PRIMITIVE_SIZES[f.FieldType] : NUM_BYTES_OBJECT_REF;
 
-            if (f.DeclaringType != null && f.DeclaringType.GetTypeInfo().IsValueType)
-            {
-                try
-                {
-                    // this is the closest thing that .NET has to getting the FieldOffset.
-                    // objectFieldOffsetMethod
+            if (f.DeclaringType == null || !f.DeclaringType.GetTypeInfo().IsValueType) 
+                return sizeSoFar + fieldSize;
+           
+            // this is the closest thing that .NET has to getting the FieldOffset.
+            // objectFieldOffsetMethod
 
-                    // here is a .NET Fiddle that shows what the code in Java is attempting to account for
-                    // https://dotnetfiddle.net/7fSZ5b
+            // here is a .NET Fiddle that shows what the code in Java is attempting to account for
+            // https://dotnetfiddle.net/7fSZ5b
 
-                    // the alternative would be to create an express to use Marshal.OffsetOf<T>(fieldName).
+            // the alternative would be to create an express to use Marshal.OffsetOf<T>(fieldName).
 #pragma warning disable 0618
-                    var offset = Marshal.OffsetOf(f.DeclaringType, f.Name).ToInt64() + fsize;
+            var offset = Marshal.OffsetOf(f.DeclaringType, f.Name).ToInt64() + fieldSize;
 #pragma warning restore 0618
-                    Math.Max(sizeSoFar, offset);
-                }
-                catch
-                {
-                    throw;
-                }
-            }
+            return Math.Max(sizeSoFar, offset);
 
-            return sizeSoFar + fsize;
+  
         }
 
 
@@ -280,7 +280,7 @@ namespace Lucene.Net.Util
         /// <returns>The size of the object after its alignment. </returns>
         public static long AlignObjectSize(long size)
         {
-            size += (long)NUM_BYTES_OBJECT_ALIGNMENT - 1L;
+            size += NUM_BYTES_OBJECT_ALIGNMENT - 1L;
             return size - (size % NUM_BYTES_OBJECT_ALIGNMENT);
         }
 
@@ -290,7 +290,7 @@ namespace Lucene.Net.Util
         /// </summary>
         public static string HumanReadableUnits(long bytes)
         {
-            return HumanReadableUnits(bytes, new NumberFormatInfo() { NumberDecimalDigits = 1 });
+            return HumanReadableUnits(bytes, new NumberFormatInfo { NumberDecimalDigits = 1 });
         }
 
         /// <summary> 
@@ -302,19 +302,19 @@ namespace Lucene.Net.Util
 
             if (bytes / ONE_GB > 0)
             {
-                newSizeAndUnits = System.Convert.ToString(((float)bytes / ONE_GB), df) + " GB";
+                newSizeAndUnits = Convert.ToString(((float)bytes / ONE_GB), df) + " GB";
             }
             else if (bytes / ONE_MB > 0)
             {
-                newSizeAndUnits = System.Convert.ToString((float)bytes / ONE_MB, df) + " MB";
+                newSizeAndUnits = Convert.ToString((float)bytes / ONE_MB, df) + " MB";
             }
             else if (bytes / ONE_KB > 0)
             {
-                newSizeAndUnits = System.Convert.ToString((float)bytes / ONE_KB, df) + " KB";
+                newSizeAndUnits = Convert.ToString((float)bytes / ONE_KB, df) + " KB";
             }
             else
             {
-                newSizeAndUnits = System.Convert.ToString(bytes) + " bytes";
+                newSizeAndUnits = Convert.ToString(bytes) + " bytes";
             }
 
             return newSizeAndUnits;
@@ -349,16 +349,9 @@ namespace Lucene.Net.Util
             if (obj == null)
                 return 0;
 
-            Type type = obj.GetType();
+            var type = obj.GetType();
 
-            if (type.IsArray)
-            {
-                return ShallowSizeOfArray((Array)obj);
-            }
-            else
-            {
-                return ShallowSizeOfInstance(type);
-            }
+            return type.IsArray ? ShallowSizeOfArray((Array)obj) : ShallowSizeOfInstance(type);
         }
 
         /// <summary>
@@ -378,7 +371,7 @@ namespace Lucene.Net.Util
                 throw new ArgumentException("This method does not work with Arrays.");
 
             if (typeInfo.IsPrimitive)
-                return PrimitiveSizes[typeInfo.AsType()];
+                return PRIMITIVE_SIZES[typeInfo.AsType()];
 
             long size = NUM_BYTES_OBJECT_HEADER;
 
@@ -404,7 +397,7 @@ namespace Lucene.Net.Util
                 if (arrayElementTypeInfo.IsPrimitive)
                 {
                     size = NUM_BYTES_VALUE_TYPE_ARRAY_HEADER;
-                    size += (long)length * PrimitiveSizes[arrayElementType];
+                    size += (long)length * PRIMITIVE_SIZES[arrayElementType];
                 }
       
                 else
@@ -427,9 +420,10 @@ namespace Lucene.Net.Util
             return SizeOf(array.ToCharArray());
         }
 
+        // ReSharper disable once CSharpWarnings::CS1580
         /// <summary>
         /// Returns the size of the memory allocation for <typeparamref name="T"/>[]. If the
-        /// array is not a primitive type, it defers the array to <see cref="ShallowSizeOfArray(Array)"/> 
+        /// array is not a primitive type, it defers the array to <see cref="ShallowSizeOfArray(System.Array)"/> 
         /// </summary>
         /// <typeparam name="T">The element type of the array</typeparam>
         /// <param name="array">The array of <typeparamref name="T"/>.</param>
@@ -437,12 +431,12 @@ namespace Lucene.Net.Util
         public static long SizeOf<T>(T[] array) where T : struct
         {
             var type = typeof(T);
-            if (!PrimitiveSizes.ContainsKey(type))
+            if (!PRIMITIVE_SIZES.ContainsKey(type))
                 return ShallowSizeOfArray(array);
 
-            int bytes = PrimitiveSizes[type];
+            var bytes = PRIMITIVE_SIZES[type];
           
-            var size = (long)NUM_BYTES_VALUE_TYPE_ARRAY_HEADER + (long)bytes * array.Length;
+            var size = NUM_BYTES_VALUE_TYPE_ARRAY_HEADER + (long)bytes * array.Length;
 
             return AlignObjectSize(size);
         }
@@ -456,13 +450,8 @@ namespace Lucene.Net.Util
         /// <returns>The memory allocation size.</returns>
         public static long SizeOf(IAccountable[] accountables)
         {
-            var size = ShallowSizeOf(accountables);
-            foreach (var accountable in accountables)
-            {
-                size += accountable.RamBytesUsed;
-            }
-
-            return size;
+            // ReSharper disable once CoVariantArrayConversion
+            return ShallowSizeOf(accountables) + accountables.Sum(accountable => accountable.RamBytesUsed);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/SetOnce.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/SetOnce.cs b/src/Lucene.Net.Core/Util/SetOnce.cs
index ac3c821..af7439d 100644
--- a/src/Lucene.Net.Core/Util/SetOnce.cs
+++ b/src/Lucene.Net.Core/Util/SetOnce.cs
@@ -19,7 +19,7 @@ namespace Lucene.Net.Util
 {
     using System;
     using Lucene.Net.Support;
-
+    using ICloneable = Lucene.Net.Support.ICloneable;
   
 
     /// <summary>
@@ -28,7 +28,7 @@ namespace Lucene.Net.Util
     /// and retrieve it many times. 
     /// </summary>
     /// <typeparam name="T">The value type.</typeparam>
-    public class SetOnce<T> : Lucene.Net.Support.ICloneable
+    public class SetOnce<T> : ICloneable
     {
         private T value;
         private volatile bool isSet;
@@ -72,10 +72,11 @@ namespace Lucene.Net.Util
         /// Sets the value.
         /// </summary>
         /// <param name="value">The value to be set.</param>
-        /// <exception cref="SetOnce.AlreadySetException">Thrown when the value has already been set.</exception>
+        /// <exception cref="SetOnce{T}.AlreadySetException">Thrown when the value has already been set.</exception>
+        // ReSharper disable once ParameterHidesMember
         protected void Set(T value)
         {
-            if (!Object.ReferenceEquals(this.value, value) && isSet)
+            if (!ReferenceEquals(this.value, value) && isSet)
                 throw new AlreadySetException("value has already been set");
 
             this.isSet = true;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/Sorter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Sorter.cs b/src/Lucene.Net.Core/Util/Sorter.cs
index bbb7312..88f44d3 100644
--- a/src/Lucene.Net.Core/Util/Sorter.cs
+++ b/src/Lucene.Net.Core/Util/Sorter.cs
@@ -26,13 +26,11 @@ namespace Lucene.Net.Util
     /// <summary>
     /// 
     /// </summary>
+    // ReSharper disable CSharpWarnings::CS1574
     public abstract class Sorter : IComparer<int>
     {
         protected static readonly int THRESHOLD = 20;
 
-
-        protected Sorter() { }
-
         /// <summary>
         /// Sort a slice or range which begins at the <paramref name="start"/> index to the <paramref name="count"/> index.
         /// </summary>
@@ -81,7 +79,8 @@ namespace Lucene.Net.Util
             {
                 return;
             }
-            else if (count - start == 2)
+            
+            if (count - start == 2)
             {
                 this.Swap(middle - 1, middle);
                 return;
@@ -96,11 +95,11 @@ namespace Lucene.Net.Util
             }
 
             int firstCut, secondCut;
-            int len11, len22;
+            int len22;
 
             if (middle - start > count - middle)
             {
-                len11 = (middle - start) >> 1;
+                var len11 = (middle - start) >> 1;
                 firstCut = start + len11;
                 secondCut = this.Lower(middle, count, firstCut);
                 len22 = secondCut - middle;
@@ -110,7 +109,7 @@ namespace Lucene.Net.Util
                 len22 = (count - middle) >> 1;
                 secondCut = middle + len22;
                 firstCut = this.Upper(start, middle, secondCut);
-                len11 = firstCut - start;
+                //len11 = firstCut - start;
             }
 
             this.Rotate(firstCut, middle, secondCut);
@@ -251,12 +250,12 @@ namespace Lucene.Net.Util
             }
         }
 
-        void BinarySort(int start, int count)
+        protected void BinarySort(int start, int count)
         {
             this.BinarySort(start, count, start + 1);
         }
 
-        void BinarySort(int start, int count, int i)
+        protected void BinarySort(int start, int count, int i)
         {
             for (; i < count; ++i)
             {
@@ -296,7 +295,7 @@ namespace Lucene.Net.Util
             }
         }
 
-        void HeapSort(int start, int count)
+        protected void HeapSort(int start, int count)
         {
             if (count - start <= 1)
             {
@@ -305,14 +304,14 @@ namespace Lucene.Net.Util
 
             this.Heapify(start, count);
 
-            for (int end = count - 1; end > start; --end)
+            for (var end = count - 1; end > start; --end)
             {
                 this.Swap(start, end);
                 this.SiftDown(start, start, end);
             }
         }
 
-        void Heapify(int start, int count)
+        protected void Heapify(int start, int count)
         {
             for (int i = HeapParent(start, count - 1); i >= start; --i)
             {
@@ -320,7 +319,7 @@ namespace Lucene.Net.Util
             }
         }
 
-        void SiftDown(int i, int start, int count)
+        protected void SiftDown(int i, int start, int count)
         {
             for (int leftChild = HeapChild(start, i); leftChild < count; leftChild = HeapChild(start, i))
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/StringHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/StringHelper.cs b/src/Lucene.Net.Core/Util/StringHelper.cs
index de2c290..5856922 100644
--- a/src/Lucene.Net.Core/Util/StringHelper.cs
+++ b/src/Lucene.Net.Core/Util/StringHelper.cs
@@ -17,7 +17,6 @@
 
 namespace Lucene.Net.Util
 {
-    using System;
     using Lucene.Net.Support;
 
     public class StringHelper

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/785acd7d/src/Lucene.Net.Core/Util/SystemProps.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/SystemProps.cs b/src/Lucene.Net.Core/Util/SystemProps.cs
index 1e0ca92..02b5868 100644
--- a/src/Lucene.Net.Core/Util/SystemProps.cs
+++ b/src/Lucene.Net.Core/Util/SystemProps.cs
@@ -50,7 +50,7 @@ namespace Lucene.Net.Util
         /// Gets the string value associated with the specified <paramref name="key"/>.
         /// </summary>
         /// <param name="key">The identifier associated with a value.</param>
-        /// <returns>The <see cref="System.String"/> value.</returns>
+        /// <returns>The <see cref="string"/> value.</returns>
         public static string Get(string key)
         {
             return s_config.Get(key);


Mime
View raw message