You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2021/02/24 02:51:52 UTC

[lucenenet] branch master updated: SWEEP: Removed FEATURE_CLONEABLE and the IncludeICloneable MSBuild property to enable it. See #430.

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new 532f48c  SWEEP: Removed FEATURE_CLONEABLE and the IncludeICloneable MSBuild property to enable it. See #430.
532f48c is described below

commit 532f48c2a8c906d89609e291d8959406d5aae5f9
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Tue Feb 23 05:10:09 2021 +0700

    SWEEP: Removed FEATURE_CLONEABLE and the IncludeICloneable MSBuild property to enable it. See #430.
---
 Directory.Build.targets                                        |  3 ---
 .../Analysis/Compound/Hyphenation/CharVector.cs                |  5 +----
 .../Analysis/Compound/Hyphenation/TernaryTree.cs               | 10 ++--------
 .../Analysis/Icu/TokenAttributes/ScriptAttributeImpl.cs        |  5 +----
 .../TokenAttributes/BaseFormAttributeImpl.cs                   |  5 +----
 .../TokenAttributes/InflectionAttributeImpl.cs                 |  5 +----
 .../TokenAttributes/PartOfSpeechAttributeImpl.cs               |  5 +----
 .../TokenAttributes/ReadingAttributeImpl.cs                    |  5 +----
 .../Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs |  5 +----
 src/Lucene.Net.Benchmark/ByTask/Stats/TaskStats.cs             |  5 +----
 src/Lucene.Net.Benchmark/ByTask/Tasks/PerfTask.cs              |  5 +----
 src/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs    |  5 +----
 .../Flexible/Core/Nodes/PathQueryNode.cs                       |  5 +----
 .../Flexible/Core/Nodes/QueryNodeImpl.cs                       |  5 +----
 src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs         |  5 +----
 src/Lucene.Net/Analysis/TokenAttributes/CharTermAttribute.cs   |  7 ++-----
 src/Lucene.Net/Analysis/TokenAttributes/FlagsAttribute.cs      |  7 ++-----
 src/Lucene.Net/Analysis/TokenAttributes/OffsetAttribute.cs     |  7 ++-----
 src/Lucene.Net/Analysis/TokenAttributes/PayloadAttribute.cs    |  7 ++-----
 .../Analysis/TokenAttributes/PositionIncrementAttribute.cs     |  7 ++-----
 .../Analysis/TokenAttributes/PositionLengthAttribute.cs        |  7 ++-----
 src/Lucene.Net/Analysis/TokenAttributes/TypeAttribute.cs       |  7 ++-----
 .../Codecs/Compressing/CompressingStoredFieldsIndexReader.cs   |  5 +----
 src/Lucene.Net/Codecs/Compressing/Decompressor.cs              |  7 ++-----
 src/Lucene.Net/Codecs/Lucene3x/Lucene3xStoredFieldsReader.cs   |  7 ++-----
 src/Lucene.Net/Codecs/Lucene3x/SegmentTermEnum.cs              |  7 ++-----
 src/Lucene.Net/Codecs/Lucene3x/TermBuffer.cs                   |  7 ++-----
 src/Lucene.Net/Codecs/Lucene40/BitVector.cs                    |  5 +----
 src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsReader.cs   |  7 ++-----
 src/Lucene.Net/Codecs/StoredFieldsReader.cs                    |  7 ++-----
 src/Lucene.Net/Codecs/TermVectorsReader.cs                     |  7 ++-----
 src/Lucene.Net/Index/DocumentsWriterPerThreadPool.cs           |  7 ++-----
 src/Lucene.Net/Index/FlushPolicy.cs                            |  7 ++-----
 src/Lucene.Net/Index/IMergeScheduler.cs                        |  7 +------
 src/Lucene.Net/Index/IndexDeletionPolicy.cs                    |  7 ++-----
 src/Lucene.Net/Index/IndexWriterConfig.cs                      |  5 +----
 src/Lucene.Net/Index/MergePolicy.cs                            |  7 ++-----
 src/Lucene.Net/Index/MergeScheduler.cs                         |  7 ++-----
 src/Lucene.Net/Index/SegmentInfos.cs                           |  5 +----
 src/Lucene.Net/Index/TermState.cs                              |  7 ++-----
 src/Lucene.Net/Search/Query.cs                                 |  5 +----
 src/Lucene.Net/Search/Spans/SpanNearQuery.cs                   |  5 +----
 src/Lucene.Net/Search/Spans/SpanNotQuery.cs                    |  7 ++-----
 src/Lucene.Net/Search/Spans/SpanOrQuery.cs                     |  5 +----
 src/Lucene.Net/Search/Spans/SpanPositionCheckQuery.cs          |  7 ++-----
 src/Lucene.Net/Store/DataInput.cs                              |  5 +----
 src/Lucene.Net/Store/IndexInput.cs                             |  7 ++-----
 src/Lucene.Net/Store/RAMInputStream.cs                         |  7 ++-----
 src/Lucene.Net/Util/AttributeImpl.cs                           |  7 ++-----
 src/Lucene.Net/Util/AttributeSource.cs                         |  7 ++-----
 src/Lucene.Net/Util/Automaton/Automaton.cs                     |  7 ++-----
 src/Lucene.Net/Util/Automaton/Transition.cs                    |  7 ++-----
 src/Lucene.Net/Util/BytesRef.cs                                |  6 ++----
 src/Lucene.Net/Util/CharsRef.cs                                |  6 ++----
 src/Lucene.Net/Util/InfoStream.cs                              |  5 +----
 src/Lucene.Net/Util/IntsRef.cs                                 |  7 ++-----
 src/Lucene.Net/Util/LongsRef.cs                                |  5 +----
 src/Lucene.Net/Util/OpenBitSet.cs                              |  5 +----
 src/Lucene.Net/Util/SetOnce.cs                                 |  7 ++-----
 59 files changed, 91 insertions(+), 271 deletions(-)

diff --git a/Directory.Build.targets b/Directory.Build.targets
index dc364c2..b7dfdbe 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -77,9 +77,6 @@
     <DefineConstants>$(DefineConstants);FEATURE_TYPE_GETMETHOD__BINDINGFLAGS_PARAMS</DefineConstants>
     <DefineConstants>$(DefineConstants);FEATURE_XSLT</DefineConstants>
 
-    <!-- NOTE: Microsoft's recommendation is not to use the ICloneable interface.
-        To add it to the build, just add /p:IncludeICloneable to the command line. -->
-    <DefineConstants Condition=" '$(IncludeICloneable)' == 'true' ">$(DefineConstants);FEATURE_CLONEABLE</DefineConstants>
   </PropertyGroup>
 
   <!-- Features in .NET Standard 1.x and .NET Core 1.x -->
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/CharVector.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/CharVector.cs
index 3ee19d2..b3411c2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/CharVector.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/CharVector.cs
@@ -27,10 +27,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
     /// 
     /// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
     /// </summary>
-    public class CharVector
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public class CharVector // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Capacity increment size
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/TernaryTree.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/TernaryTree.cs
index 550746d..1dfeb92 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/TernaryTree.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/TernaryTree.cs
@@ -65,10 +65,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
     /// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified. 
     /// </summary>
 
-    public class TernaryTree
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public class TernaryTree // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         // We use 4 arrays to represent a node.I guess I should have created a proper
         // node class, but somehow Knuth's pascal code made me forget we now have a
@@ -557,10 +554,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
             /// </summary>
             private string curkey;
 
-            private class Item
-#if FEATURE_CLONEABLE
-                : System.ICloneable
-#endif
+            private class Item // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
             {
                 internal char parent;
                 internal char child;
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/TokenAttributes/ScriptAttributeImpl.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/TokenAttributes/ScriptAttributeImpl.cs
index ce1e126..493d974 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/TokenAttributes/ScriptAttributeImpl.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/TokenAttributes/ScriptAttributeImpl.cs
@@ -27,10 +27,7 @@ namespace Lucene.Net.Analysis.Icu.TokenAttributes
     /// <para/>
     /// @lucene.experimental
     /// </summary>
-    public class ScriptAttribute : Attribute, IScriptAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class ScriptAttribute : Attribute, IScriptAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private int code = UScript.Common;
 
diff --git a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/BaseFormAttributeImpl.cs b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/BaseFormAttributeImpl.cs
index 4df05e4..4d27dc8 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/BaseFormAttributeImpl.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/BaseFormAttributeImpl.cs
@@ -22,10 +22,7 @@ namespace Lucene.Net.Analysis.Ja.TokenAttributes
     /// <summary>
     /// Attribute for <see cref="Token.GetBaseForm()"/>.
     /// </summary>
-    public class BaseFormAttribute : Attribute, IBaseFormAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class BaseFormAttribute : Attribute, IBaseFormAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private Token token;
 
diff --git a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/InflectionAttributeImpl.cs b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/InflectionAttributeImpl.cs
index 9f0bf2c..aa53e2d 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/InflectionAttributeImpl.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/InflectionAttributeImpl.cs
@@ -23,10 +23,7 @@ namespace Lucene.Net.Analysis.Ja.TokenAttributes
     /// <summary>
     /// Attribute for Kuromoji inflection data.
     /// </summary>
-    public class InflectionAttribute : Attribute, IInflectionAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class InflectionAttribute : Attribute, IInflectionAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private Token token;
 
diff --git a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/PartOfSpeechAttributeImpl.cs b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/PartOfSpeechAttributeImpl.cs
index cf589c1..f4ddb70 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/PartOfSpeechAttributeImpl.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/PartOfSpeechAttributeImpl.cs
@@ -23,10 +23,7 @@ namespace Lucene.Net.Analysis.Ja.TokenAttributes
     /// <summary>
     /// Attribute for <see cref="Token.GetPartOfSpeech()"/>.
     /// </summary>
-    public class PartOfSpeechAttribute : Attribute, IPartOfSpeechAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class PartOfSpeechAttribute : Attribute, IPartOfSpeechAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private Token token;
 
diff --git a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/ReadingAttributeImpl.cs b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/ReadingAttributeImpl.cs
index 6cb656f..f24600f 100644
--- a/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/ReadingAttributeImpl.cs
+++ b/src/Lucene.Net.Analysis.Kuromoji/TokenAttributes/ReadingAttributeImpl.cs
@@ -23,10 +23,7 @@ namespace Lucene.Net.Analysis.Ja.TokenAttributes
     /// <summary>
     /// Attribute for Kuromoji reading data
     /// </summary>
-    public class ReadingAttribute : Attribute, IReadingAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class ReadingAttribute : Attribute, IReadingAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private Token token;
 
diff --git a/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs b/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs
index 056a790..5dc9834 100644
--- a/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs
+++ b/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs
@@ -26,10 +26,7 @@ namespace Lucene.Net.Analysis.Morfologik.TokenAttributes
     /// Morphosyntactic annotations for surface forms.
     /// </summary>
     /// <seealso cref="IMorphosyntacticTagsAttribute"/>
-    public class MorphosyntacticTagsAttribute : Attribute, IMorphosyntacticTagsAttribute
-#if FEATURE_CLONEABLE
-        , ICloneable
-#endif
+    public class MorphosyntacticTagsAttribute : Attribute, IMorphosyntacticTagsAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>Initializes this attribute with no tags</summary>
         public MorphosyntacticTagsAttribute() { }
diff --git a/src/Lucene.Net.Benchmark/ByTask/Stats/TaskStats.cs b/src/Lucene.Net.Benchmark/ByTask/Stats/TaskStats.cs
index 0010f97..a20d344 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Stats/TaskStats.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Stats/TaskStats.cs
@@ -29,10 +29,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Stats
     /// The same task can run more than once, but, if that task records statistics, 
     /// each run would create its own TaskStats.
     /// </summary>
-    public class TaskStats
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public class TaskStats // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>Task for which data was collected.</summary>
         private readonly PerfTask task; // LUCENENET: marked readonly
diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/PerfTask.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/PerfTask.cs
index 1621480..1448994 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Tasks/PerfTask.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/PerfTask.cs
@@ -58,10 +58,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks
     ///     </description></item>
     /// </list>
     /// </remarks>
-    public abstract class PerfTask : IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class PerfTask : IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         internal const int DEFAULT_LOG_STEP = 1000;
 
diff --git a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs
index a4db7e9..9b26e73 100644
--- a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CharBlockArray.cs
@@ -41,10 +41,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
         private const int DEFAULT_BLOCK_SIZE = 32 * 1024; // 32 KB default size
 
-        internal sealed class Block
-#if FEATURE_CLONEABLE
-            : System.ICloneable
-#endif
+        internal sealed class Block // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
         {
             internal const long serialVersionUID = 1L;
 
diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/PathQueryNode.cs b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/PathQueryNode.cs
index 13b2df9..335ef2b 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/PathQueryNode.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/PathQueryNode.cs
@@ -44,10 +44,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Nodes
         /// <summary>
         /// Term text with a beginning and end position
         /// </summary>
-        public class QueryText
-#if FEATURE_CLONEABLE
-            : System.ICloneable
-#endif
+        public class QueryText // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
         {
             private string value = null;
 
diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs
index d0d30d9..37de4e2 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/QueryNodeImpl.cs
@@ -30,10 +30,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Nodes
     /// A <see cref="QueryNode"/> is the default implementation of the interface
     /// <see cref="IQueryNode"/>
     /// </summary>
-    public abstract class QueryNode : IQueryNode
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class QueryNode : IQueryNode // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// index default field
diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
index f73de2f..8440bcd 100644
--- a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
+++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs
@@ -25,10 +25,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query
     /// <summary>
     /// Lowest level base class for surround queries 
     /// </summary>
-    public abstract class SrndQuery
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public abstract class SrndQuery // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         //public SrndQuery() { }
 
diff --git a/src/Lucene.Net/Analysis/TokenAttributes/CharTermAttribute.cs b/src/Lucene.Net/Analysis/TokenAttributes/CharTermAttribute.cs
index bb94cea..c3d2572 100644
--- a/src/Lucene.Net/Analysis/TokenAttributes/CharTermAttribute.cs
+++ b/src/Lucene.Net/Analysis/TokenAttributes/CharTermAttribute.cs
@@ -1,4 +1,4 @@
-using J2N.Text;
+using J2N.Text;
 using System;
 using System.Diagnostics.CodeAnalysis;
 using System.Text;
@@ -33,10 +33,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
 
     /// <summary>
     /// Default implementation of <see cref="ICharTermAttribute"/>. </summary>
-    public class CharTermAttribute : Attribute, ICharTermAttribute, ITermToBytesRefAttribute, IAppendable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class CharTermAttribute : Attribute, ICharTermAttribute, ITermToBytesRefAttribute, IAppendable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private const int MIN_BUFFER_SIZE = 10;
 
diff --git a/src/Lucene.Net/Analysis/TokenAttributes/FlagsAttribute.cs b/src/Lucene.Net/Analysis/TokenAttributes/FlagsAttribute.cs
index b1699bc..103731c 100644
--- a/src/Lucene.Net/Analysis/TokenAttributes/FlagsAttribute.cs
+++ b/src/Lucene.Net/Analysis/TokenAttributes/FlagsAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Analysis.TokenAttributes
 {
@@ -24,10 +24,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
 
     /// <summary>
     /// Default implementation of <see cref="IFlagsAttribute"/>. </summary>
-    public class FlagsAttribute : Attribute, IFlagsAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class FlagsAttribute : Attribute, IFlagsAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private int flags = 0;
 
diff --git a/src/Lucene.Net/Analysis/TokenAttributes/OffsetAttribute.cs b/src/Lucene.Net/Analysis/TokenAttributes/OffsetAttribute.cs
index 5011013..9d4eaa2 100644
--- a/src/Lucene.Net/Analysis/TokenAttributes/OffsetAttribute.cs
+++ b/src/Lucene.Net/Analysis/TokenAttributes/OffsetAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Analysis.TokenAttributes
 {
@@ -24,10 +24,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
 
     /// <summary>
     /// Default implementation of <see cref="IOffsetAttribute"/>. </summary>
-    public class OffsetAttribute : Attribute, IOffsetAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class OffsetAttribute : Attribute, IOffsetAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private int startOffset;
         private int endOffset;
diff --git a/src/Lucene.Net/Analysis/TokenAttributes/PayloadAttribute.cs b/src/Lucene.Net/Analysis/TokenAttributes/PayloadAttribute.cs
index 6de7693..2304493 100644
--- a/src/Lucene.Net/Analysis/TokenAttributes/PayloadAttribute.cs
+++ b/src/Lucene.Net/Analysis/TokenAttributes/PayloadAttribute.cs
@@ -1,4 +1,4 @@
-namespace Lucene.Net.Analysis.TokenAttributes
+namespace Lucene.Net.Analysis.TokenAttributes
 {
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,10 +23,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
 
     /// <summary>
     /// Default implementation of <see cref="IPayloadAttribute"/>. </summary>
-    public class PayloadAttribute : Attribute, IPayloadAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class PayloadAttribute : Attribute, IPayloadAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private BytesRef payload;
 
diff --git a/src/Lucene.Net/Analysis/TokenAttributes/PositionIncrementAttribute.cs b/src/Lucene.Net/Analysis/TokenAttributes/PositionIncrementAttribute.cs
index 578b306..7a737e5 100644
--- a/src/Lucene.Net/Analysis/TokenAttributes/PositionIncrementAttribute.cs
+++ b/src/Lucene.Net/Analysis/TokenAttributes/PositionIncrementAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Analysis.TokenAttributes
 {
@@ -24,10 +24,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
 
     /// <summary>
     /// Default implementation of <see cref="IPositionIncrementAttribute"/>. </summary>
-    public class PositionIncrementAttribute : Attribute, IPositionIncrementAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class PositionIncrementAttribute : Attribute, IPositionIncrementAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private int positionIncrement = 1;
 
diff --git a/src/Lucene.Net/Analysis/TokenAttributes/PositionLengthAttribute.cs b/src/Lucene.Net/Analysis/TokenAttributes/PositionLengthAttribute.cs
index cccf078..a26e3b1 100644
--- a/src/Lucene.Net/Analysis/TokenAttributes/PositionLengthAttribute.cs
+++ b/src/Lucene.Net/Analysis/TokenAttributes/PositionLengthAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Analysis.TokenAttributes
 {
@@ -24,10 +24,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
 
     /// <summary>
     /// Default implementation of <see cref="IPositionLengthAttribute"/>. </summary>
-    public class PositionLengthAttribute : Attribute, IPositionLengthAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class PositionLengthAttribute : Attribute, IPositionLengthAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private int positionLength = 1;
 
diff --git a/src/Lucene.Net/Analysis/TokenAttributes/TypeAttribute.cs b/src/Lucene.Net/Analysis/TokenAttributes/TypeAttribute.cs
index 8fb4c74..a4a23db 100644
--- a/src/Lucene.Net/Analysis/TokenAttributes/TypeAttribute.cs
+++ b/src/Lucene.Net/Analysis/TokenAttributes/TypeAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Analysis.TokenAttributes
 {
@@ -24,10 +24,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
 
     /// <summary>
     /// Default implementation of <see cref="ITypeAttribute"/>. </summary>
-    public partial class TypeAttribute : Attribute, ITypeAttribute
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public partial class TypeAttribute : Attribute, ITypeAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private string type;
 
diff --git a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexReader.cs b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexReader.cs
index b12a6d9..9db213e 100644
--- a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexReader.cs
+++ b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsIndexReader.cs
@@ -34,10 +34,7 @@ namespace Lucene.Net.Codecs.Compressing
     /// <para/>
     /// @lucene.internal
     /// </summary>
-    public sealed class CompressingStoredFieldsIndexReader
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public sealed class CompressingStoredFieldsIndexReader // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         internal static long MoveLowOrderBitToSign(long n)
         {
diff --git a/src/Lucene.Net/Codecs/Compressing/Decompressor.cs b/src/Lucene.Net/Codecs/Compressing/Decompressor.cs
index 6637a42..a0e0d2e 100644
--- a/src/Lucene.Net/Codecs/Compressing/Decompressor.cs
+++ b/src/Lucene.Net/Codecs/Compressing/Decompressor.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using BytesRef = Lucene.Net.Util.BytesRef;
 
 namespace Lucene.Net.Codecs.Compressing
@@ -25,10 +25,7 @@ namespace Lucene.Net.Codecs.Compressing
     /// <summary>
     /// A decompressor.
     /// </summary>
-    public abstract class Decompressor
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public abstract class Decompressor // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Sole constructor, typically called from sub-classes. </summary>
diff --git a/src/Lucene.Net/Codecs/Lucene3x/Lucene3xStoredFieldsReader.cs b/src/Lucene.Net/Codecs/Lucene3x/Lucene3xStoredFieldsReader.cs
index 1f1f9af..1fd83ef 100644
--- a/src/Lucene.Net/Codecs/Lucene3x/Lucene3xStoredFieldsReader.cs
+++ b/src/Lucene.Net/Codecs/Lucene3x/Lucene3xStoredFieldsReader.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Diagnostics;
+using Lucene.Net.Diagnostics;
 using System;
 using System.Diagnostics;
 using System.IO;
@@ -43,10 +43,7 @@ namespace Lucene.Net.Codecs.Lucene3x
     /// It uses &lt;segment&gt;.fdt and &lt;segment&gt;.fdx; files.
     /// </summary>
     [Obsolete("Only for reading existing 3.x indexes")]
-    internal sealed class Lucene3xStoredFieldsReader : StoredFieldsReader, IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    internal sealed class Lucene3xStoredFieldsReader : StoredFieldsReader, IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private const int FORMAT_SIZE = 4;
 
diff --git a/src/Lucene.Net/Codecs/Lucene3x/SegmentTermEnum.cs b/src/Lucene.Net/Codecs/Lucene3x/SegmentTermEnum.cs
index 32884fe..936c928 100644
--- a/src/Lucene.Net/Codecs/Lucene3x/SegmentTermEnum.cs
+++ b/src/Lucene.Net/Codecs/Lucene3x/SegmentTermEnum.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Diagnostics;
+using Lucene.Net.Diagnostics;
 using System;
 using System.Diagnostics;
 using System.Runtime.CompilerServices;
@@ -32,10 +32,7 @@ namespace Lucene.Net.Codecs.Lucene3x
     /// @lucene.experimental
     /// </summary>
     [Obsolete("(4.0) No longer used with flex indexing, except for reading old segments")]
-    internal sealed class SegmentTermEnum : IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    internal sealed class SegmentTermEnum : IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private IndexInput input;
         internal FieldInfos fieldInfos;
diff --git a/src/Lucene.Net/Codecs/Lucene3x/TermBuffer.cs b/src/Lucene.Net/Codecs/Lucene3x/TermBuffer.cs
index 3c2bd8b..6cb96c2 100644
--- a/src/Lucene.Net/Codecs/Lucene3x/TermBuffer.cs
+++ b/src/Lucene.Net/Codecs/Lucene3x/TermBuffer.cs
@@ -1,4 +1,4 @@
-using J2N.Text;
+using J2N.Text;
 using Lucene.Net.Diagnostics;
 using Lucene.Net.Util;
 using System;
@@ -33,10 +33,7 @@ namespace Lucene.Net.Codecs.Lucene3x
     /// @lucene.experimental 
     /// </summary>
     [Obsolete("(4.0)")]
-    internal sealed class TermBuffer
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    internal sealed class TermBuffer // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private string field;
         private Term term; // cached
diff --git a/src/Lucene.Net/Codecs/Lucene40/BitVector.cs b/src/Lucene.Net/Codecs/Lucene40/BitVector.cs
index 1973cd2..e5114a1 100644
--- a/src/Lucene.Net/Codecs/Lucene40/BitVector.cs
+++ b/src/Lucene.Net/Codecs/Lucene40/BitVector.cs
@@ -48,10 +48,7 @@ namespace Lucene.Net.Codecs.Lucene40
     /// </summary>
     // pkg-private: if this thing is generally useful then it can go back in .util,
     // but the serialization must be here underneath the codec.
-    internal sealed class BitVector : IMutableBits
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    internal sealed class BitVector : IMutableBits // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private byte[] bits;
         private int size;
diff --git a/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsReader.cs b/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsReader.cs
index 0621eb4..04fec9f 100644
--- a/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsReader.cs
+++ b/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsReader.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Diagnostics;
+using Lucene.Net.Diagnostics;
 using System;
 using System.Diagnostics;
 using System.IO;
@@ -42,10 +42,7 @@ namespace Lucene.Net.Codecs.Lucene40
     /// @lucene.internal
     /// </summary>
     /// <seealso cref="Lucene40StoredFieldsFormat"/>
-    public sealed class Lucene40StoredFieldsReader : StoredFieldsReader // LUCENENET specific - removed IDisposable, it is already implemented in base class
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public sealed class Lucene40StoredFieldsReader : StoredFieldsReader // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private readonly FieldInfos fieldInfos;
 #pragma warning disable CA2213 // Disposable fields should be disposed
diff --git a/src/Lucene.Net/Codecs/StoredFieldsReader.cs b/src/Lucene.Net/Codecs/StoredFieldsReader.cs
index ffdc61b..4e3dce3 100644
--- a/src/Lucene.Net/Codecs/StoredFieldsReader.cs
+++ b/src/Lucene.Net/Codecs/StoredFieldsReader.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Codecs
 {
@@ -31,10 +31,7 @@ namespace Lucene.Net.Codecs
     /// <para/>
     /// @lucene.experimental
     /// </summary>
-    public abstract class StoredFieldsReader : IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class StoredFieldsReader : IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Sole constructor. (For invocation by subclass
diff --git a/src/Lucene.Net/Codecs/TermVectorsReader.cs b/src/Lucene.Net/Codecs/TermVectorsReader.cs
index b705354..b4cf924 100644
--- a/src/Lucene.Net/Codecs/TermVectorsReader.cs
+++ b/src/Lucene.Net/Codecs/TermVectorsReader.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Codecs
 {
@@ -28,10 +28,7 @@ namespace Lucene.Net.Codecs
     /// <para/>
     /// @lucene.experimental
     /// </summary>
-    public abstract class TermVectorsReader : IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class TermVectorsReader : IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Sole constructor. (For invocation by subclass
diff --git a/src/Lucene.Net/Index/DocumentsWriterPerThreadPool.cs b/src/Lucene.Net/Index/DocumentsWriterPerThreadPool.cs
index d20e69f..5cdd2f1 100644
--- a/src/Lucene.Net/Index/DocumentsWriterPerThreadPool.cs
+++ b/src/Lucene.Net/Index/DocumentsWriterPerThreadPool.cs
@@ -1,4 +1,4 @@
-// Lucene version compatibility level: 4.8.1
+// Lucene version compatibility level: 4.8.1
 using Lucene.Net.Diagnostics;
 using Lucene.Net.Support.Threading;
 using System;
@@ -40,10 +40,7 @@ namespace Lucene.Net.Index
     /// new <see cref="DocumentsWriterPerThread"/> instance.
     /// </summary>
 
-    internal sealed class DocumentsWriterPerThreadPool
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    internal sealed class DocumentsWriterPerThreadPool // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// <see cref="ThreadState"/> references and guards a
diff --git a/src/Lucene.Net/Index/FlushPolicy.cs b/src/Lucene.Net/Index/FlushPolicy.cs
index a7ad1e9..b8c157a 100644
--- a/src/Lucene.Net/Index/FlushPolicy.cs
+++ b/src/Lucene.Net/Index/FlushPolicy.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Diagnostics;
+using Lucene.Net.Diagnostics;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Index
@@ -51,10 +51,7 @@ namespace Lucene.Net.Index
     /// <seealso cref="DocumentsWriterFlushControl"/>
     /// <seealso cref="DocumentsWriterPerThread"/>
     /// <seealso cref="IndexWriterConfig.FlushPolicy"/>
-    internal abstract class FlushPolicy
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    internal abstract class FlushPolicy // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         protected LiveIndexWriterConfig m_indexWriterConfig;
         protected InfoStream m_infoStream;
diff --git a/src/Lucene.Net/Index/IMergeScheduler.cs b/src/Lucene.Net/Index/IMergeScheduler.cs
index fbf8c26..16eb28d 100644
--- a/src/Lucene.Net/Index/IMergeScheduler.cs
+++ b/src/Lucene.Net/Index/IMergeScheduler.cs
@@ -21,16 +21,11 @@ namespace Lucene.Net.Index
      */
 
     // LUCENENET specific
-    public interface IMergeScheduler : IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public interface IMergeScheduler : IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         [MethodImpl(MethodImplOptions.NoInlining)]
         void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound);
 
-#if !FEATURE_CLONEABLE
         object Clone();
-#endif
     }
 }
diff --git a/src/Lucene.Net/Index/IndexDeletionPolicy.cs b/src/Lucene.Net/Index/IndexDeletionPolicy.cs
index 6f5ed44..9b2e435 100644
--- a/src/Lucene.Net/Index/IndexDeletionPolicy.cs
+++ b/src/Lucene.Net/Index/IndexDeletionPolicy.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Index
@@ -52,10 +52,7 @@ namespace Lucene.Net.Index
     /// or <see cref="Store.Directory"/> instance.</para>
     /// </summary>
 
-    public abstract class IndexDeletionPolicy
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public abstract class IndexDeletionPolicy // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Sole constructor, typically called by sub-classes constructors. </summary>
diff --git a/src/Lucene.Net/Index/IndexWriterConfig.cs b/src/Lucene.Net/Index/IndexWriterConfig.cs
index ef33649..7264552 100644
--- a/src/Lucene.Net/Index/IndexWriterConfig.cs
+++ b/src/Lucene.Net/Index/IndexWriterConfig.cs
@@ -66,10 +66,7 @@ namespace Lucene.Net.Index
 #if FEATURE_SERIALIZABLE
     [Serializable]
 #endif
-    public sealed class IndexWriterConfig : LiveIndexWriterConfig
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public sealed class IndexWriterConfig : LiveIndexWriterConfig // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         // LUCENENET specific: De-nested OpenMode enum from this class to prevent naming conflict
 
diff --git a/src/Lucene.Net/Index/MergePolicy.cs b/src/Lucene.Net/Index/MergePolicy.cs
index 5625dd6..d3f1c6e 100644
--- a/src/Lucene.Net/Index/MergePolicy.cs
+++ b/src/Lucene.Net/Index/MergePolicy.cs
@@ -1,4 +1,4 @@
-using J2N.Collections.Generic.Extensions;
+using J2N.Collections.Generic.Extensions;
 using Lucene.Net.Diagnostics;
 using Lucene.Net.Util;
 using System;
@@ -64,10 +64,7 @@ namespace Lucene.Net.Index
     ///
     /// @lucene.experimental
     /// </summary>
-    public abstract class MergePolicy : IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class MergePolicy : IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// A map of doc IDs. </summary>
diff --git a/src/Lucene.Net/Index/MergeScheduler.cs b/src/Lucene.Net/Index/MergeScheduler.cs
index c216c9c..694111e 100644
--- a/src/Lucene.Net/Index/MergeScheduler.cs
+++ b/src/Lucene.Net/Index/MergeScheduler.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
@@ -30,10 +30,7 @@ namespace Lucene.Net.Index
     /// instance.</para>
     /// @lucene.experimental
     /// </summary>
-    public abstract class MergeScheduler : IDisposable, IMergeScheduler
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class MergeScheduler : IDisposable, IMergeScheduler // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Sole constructor. (For invocation by subclass
diff --git a/src/Lucene.Net/Index/SegmentInfos.cs b/src/Lucene.Net/Index/SegmentInfos.cs
index 2cea568..90cf8a0 100644
--- a/src/Lucene.Net/Index/SegmentInfos.cs
+++ b/src/Lucene.Net/Index/SegmentInfos.cs
@@ -113,10 +113,7 @@ namespace Lucene.Net.Index
     /// @lucene.experimental
     /// </summary>
 
-    public sealed class SegmentInfos : IEnumerable<SegmentCommitInfo>
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public sealed class SegmentInfos : IEnumerable<SegmentCommitInfo> // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// The file format version for the segments_N codec header, up to 4.5. </summary>
diff --git a/src/Lucene.Net/Index/TermState.cs b/src/Lucene.Net/Index/TermState.cs
index d1b4e26..0d33bbe 100644
--- a/src/Lucene.Net/Index/TermState.cs
+++ b/src/Lucene.Net/Index/TermState.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Index
 {
@@ -27,10 +27,7 @@ namespace Lucene.Net.Index
     /// </summary>
     /// <seealso cref="TermsEnum.SeekExact(Lucene.Net.Util.BytesRef, TermState)"/>
     /// <seealso cref="TermsEnum.GetTermState()"/>
-    public abstract class TermState
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public abstract class TermState // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Sole constructor. (For invocation by subclass
diff --git a/src/Lucene.Net/Search/Query.cs b/src/Lucene.Net/Search/Query.cs
index 26e86f4..f19fb02 100644
--- a/src/Lucene.Net/Search/Query.cs
+++ b/src/Lucene.Net/Search/Query.cs
@@ -47,10 +47,7 @@ namespace Lucene.Net.Search
 #if FEATURE_SERIALIZABLE
     [Serializable]
 #endif
-    public abstract class Query
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public abstract class Query // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         // LUCENENET NOTE: We can't set the default boost in the constructor because the
         // Boost property can be overridden by subclasses (and possibly throw exceptions).
diff --git a/src/Lucene.Net/Search/Spans/SpanNearQuery.cs b/src/Lucene.Net/Search/Spans/SpanNearQuery.cs
index f244154..2205a95 100644
--- a/src/Lucene.Net/Search/Spans/SpanNearQuery.cs
+++ b/src/Lucene.Net/Search/Spans/SpanNearQuery.cs
@@ -36,10 +36,7 @@ namespace Lucene.Net.Search.Spans
     /// maximum number of intervening unmatched positions, as well as whether
     /// matches are required to be in-order.
     /// </summary>
-    public class SpanNearQuery : SpanQuery
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class SpanNearQuery : SpanQuery // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         protected readonly IList<SpanQuery> m_clauses;
         protected int m_slop;
diff --git a/src/Lucene.Net/Search/Spans/SpanNotQuery.cs b/src/Lucene.Net/Search/Spans/SpanNotQuery.cs
index 06b5bd6..84178f3 100644
--- a/src/Lucene.Net/Search/Spans/SpanNotQuery.cs
+++ b/src/Lucene.Net/Search/Spans/SpanNotQuery.cs
@@ -1,4 +1,4 @@
-using J2N.Numerics;
+using J2N.Numerics;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -33,10 +33,7 @@ namespace Lucene.Net.Search.Spans
     /// Removes matches which overlap with another <see cref="SpanQuery"/> or
     /// within a x tokens before or y tokens after another <see cref="SpanQuery"/>.
     /// </summary>
-    public class SpanNotQuery : SpanQuery
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class SpanNotQuery : SpanQuery // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private SpanQuery include;
         private SpanQuery exclude;
diff --git a/src/Lucene.Net/Search/Spans/SpanOrQuery.cs b/src/Lucene.Net/Search/Spans/SpanOrQuery.cs
index aa6cad5..b872d3a 100644
--- a/src/Lucene.Net/Search/Spans/SpanOrQuery.cs
+++ b/src/Lucene.Net/Search/Spans/SpanOrQuery.cs
@@ -33,10 +33,7 @@ namespace Lucene.Net.Search.Spans
 
     /// <summary>
     /// Matches the union of its clauses. </summary>
-    public class SpanOrQuery : SpanQuery
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class SpanOrQuery : SpanQuery // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private readonly IList<SpanQuery> clauses;
         private string field;
diff --git a/src/Lucene.Net/Search/Spans/SpanPositionCheckQuery.cs b/src/Lucene.Net/Search/Spans/SpanPositionCheckQuery.cs
index 791c709..ecb9b7d 100644
--- a/src/Lucene.Net/Search/Spans/SpanPositionCheckQuery.cs
+++ b/src/Lucene.Net/Search/Spans/SpanPositionCheckQuery.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Search.Spans
@@ -29,10 +29,7 @@ namespace Lucene.Net.Search.Spans
     /// <summary>
     /// Base class for filtering a <see cref="SpanQuery"/> based on the position of a match.
     /// </summary>
-    public abstract class SpanPositionCheckQuery : SpanQuery
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class SpanPositionCheckQuery : SpanQuery // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         protected SpanQuery m_match;
 
diff --git a/src/Lucene.Net/Store/DataInput.cs b/src/Lucene.Net/Store/DataInput.cs
index 4609c9a..258ed5e 100644
--- a/src/Lucene.Net/Store/DataInput.cs
+++ b/src/Lucene.Net/Store/DataInput.cs
@@ -35,10 +35,7 @@ namespace Lucene.Net.Store
     /// returning a new <see cref="DataInput"/> which operates on the same underlying
     /// resource, but positioned independently.
     /// </summary>
-    public abstract class DataInput
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public abstract class DataInput // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private const int SKIP_BUFFER_SIZE = 1024;
 
diff --git a/src/Lucene.Net/Store/IndexInput.cs b/src/Lucene.Net/Store/IndexInput.cs
index 80133b0..a120138 100644
--- a/src/Lucene.Net/Store/IndexInput.cs
+++ b/src/Lucene.Net/Store/IndexInput.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Lucene.Net.Store
 {
@@ -34,10 +34,7 @@ namespace Lucene.Net.Store
     /// <see cref="ObjectDisposedException"/> when the original one is closed.
     /// </summary>
     /// <seealso cref="Directory"/>
-    public abstract class IndexInput : DataInput, IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class IndexInput : DataInput, IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         private readonly string resourceDescription;
 
diff --git a/src/Lucene.Net/Store/RAMInputStream.cs b/src/Lucene.Net/Store/RAMInputStream.cs
index 7ac4ce3..3d72de0 100644
--- a/src/Lucene.Net/Store/RAMInputStream.cs
+++ b/src/Lucene.Net/Store/RAMInputStream.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.IO;
 
 namespace Lucene.Net.Store
@@ -25,10 +25,7 @@ namespace Lucene.Net.Store
     /// <para/>
     /// @lucene.internal
     /// </summary>
-    public class RAMInputStream : IndexInput
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class RAMInputStream : IndexInput // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         internal const int BUFFER_SIZE = RAMOutputStream.BUFFER_SIZE;
 
diff --git a/src/Lucene.Net/Util/AttributeImpl.cs b/src/Lucene.Net/Util/AttributeImpl.cs
index 9dce417..a5cca7e 100644
--- a/src/Lucene.Net/Util/AttributeImpl.cs
+++ b/src/Lucene.Net/Util/AttributeImpl.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Reflection;
 using System.Runtime.CompilerServices;
@@ -29,10 +29,7 @@ namespace Lucene.Net.Util
     /// Attributes are used to add data in a dynamic, yet type-safe way to a source
     /// of usually streamed objects, e. g. a <see cref="Lucene.Net.Analysis.TokenStream" />.
     /// </summary>
-    public abstract class Attribute : IAttribute
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public abstract class Attribute : IAttribute // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary> Clears the values in this <see cref="Attribute"/> and resets it to its
         /// default value. If this implementation implements more than one <see cref="Attribute"/> interface
diff --git a/src/Lucene.Net/Util/AttributeSource.cs b/src/Lucene.Net/Util/AttributeSource.cs
index 1abe421..91fb3f8 100644
--- a/src/Lucene.Net/Util/AttributeSource.cs
+++ b/src/Lucene.Net/Util/AttributeSource.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Analysis.TokenAttributes;
+using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Diagnostics;
 using Lucene.Net.Support;
 using System;
@@ -165,10 +165,7 @@ namespace Lucene.Net.Util
         /// This class holds the state of an <see cref="AttributeSource"/>. </summary>
         /// <seealso cref="CaptureState()"/>
         /// <seealso cref="RestoreState(State)"/>
-        public sealed class State
-#if FEATURE_CLONEABLE
-            : System.ICloneable
-#endif
+        public sealed class State // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
         {
             internal Attribute attribute;
             internal State next;
diff --git a/src/Lucene.Net/Util/Automaton/Automaton.cs b/src/Lucene.Net/Util/Automaton/Automaton.cs
index cd258ee..2842cc2 100644
--- a/src/Lucene.Net/Util/Automaton/Automaton.cs
+++ b/src/Lucene.Net/Util/Automaton/Automaton.cs
@@ -1,4 +1,4 @@
-using J2N;
+using J2N;
 using J2N.Collections.Generic.Extensions;
 using Lucene.Net.Diagnostics;
 using System;
@@ -71,10 +71,7 @@ namespace Lucene.Net.Util.Automaton
     /// </para>
     /// @lucene.experimental
     /// </summary>
-    public class Automaton
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public class Automaton // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Minimize using Hopcroft's O(n log n) algorithm. this is regarded as one of
diff --git a/src/Lucene.Net/Util/Automaton/Transition.cs b/src/Lucene.Net/Util/Automaton/Transition.cs
index de719e7..0623b73 100644
--- a/src/Lucene.Net/Util/Automaton/Transition.cs
+++ b/src/Lucene.Net/Util/Automaton/Transition.cs
@@ -1,4 +1,4 @@
-using J2N.Text;
+using J2N.Text;
 using Lucene.Net.Diagnostics;
 using System.Collections.Generic;
 using System.Globalization;
@@ -44,10 +44,7 @@ namespace Lucene.Net.Util.Automaton
     /// <para/>
     /// @lucene.experimental
     /// </summary>
-    public class Transition
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public class Transition // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /*
          * CLASS INVARIANT: min<=max
diff --git a/src/Lucene.Net/Util/BytesRef.cs b/src/Lucene.Net/Util/BytesRef.cs
index cb97622..61ad2ce 100644
--- a/src/Lucene.Net/Util/BytesRef.cs
+++ b/src/Lucene.Net/Util/BytesRef.cs
@@ -1,4 +1,4 @@
-using J2N.Text;
+using J2N.Text;
 using Lucene.Net.Diagnostics;
 using Lucene.Net.Support;
 using System;
@@ -42,10 +42,8 @@ namespace Lucene.Net.Util
 #if FEATURE_SERIALIZABLE
     [Serializable]
 #endif
+    // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     public sealed class BytesRef : IComparable<BytesRef>, IComparable, IEquatable<BytesRef> // LUCENENET specific - implemented IComparable for FieldComparator, IEquatable<BytesRef>
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
     {
         /// <summary>
         /// An empty byte array for convenience </summary>
diff --git a/src/Lucene.Net/Util/CharsRef.cs b/src/Lucene.Net/Util/CharsRef.cs
index a8eb3d0..2b73ea9 100644
--- a/src/Lucene.Net/Util/CharsRef.cs
+++ b/src/Lucene.Net/Util/CharsRef.cs
@@ -1,4 +1,4 @@
-using J2N.Text;
+using J2N.Text;
 using Lucene.Net.Diagnostics;
 using Lucene.Net.Support;
 using System;
@@ -36,10 +36,8 @@ namespace Lucene.Net.Util
 #if FEATURE_SERIALIZABLE
     [Serializable]
 #endif
+    // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     public sealed class CharsRef : IComparable<CharsRef>, ICharSequence, IEquatable<CharsRef> // LUCENENET specific - implemented IEquatable<CharsRef>
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
     {
         /// <summary>
         /// An empty character array for convenience </summary>
diff --git a/src/Lucene.Net/Util/InfoStream.cs b/src/Lucene.Net/Util/InfoStream.cs
index 30e8014..eff6c14 100644
--- a/src/Lucene.Net/Util/InfoStream.cs
+++ b/src/Lucene.Net/Util/InfoStream.cs
@@ -29,10 +29,7 @@ namespace Lucene.Net.Util
     /// </para>
     /// @lucene.internal
     /// </summary>
-    public abstract class InfoStream : IDisposable
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public abstract class InfoStream : IDisposable // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// Instance of <see cref="InfoStream"/> that does no logging at all. </summary>
diff --git a/src/Lucene.Net/Util/IntsRef.cs b/src/Lucene.Net/Util/IntsRef.cs
index 76b47dc..03e820a 100644
--- a/src/Lucene.Net/Util/IntsRef.cs
+++ b/src/Lucene.Net/Util/IntsRef.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Diagnostics;
+using Lucene.Net.Diagnostics;
 using Lucene.Net.Support;
 using System;
 using System.Diagnostics.CodeAnalysis;
@@ -36,10 +36,7 @@ namespace Lucene.Net.Util
 #if FEATURE_SERIALIZABLE
     [Serializable]
 #endif
-    public sealed class Int32sRef : IComparable<Int32sRef>
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public sealed class Int32sRef : IComparable<Int32sRef> // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// An empty integer array for convenience.
diff --git a/src/Lucene.Net/Util/LongsRef.cs b/src/Lucene.Net/Util/LongsRef.cs
index 03443bc..9dc0f19 100644
--- a/src/Lucene.Net/Util/LongsRef.cs
+++ b/src/Lucene.Net/Util/LongsRef.cs
@@ -37,10 +37,7 @@ namespace Lucene.Net.Util
 #if FEATURE_SERIALIZABLE
     [Serializable]
 #endif
-    public sealed class Int64sRef : IComparable<Int64sRef>
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public sealed class Int64sRef : IComparable<Int64sRef> // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         /// <summary>
         /// An empty <see cref="long"/> array for convenience
diff --git a/src/Lucene.Net/Util/OpenBitSet.cs b/src/Lucene.Net/Util/OpenBitSet.cs
index de94d41..fe17a3b 100644
--- a/src/Lucene.Net/Util/OpenBitSet.cs
+++ b/src/Lucene.Net/Util/OpenBitSet.cs
@@ -79,10 +79,7 @@ namespace Lucene.Net.Util
     ///     </item>
     /// </list>
     /// </summary>
-    public class OpenBitSet : DocIdSet, IBits
-#if FEATURE_CLONEABLE
-        , System.ICloneable
-#endif
+    public class OpenBitSet : DocIdSet, IBits // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
     {
         protected internal long[] m_bits;
         protected internal int m_wlen; // number of words (elements) used in the array
diff --git a/src/Lucene.Net/Util/SetOnce.cs b/src/Lucene.Net/Util/SetOnce.cs
index 1c7bcb1..a9cd25b 100644
--- a/src/Lucene.Net/Util/SetOnce.cs
+++ b/src/Lucene.Net/Util/SetOnce.cs
@@ -1,4 +1,4 @@
-using J2N.Threading.Atomic;
+using J2N.Threading.Atomic;
 using System;
 using System.Runtime.CompilerServices;
 #if FEATURE_SERIALIZABLE_EXCEPTIONS
@@ -33,10 +33,7 @@ namespace Lucene.Net.Util
     /// <para/>
     /// @lucene.experimental
     /// </summary>
-    public sealed class SetOnce<T>
-#if FEATURE_CLONEABLE
-        : System.ICloneable
-#endif
+    public sealed class SetOnce<T> // LUCENENET specific: Not implementing ICloneable per Microsoft's recommendation
         where T : class // LUCENENET specific - added class constraint so we don't accept value types (which cannot be volatile)
     {
         private volatile T obj = default;