lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject svn commit: r1375296 - in /incubator/lucene.net/trunk: src/core/Lucene.Net.csproj src/core/Search/BooleanClause.cs src/core/Util/Parameter.cs test/core/Lucene.Net.Test.csproj
Date Mon, 20 Aug 2012 23:00:06 GMT
Author: synhershko
Date: Mon Aug 20 23:00:06 2012
New Revision: 1375296

URL: http://svn.apache.org/viewvc?rev=1375296&view=rev
Log:
Completely fixing race condition with Occur

Removed:
    incubator/lucene.net/trunk/src/core/Util/Parameter.cs
Modified:
    incubator/lucene.net/trunk/src/core/Lucene.Net.csproj
    incubator/lucene.net/trunk/src/core/Search/BooleanClause.cs
    incubator/lucene.net/trunk/test/core/Lucene.Net.Test.csproj

Modified: incubator/lucene.net/trunk/src/core/Lucene.Net.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Lucene.Net.csproj?rev=1375296&r1=1375295&r2=1375296&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Lucene.Net.csproj (original)
+++ incubator/lucene.net/trunk/src/core/Lucene.Net.csproj Mon Aug 20 23:00:06 2012
@@ -923,9 +923,6 @@
     <Compile Include="Util\OpenBitSet.cs" />
     <Compile Include="Util\OpenBitSetDISI.cs" />
     <Compile Include="Util\OpenBitSetIterator.cs" />
-    <Compile Include="Util\Parameter.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="Util\PriorityQueue.cs">
       <SubType>Code</SubType>
     </Compile>

Modified: incubator/lucene.net/trunk/src/core/Search/BooleanClause.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/BooleanClause.cs?rev=1375296&r1=1375295&r2=1375296&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/BooleanClause.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/BooleanClause.cs Mon Aug 20 23:00:06 2012
@@ -17,8 +17,6 @@
 
 using System;
 
-using Parameter = Lucene.Net.Util.Parameter;
-
 namespace Lucene.Net.Search
 {
 	
@@ -83,39 +81,22 @@ namespace Lucene.Net.Search
 		}
 	}
 
-    /// <summary>Specifies how clauses are to occur in matching documents. </summary>
-    [Serializable]
-    public sealed class Occur : Parameter
-    {
-        internal Occur(System.String name)
-            : base(name)
-        {
-        }
-
-        public override System.String ToString()
-        {
-            if (this == MUST)
-                return "+";
-            if (this == MUST_NOT)
-                return "-";
-            return "";
-        }
-
-        /// <summary>Use this operator for clauses that <i>must</i> appear
in the matching documents. </summary>
-        public static readonly Occur MUST = new Occur("MUST");
-
-        /// <summary>Use this operator for clauses that <i>should</i> appear
in the 
-        /// matching documents. For a BooleanQuery with no <c>MUST</c> 
-        /// clauses one or more <c>SHOULD</c> clauses must match a document 
-        /// for the BooleanQuery to match.
-        /// </summary>
-        /// <seealso cref="BooleanQuery.MinimumNumberShouldMatch" />
-        public static readonly Occur SHOULD = new Occur("SHOULD");
-
-        /// <summary>Use this operator for clauses that <i>must not</i>
appear in the matching documents.
-        /// Note that it is not possible to search for queries that only consist
-        /// of a <c>MUST_NOT</c> clause. 
-        /// </summary>
-        public static readonly Occur MUST_NOT = new Occur("MUST_NOT");
-    }
+	public enum Occur
+	{
+		MUST,
+		SHOULD,
+		MUST_NOT
+	}
+
+	public static class OccurExtensions
+	{
+		public static System.String ToString(this Occur occur)
+		{
+			if (occur == Occur.MUST)
+				return "+";
+			if (occur == Occur.MUST_NOT)
+				return "-";
+			return "";
+		}
+	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/test/core/Lucene.Net.Test.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Lucene.Net.Test.csproj?rev=1375296&r1=1375295&r2=1375296&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Lucene.Net.Test.csproj (original)
+++ incubator/lucene.net/trunk/test/core/Lucene.Net.Test.csproj Mon Aug 20 23:00:06 2012
@@ -548,7 +548,6 @@
     <Compile Include="Util\TestIndexableBinaryStringTools.cs" />
     <Compile Include="Util\TestNumericUtils.cs" />
     <Compile Include="Util\TestOpenBitSet.cs" />
-    <Compile Include="Util\TestParameter.cs" />
     <Compile Include="Util\TestPriorityQueue.cs">
       <SubType>Code</SubType>
     </Compile>



Mime
View raw message