Lucene.Net.Analysis.Common.Analysis.Util.BufferedCharFilter: Eliminated 
compiler warning by removing unused isDisposing field in .NET Standard


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/bb9ae7ad
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/bb9ae7ad
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/bb9ae7ad

Branch: refs/heads/api-work
Commit: bb9ae7adcec661be833f08762a806d5f7b61510f
Parents: 0916968
Author: Shad Storhaug <[email protected]>
Authored: Sun Apr 16 00:28:57 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Sun Apr 16 00:28:57 2017 +0700

----------------------------------------------------------------------
 .../Analysis/Util/BufferedCharFilter.cs          | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bb9ae7ad/src/Lucene.Net.Analysis.Common/Analysis/Util/BufferedCharFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/BufferedCharFilter.cs 
b/src/Lucene.Net.Analysis.Common/Analysis/Util/BufferedCharFilter.cs
index c6103f3..4371faf 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/BufferedCharFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/BufferedCharFilter.cs
@@ -39,10 +39,12 @@ namespace Lucene.Net.Analysis.Util
         internal static int defaultCharBufferSize = 8192;
         private static int defaultExpectedLineLength = 80;
 
+#if !NETSTANDARD
         /// <summary>
         /// LUCENENET specific to throw an exception if the user calls <see 
cref="Close()"/> instead of <see cref="TextReader.Dispose()"/>
         /// </summary>
         private bool isDisposing = false;
+#endif
 
         /// <summary>
         /// Creates a buffering character-input stream that uses an input 
buffer of the specified size.
@@ -430,20 +432,25 @@ namespace Lucene.Net.Analysis.Util
         {
             if (disposing)
             {
+#if !NETSTANDARD
                 this.isDisposing = true;
+#endif
                 lock (this)
                 {
-                    if (@in == null)
-                        return;
-                    @in.Dispose();
-                    @in = null;
+                    if (@in != null)
+                    {
+                        @in.Dispose();
+                        @in = null;
+                    }
                     cb = null;
                 }
+#if !NETSTANDARD
                 this.isDisposing = false;
+#endif
             }
         }
 
-        #region LUCENENET Specific Methods
+#region LUCENENET Specific Methods
 
         public override int Peek()
         {
@@ -495,6 +502,6 @@ namespace Lucene.Net.Analysis.Util
             throw new NotImplementedException();
         }
 #endif
-        #endregion
+#endregion
     }
 }

Reply via email to