lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/6] lucenenet git commit: More compilation fixes
Date Fri, 07 Nov 2014 05:39:13 GMT
More compilation fixes


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

Branch: refs/heads/master
Commit: 4c206612581afeb28497cb201c28a81589733da4
Parents: f52cf1a
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Fri Nov 7 07:11:07 2014 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Fri Nov 7 07:11:07 2014 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Support/IdentityComparer.cs     | 16 +++++++++++++++-
 src/Lucene.Net.Queries/BoostingQuery.cs             |  2 +-
 src/Lucene.Net.Queries/CustomScoreQuery.cs          |  8 ++++----
 src/Lucene.Net.Queries/Function/BoostedQuery.cs     |  4 ++--
 src/Lucene.Net.Queries/Function/ValueSource.cs      |  7 ++++---
 .../Function/ValueSources/EnumFieldSource.cs        |  4 ++--
 6 files changed, 28 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4c206612/src/Lucene.Net.Core/Support/IdentityComparer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/IdentityComparer.cs b/src/Lucene.Net.Core/Support/IdentityComparer.cs
index ae71e06..27d6798 100644
--- a/src/Lucene.Net.Core/Support/IdentityComparer.cs
+++ b/src/Lucene.Net.Core/Support/IdentityComparer.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System.Collections;
+using System.Collections.Generic;
 using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Support
@@ -15,4 +16,17 @@ namespace Lucene.Net.Support
             return RuntimeHelpers.GetHashCode(obj);
         }
     }
+
+    public class IdentityComparer : IEqualityComparer
+    {
+        public new bool Equals(object x, object y)
+        {
+            return ReferenceEquals(x, y);
+        }
+
+        public int GetHashCode(object obj)
+        {
+            return RuntimeHelpers.GetHashCode(obj);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4c206612/src/Lucene.Net.Queries/BoostingQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/BoostingQuery.cs b/src/Lucene.Net.Queries/BoostingQuery.cs
index bf0e762..125deed 100644
--- a/src/Lucene.Net.Queries/BoostingQuery.cs
+++ b/src/Lucene.Net.Queries/BoostingQuery.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Queries
                 private readonly BooleanQueryAnonymousInnerClassHelper outerInstance;
 
                 public BooleanWeightAnonymousInnerClassHelper(BooleanQueryAnonymousInnerClassHelper
outerInstance, IndexSearcher searcher)
-                    : base(searcher, false)
+                    : base(outerInstance, searcher, false)
                 {
                     this.outerInstance = outerInstance;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4c206612/src/Lucene.Net.Queries/CustomScoreQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/CustomScoreQuery.cs b/src/Lucene.Net.Queries/CustomScoreQuery.cs
index 00522c3..8ac3636 100644
--- a/src/Lucene.Net.Queries/CustomScoreQuery.cs
+++ b/src/Lucene.Net.Queries/CustomScoreQuery.cs
@@ -397,10 +397,10 @@ namespace Lucene.Net.Queries
                 }
             }
 
-            public override Weight CreateWeight(IndexSearcher searcher)
-            {
-                return new CustomWeight(this, searcher);
-            }
+//            public override Weight CreateWeight(IndexSearcher searcher)
+//            {                
+//                return new CustomWeight(this, searcher);
+//            }
 
             /// <summary>
             /// Checks if this is strict custom scoring.

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4c206612/src/Lucene.Net.Queries/Function/BoostedQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/BoostedQuery.cs b/src/Lucene.Net.Queries/Function/BoostedQuery.cs
index db52a35..95343b2 100644
--- a/src/Lucene.Net.Queries/Function/BoostedQuery.cs
+++ b/src/Lucene.Net.Queries/Function/BoostedQuery.cs
@@ -84,7 +84,7 @@ namespace Lucene.Net.Queries.Function
             private readonly BoostedQuery outerInstance;
 
             private readonly IndexSearcher searcher;
-            private readonly Weight qWeight;
+            internal readonly Weight qWeight;
             internal readonly IDictionary fcontext;
 
             public BoostedWeight(BoostedQuery outerInstance, IndexSearcher searcher)
@@ -208,7 +208,7 @@ namespace Lucene.Net.Queries.Function
 
             public virtual Explanation Explain(int doc)
             {
-                Explanation subQueryExpl = weight.qWeight.Explain(readerContext, doc);
+                var subQueryExpl = weight.qWeight.Explain(readerContext, doc);
                 if (!subQueryExpl.IsMatch)
                 {
                     return subQueryExpl;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4c206612/src/Lucene.Net.Queries/Function/ValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSource.cs
index 85a85c3..70e8562 100644
--- a/src/Lucene.Net.Queries/Function/ValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSource.cs
@@ -1,4 +1,5 @@
-using System.Collections;
+using System;
+using System.Collections;
 using System.Collections.Generic;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
@@ -66,9 +67,9 @@ namespace Lucene.Net.Queries.Function
         /// <summary>
         /// Returns a new non-threadsafe context map.
         /// </summary>
-        public static IDictionary<string, IndexSearcher> NewContext(IndexSearcher searcher)
+        public static IDictionary NewContext(IndexSearcher searcher)
         {
-            var context = new IdentityHashMap<string, IndexSearcher>();
+            var context = new Hashtable(new IdentityComparer());
             context["searcher"] = searcher;
             return context;
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4c206612/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
index cf2c366..6ff23fa 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
@@ -214,7 +214,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
                 int ll = lower.Value;
                 int uu = upper.Value;
 
-                return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, this,
ll, uu);
+                return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, outerInstance,
ll, uu);
             }
 
             private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer
@@ -225,7 +225,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
                 private readonly int uu;
 
                 public ValueSourceScorerAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper
outerInstance, IndexReader reader, EnumFieldSource @this, int ll, int uu)
-                    : base(reader, @this)
+                    : base(reader, outerInstance)
                 {
                     this.outerInstance = outerInstance;
                     this.ll = ll;


Mime
View raw message