lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r836303 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/Search/ Test/QueryParser/ Test/Search/
Date Sun, 15 Nov 2009 00:56:58 GMT
Author: aroush
Date: Sun Nov 15 00:56:57 2009
New Revision: 836303

URL: http://svn.apache.org/viewvc?rev=836303&view=rev
Log:
Patch of LUCENENET-245: fixes issues with Queries which is mainly the removal of unnecessary
Clone() methods.

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/DisjunctionMaxQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FilteredQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MatchAllDocsQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/RangeQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs
    incubator/lucene.net/trunk/C#/src/Test/QueryParser/TestMultiAnalyzer.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/JustCompileSearch.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanPrefixQuery.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanScorer.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestCustomSearcherSort.cs
    incubator/lucene.net/trunk/C#/src/Test/Search/TestDisjunctionMaxQuery.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/DisjunctionMaxQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/DisjunctionMaxQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/DisjunctionMaxQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/DisjunctionMaxQuery.cs Sun Nov 15
00:56:57 2009
@@ -259,7 +259,6 @@
 		public override System.Object Clone()
 		{
 			DisjunctionMaxQuery clone = (DisjunctionMaxQuery) base.Clone();
-			clone.disjuncts = (System.Collections.ArrayList) this.disjuncts.Clone();
 			return clone;
 		}
 		

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FilteredQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/FilteredQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FilteredQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FilteredQuery.cs Sun Nov 15 00:56:57
2009
@@ -328,11 +328,5 @@
 		{
 			return query.GetHashCode() ^ filter.GetHashCode() + System.Convert.ToInt32(GetBoost());
 		}
-		
-		override public System.Object Clone()
-		{
-            System.Diagnostics.Debug.Fail("Port issue:", "Lets see if we need this FilteredQuery.Clone()");
// {{Aroush-2.9}}
-			return null;
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MatchAllDocsQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/MatchAllDocsQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MatchAllDocsQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MatchAllDocsQuery.cs Sun Nov 15 00:56:57
2009
@@ -220,11 +220,5 @@
 		{
 			return BitConverter.ToInt32(BitConverter.GetBytes(GetBoost()), 0) ^ 0x1AA71190;
 		}
-		
-		override public System.Object Clone()
-		{
-            System.Diagnostics.Debug.Fail("Port issue:", "Do we need this clone?"); // {{Aroush-.29}}
-			return null;
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/MultiPhraseQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs Sun Nov 15 00:56:57
2009
@@ -447,12 +447,6 @@
 			}
 			return true;
 		}
-		
-		override public System.Object Clone()
-		{
-            System.Diagnostics.Debug.Fail("Port issue:", "do we need to implement 'Clone'?");
  // {{Aroush-2.9}}
-			return null;
-		}
 
         public static bool TermEquals(System.Array array1, System.Array array2)
         {

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/PhraseQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs Sun Nov 15 00:56:57
2009
@@ -364,11 +364,5 @@
 		{
 			return BitConverter.ToInt32(BitConverter.GetBytes(GetBoost()), 0) ^ slop ^ terms.GetHashCode()
^ positions.GetHashCode();
 		}
-		
-		override public System.Object Clone()
-		{
-            System.Diagnostics.Debug.Fail("Port issue:", "Do we need this Clone()?");   //
{{Aroush-2.9}}
-			return null;
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/RangeQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/RangeQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/RangeQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/RangeQuery.cs Sun Nov 15 00:56:57
2009
@@ -167,11 +167,5 @@
 		{
 			return delegate_Renamed.GetHashCode();
 		}
-		
-		override public System.Object Clone()
-		{
-            System.Diagnostics.Debug.Fail("Port issue:", "Lets see if we need this"); //
{{Aroush-2.9}}
-			return null;
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/TermQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs Sun Nov 15 00:56:57 2009
@@ -209,11 +209,5 @@
 		{
 			return BitConverter.ToInt32(BitConverter.GetBytes(GetBoost()), 0) ^ term.GetHashCode();
         }
-		
-		override public System.Object Clone()
-		{
-            System.Diagnostics.Debug.Fail("Port issue:", "Do we need this?");   // {{Aroush-2.9}}
-			return null;
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Test/QueryParser/TestMultiAnalyzer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/QueryParser/TestMultiAnalyzer.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/QueryParser/TestMultiAnalyzer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/QueryParser/TestMultiAnalyzer.cs Sun Nov 15 00:56:57
2009
@@ -347,11 +347,6 @@
 			{
 				return q.ToString(f);
 			}
-			override public System.Object Clone()
-			{
-                System.Diagnostics.Debug.Fail("Port issue:", "Do we need TestMultiAnalyzer.DumbQueryWrapper.Clone()?");
-				return null;
-			}
 		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/JustCompileSearch.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/JustCompileSearch.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/JustCompileSearch.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/JustCompileSearch.cs Sun Nov 15 00:56:57
2009
@@ -365,10 +365,6 @@
 			{
 				throw new System.NotSupportedException(Lucene.Net.Search.JustCompileSearch.UNSUPPORTED_MSG);
 			}
-			override public System.Object Clone()
-			{
-				return null;
-			}
 		}
 		
 		internal sealed class JustCompileScorer:Scorer

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/QueryUtils.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs Sun Nov 15 00:56:57 2009
@@ -42,11 +42,6 @@
 			{
 				return "My Whacky Query";
 			}
-			override public System.Object Clone()
-			{
-                System.Diagnostics.Debug.Fail("Port issue:", "Do we need QueryUtils.AnonymousClassQuery.Clone()?");
-				return null;
-			}
 		}
 		private class AnonymousClassCollector:Collector
 		{

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanPrefixQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBooleanPrefixQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanPrefixQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanPrefixQuery.cs Sun Nov 15 00:56:57
2009
@@ -40,20 +40,20 @@
 	public class TestBooleanPrefixQuery:LuceneTestCase
 	{
 		
-		[STAThread]
+		/*[STAThread]
 		public static void  Main(System.String[] args)
 		{
 			// TestRunner.run(suite()); // {{Aroush-2.9}} how is this done in NUnit?
-		}
+		}*/
 		
 		/*public static Test suite()
 		{
 			return new TestSuite(typeof(TestBooleanPrefixQuery));
 		}*/
 		
-		public TestBooleanPrefixQuery(System.String name):base(name)
+		/*public TestBooleanPrefixQuery(System.String name):base(name)
 		{
-		}
+		}*/
 		
 		private int GetCount(IndexReader r, Query q)
 		{

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBooleanScorer.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanScorer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanScorer.cs Sun Nov 15 00:56:57
2009
@@ -99,9 +99,9 @@
 			}
 		}
 		
-		public TestBooleanScorer(System.String name):base(name)
+		/*public TestBooleanScorer(System.String name):base(name)
 		{
-		}
+		}*/
 		
 		private const System.String FIELD = "category";
 		

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestCustomSearcherSort.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestCustomSearcherSort.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestCustomSearcherSort.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestCustomSearcherSort.cs Sun Nov 15 00:56:57
2009
@@ -47,15 +47,15 @@
 		// reduced from 20000 to 2000 to speed up test...
 		private const int INDEX_SIZE = 2000;
 		
-		public TestCustomSearcherSort(System.String name):base(name)
+		/*public TestCustomSearcherSort(System.String name):base(name)
 		{
-		}
+		}*/
 		
-		[STAThread]
+		/*[STAThread]
 		public static void  Main(System.String[] argv)
 		{
 			// TestRunner.run(suite()); // {{Aroush-2.9}} how is this done in NUnit?
-		}
+		}*/
 		
 		/*public static Test suite()
 		{
@@ -304,7 +304,7 @@
 			// Just to generate some different Lucene Date strings
 			public /*private*/ System.String GetLuceneDate()
 			{
-                return DateTools.TimeToString(base_Renamed.Millisecond + random.Next() -
System.Int32.MinValue, DateTools.Resolution.DAY);
+                return DateTools.TimeToString((base_Renamed.Ticks / TimeSpan.TicksPerMillisecond)
+ random.Next() - System.Int32.MinValue, DateTools.Resolution.DAY);
 			}
 		}
 	}

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestDisjunctionMaxQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestDisjunctionMaxQuery.cs?rev=836303&r1=836302&r2=836303&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestDisjunctionMaxQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestDisjunctionMaxQuery.cs Sun Nov 15 00:56:57
2009
@@ -277,7 +277,7 @@
 			try
 			{
 				Assert.AreEqual(3, h.Length, "3 docs should match " + q.ToString());
-				Assert.AreEqual(s.Doc(h[0].doc).Get("id"), "wrong first", "d2");
+				Assert.AreEqual(s.Doc(h[0].doc).Get("id"), "d2", "wrong first");
 				float score0 = h[0].score;
 				float score1 = h[1].score;
 				float score2 = h[2].score;



Mime
View raw message