lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [14/58] lucenenet git commit: QueryParser.Flexible Refactor: Made QueryParserHelper, QueryTreeBuilder, IQueryBuilder generic to avoid casting and duplicate Builder.Build() definitions during usage (that weren't necessary in Java)
Date Tue, 06 Dec 2016 15:11:49 GMT
QueryParser.Flexible Refactor: Made QueryParserHelper, QueryTreeBuilder, IQueryBuilder generic to avoid casting and duplicate Builder.Build() definitions during usage (that weren't necessary in Java)


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

Branch: refs/heads/master
Commit: 97a09054aac23615abe439b00395f30c3d80b881
Parents: 01233db
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Tue Nov 29 10:45:56 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Tue Nov 29 10:45:56 2016 +0700

----------------------------------------------------------------------
 .../Flexible/Core/Builders/QueryBuilder.cs      |  5 +-
 .../Flexible/Core/Builders/QueryTreeBuilder.cs  | 34 +++++------
 .../Flexible/Core/QueryParserHelper.cs          | 12 ++--
 .../Standard/Builders/AnyQueryNodeBuilder.cs    | 16 ++---
 .../Builders/BooleanQueryNodeBuilder.cs         | 16 ++---
 .../Standard/Builders/BoostQueryNodeBuilder.cs  | 16 ++---
 .../Standard/Builders/DummyQueryNodeBuilder.cs  | 14 ++---
 .../Standard/Builders/FieldQueryNodeBuilder.cs  | 14 ++---
 .../Standard/Builders/FuzzyQueryNodeBuilder.cs  | 14 ++---
 .../Standard/Builders/GroupQueryNodeBuilder.cs  | 16 ++---
 .../Builders/MatchAllDocsQueryNodeBuilder.cs    | 14 ++---
 .../Builders/MatchNoDocsQueryNodeBuilder.cs     | 14 ++---
 .../Builders/ModifierQueryNodeBuilder.cs        | 16 ++---
 .../Builders/MultiPhraseQueryNodeBuilder.cs     | 16 ++---
 .../Builders/NumericRangeQueryNodeBuilder.cs    | 14 ++---
 .../Standard/Builders/PhraseQueryNodeBuilder.cs | 16 ++---
 .../Builders/PrefixWildcardQueryNodeBuilder.cs  | 14 ++---
 .../Standard/Builders/RegexpQueryNodeBuilder.cs | 16 ++---
 .../Standard/Builders/SlopQueryNodeBuilder.cs   | 16 ++---
 .../Builders/StandardBooleanQueryNodeBuilder.cs | 16 ++---
 .../Standard/Builders/StandardQueryBuilder.cs   |  6 +-
 .../Builders/StandardQueryTreeBuilder.cs        | 18 +++---
 .../Builders/TermRangeQueryNodeBuilder.cs       | 14 ++---
 .../Builders/WildcardQueryNodeBuilder.cs        | 14 ++---
 .../Flexible/Standard/StandardQueryParser.cs    |  6 +-
 .../Core/Builders/TestQueryTreeBuilder.cs       |  7 ++-
 .../Precedence/TestPrecedenceQueryParser.cs     | 64 ++++++++++----------
 .../Flexible/Spans/SpanOrQueryNodeBuilder.cs    | 16 ++---
 .../Flexible/Spans/SpanTermQueryNodeBuilder.cs  | 14 ++---
 .../Flexible/Spans/SpansQueryTreeBuilder.cs     | 26 ++++----
 .../Flexible/Standard/TestMultiFieldQPHelper.cs | 56 ++++++++---------
 .../Flexible/Standard/TestNumericQueryParser.cs |  2 +-
 .../Flexible/Standard/TestQPHelper.cs           | 42 ++++++-------
 .../Flexible/Standard/TestStandardQP.cs         |  2 +-
 34 files changed, 302 insertions(+), 294 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryBuilder.cs
index 4a572aa..5407858 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryBuilder.cs
@@ -25,13 +25,14 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
     /// 
     /// <seealso cref="QueryTreeBuilder"/>
     /// </summary>
-    public interface IQueryBuilder// <TQuery> // LUCENENET specific - made generic so we don't need to deal with cast
+    public interface IQueryBuilder<TQuery> // LUCENENET specific - made generic so we don't need to deal with cast
     {
         /// <summary>
         /// Builds some kind of object from a query tree.
         /// </summary>
         /// <param name="queryNode">the query tree root node</param>
         /// <returns>some object generated from the query tree</returns>
-        object Build(IQueryNode queryNode);
+        /*object*/
+        TQuery Build(IQueryNode queryNode); // LUCENENET specific - made return type generic so we don't need to deal with cast
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryTreeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryTreeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryTreeBuilder.cs
index 41304c3..c21aadb 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryTreeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Core/Builders/QueryTreeBuilder.cs
@@ -54,17 +54,17 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
     /// </para>
     /// <seealso cref="IQueryBuilder"/>
     /// </summary>
-    public class QueryTreeBuilder : IQueryBuilder
+    public class QueryTreeBuilder<TQuery> : IQueryBuilder<TQuery>
     {
         /**
    * This tag is used to tag the nodes in a query tree with the built objects
    * produced from their own associated builder.
    */
-        public static readonly string QUERY_TREE_BUILDER_TAGID = typeof(QueryTreeBuilder).Name;
+        public static readonly string QUERY_TREE_BUILDER_TAGID = typeof(QueryTreeBuilder<TQuery>).Name;
 
-        private IDictionary<Type, IQueryBuilder> queryNodeBuilders;
+        private IDictionary<Type, IQueryBuilder<TQuery>> queryNodeBuilders;
 
-        private IDictionary<string, IQueryBuilder> fieldNameBuilders;
+        private IDictionary<string, IQueryBuilder<TQuery>> fieldNameBuilders;
 
         /**
          * {@link QueryTreeBuilder} constructor.
@@ -80,12 +80,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
          * @param fieldName the field name
          * @param builder the builder to be associated
          */
-        public void SetBuilder(string fieldName, IQueryBuilder builder)
+        public void SetBuilder(string fieldName, IQueryBuilder<TQuery> builder)
         {
 
             if (this.fieldNameBuilders == null)
             {
-                this.fieldNameBuilders = new Dictionary<string, IQueryBuilder>();
+                this.fieldNameBuilders = new Dictionary<string, IQueryBuilder<TQuery>>();
             }
 
             this.fieldNameBuilders[fieldName] = builder;
@@ -98,12 +98,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
          * @param builder the builder to be associated
          */
         public void SetBuilder(Type queryNodeClass,
-            IQueryBuilder builder)
+            IQueryBuilder<TQuery> builder)
         {
 
             if (this.queryNodeBuilders == null)
             {
-                this.queryNodeBuilders = new Dictionary<Type, IQueryBuilder>();
+                this.queryNodeBuilders = new Dictionary<Type, IQueryBuilder<TQuery>>();
             }
 
             this.queryNodeBuilders[queryNodeClass] = builder;
@@ -115,9 +115,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
 
             if (node != null)
             {
-                IQueryBuilder builder = GetBuilder(node);
+                IQueryBuilder<TQuery> builder = GetBuilder(node);
 
-                if (!(builder is QueryTreeBuilder))
+                if (!(builder is QueryTreeBuilder<TQuery>))
                 {
                     IList<IQueryNode> children = node.GetChildren();
 
@@ -139,9 +139,9 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
 
         }
 
-        private IQueryBuilder GetBuilder(IQueryNode node)
+        private IQueryBuilder<TQuery> GetBuilder(IQueryNode node)
         {
-            IQueryBuilder builder = null;
+            IQueryBuilder<TQuery> builder = null;
 
             if (this.fieldNameBuilders != null && node is IFieldableNode)
             {
@@ -191,7 +191,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
 
         }
 
-        private void ProcessNode(IQueryNode node, IQueryBuilder builder)
+        private void ProcessNode(IQueryNode node, IQueryBuilder<TQuery> builder)
         {
 
             if (builder == null)
@@ -213,12 +213,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
 
         }
 
-        private IQueryBuilder GetQueryBuilder(Type clazz)
+        private IQueryBuilder<TQuery> GetQueryBuilder(Type clazz)
         {
 
             if (typeof(IQueryNode).IsAssignableFrom(clazz))
             {
-                IQueryBuilder result;
+                IQueryBuilder<TQuery> result;
                 this.queryNodeBuilders.TryGetValue(clazz, out result);
                 return result;
                 //return this.queryNodeBuilders.get(clazz);
@@ -241,11 +241,11 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
          *         builder associated to it
          */
 
-        public virtual object Build(IQueryNode queryNode)
+        public virtual /*object*/ TQuery Build(IQueryNode queryNode)
         {
             Process(queryNode);
 
-            return queryNode.GetTag(QUERY_TREE_BUILDER_TAGID);
+            return (TQuery)queryNode.GetTag(QUERY_TREE_BUILDER_TAGID);
 
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Core/QueryParserHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/QueryParserHelper.cs b/src/Lucene.Net.QueryParser/Flexible/Core/QueryParserHelper.cs
index 6bb9658..8d60978 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Core/QueryParserHelper.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Core/QueryParserHelper.cs
@@ -24,13 +24,13 @@ namespace Lucene.Net.QueryParsers.Flexible.Core
     /// <seealso cref="ISyntaxParser"/>
     /// <seealso cref="QueryBuilder"/>
     /// <seealso cref="QueryConfigHandler"/>
-    public class QueryParserHelper // LUCENENET TODO: Make this class generic so we can avoid the cast (to Query) on the Parse method
+    public class QueryParserHelper<TQuery> // Made this class generic so we can avoid the cast (to Query) on the Parse method
     {
         private IQueryNodeProcessor processor;
 
         private ISyntaxParser syntaxParser;
 
-        private IQueryBuilder builder;
+        private IQueryBuilder<TQuery> builder;
 
         private QueryConfigHandler config;
 
@@ -54,7 +54,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core
          * @see QueryConfigHandler
          */
         public QueryParserHelper(QueryConfigHandler queryConfigHandler, ISyntaxParser syntaxParser, IQueryNodeProcessor processor,
-            IQueryBuilder builder)
+            IQueryBuilder<TQuery> builder)
         {
             this.syntaxParser = syntaxParser;
             this.config = queryConfigHandler;
@@ -136,7 +136,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core
          * @see #getQueryBuilder()
          * @see QueryBuilder
          */
-        public void SetQueryBuilder(IQueryBuilder queryBuilder)
+        public void SetQueryBuilder(IQueryBuilder<TQuery> queryBuilder)
         {
 
             if (queryBuilder == null)
@@ -173,7 +173,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core
          * @see #setQueryBuilder(QueryBuilder)
          * @see QueryBuilder
          */
-        public IQueryBuilder GetQueryBuilder()
+        public IQueryBuilder<TQuery> GetQueryBuilder()
         {
             return this.builder;
         }
@@ -242,7 +242,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core
          * @throws QueryNodeException
          *           if something wrong happens along the three phases
          */
-        public virtual object Parse(string query, string defaultField)
+        public virtual /*object*/ TQuery Parse(string query, string defaultField)
         {
             IQueryNode queryTree = GetSyntaxParser().Parse(query, defaultField);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
index a31e56a..142a88e 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
@@ -36,7 +36,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
                 foreach (IQueryNode child in children)
                 {
-                    object obj = child.GetTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                    object obj = child.GetTag(QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
 
                     if (obj != null)
                     {
@@ -69,12 +69,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
index 0486e89..81576d3 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
@@ -43,7 +43,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
                 foreach (IQueryNode child in children)
                 {
-                    object obj = child.GetTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                    object obj = child.GetTag(QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
 
                     if (obj != null)
                     {
@@ -74,13 +74,13 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
 
         private static BooleanClause.Occur GetModifierValue(IQueryNode node)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BoostQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BoostQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BoostQueryNodeBuilder.cs
index eff296e..82a5ac9 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BoostQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BoostQueryNodeBuilder.cs
@@ -33,19 +33,19 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             }
 
             Query query = (Query)child
-                .GetTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                .GetTag(QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
             query.Boost = boostNode.GetValue();
 
             return query;
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/DummyQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/DummyQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/DummyQueryNodeBuilder.cs
index c2a5dfe..1587559 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/DummyQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/DummyQueryNodeBuilder.cs
@@ -35,12 +35,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             return null;
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FieldQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FieldQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FieldQueryNodeBuilder.cs
index f3a112a..8393826 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FieldQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FieldQueryNodeBuilder.cs
@@ -29,12 +29,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
                 .GetTextAsString()));
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FuzzyQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FuzzyQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FuzzyQueryNodeBuilder.cs
index 549b2a2..77b43c0 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FuzzyQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/FuzzyQueryNodeBuilder.cs
@@ -37,12 +37,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/GroupQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/GroupQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/GroupQueryNodeBuilder.cs
index faafdfb..af8d121 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/GroupQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/GroupQueryNodeBuilder.cs
@@ -27,16 +27,16 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             GroupQueryNode groupNode = (GroupQueryNode)queryNode;
 
             return (Query)(groupNode).GetChild().GetTag(
-                QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchAllDocsQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchAllDocsQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchAllDocsQueryNodeBuilder.cs
index cf930d3..0a9dfec 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchAllDocsQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchAllDocsQueryNodeBuilder.cs
@@ -41,12 +41,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchNoDocsQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchNoDocsQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchNoDocsQueryNodeBuilder.cs
index 7ad2c7b..25f5d6b 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchNoDocsQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MatchNoDocsQueryNodeBuilder.cs
@@ -41,13 +41,13 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
 
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/ModifierQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/ModifierQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/ModifierQueryNodeBuilder.cs
index 0911a0c..271ebca 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/ModifierQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/ModifierQueryNodeBuilder.cs
@@ -27,16 +27,16 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             ModifierQueryNode modifierNode = (ModifierQueryNode)queryNode;
 
             return (Query)(modifierNode).GetChild().GetTag(
-                QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MultiPhraseQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MultiPhraseQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MultiPhraseQueryNodeBuilder.cs
index 7a22da8..81007e6 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MultiPhraseQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/MultiPhraseQueryNodeBuilder.cs
@@ -41,7 +41,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
                 {
                     FieldQueryNode termNode = (FieldQueryNode)child;
                     TermQuery termQuery = (TermQuery)termNode
-                        .GetTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                        .GetTag(QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
 
                     //List<Term> termList = positionTermMap[termNode.GetPositionIncrement()];
                     //if (termList == null)
@@ -72,12 +72,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/NumericRangeQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/NumericRangeQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/NumericRangeQueryNodeBuilder.cs
index ce39a54..911aaea 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/NumericRangeQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/NumericRangeQueryNodeBuilder.cs
@@ -80,12 +80,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             }
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PhraseQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PhraseQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PhraseQueryNodeBuilder.cs
index d9129b4..09229f6 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PhraseQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PhraseQueryNodeBuilder.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
                 foreach (IQueryNode child in children)
                 {
                     TermQuery termQuery = (TermQuery)child
-                        .GetTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                        .GetTag(QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
                     FieldQueryNode termNode = (FieldQueryNode)child;
 
                     phraseQuery.Add(termQuery.Term, termNode.GetPositionIncrement());
@@ -48,12 +48,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PrefixWildcardQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PrefixWildcardQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PrefixWildcardQueryNodeBuilder.cs
index 2646b86..69371fb 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PrefixWildcardQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/PrefixWildcardQueryNodeBuilder.cs
@@ -41,12 +41,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             return q;
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/RegexpQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/RegexpQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/RegexpQueryNodeBuilder.cs
index d3f0fa5..c138d8b 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/RegexpQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/RegexpQueryNodeBuilder.cs
@@ -28,7 +28,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             RegexpQueryNode regexpNode = (RegexpQueryNode)queryNode;
 
             RegexpQuery q = new RegexpQuery(new Term(regexpNode.FieldAsString,
-        regexpNode.TextToBytesRef()));
+                regexpNode.TextToBytesRef()));
 
             MultiTermQuery.RewriteMethod method = (MultiTermQuery.RewriteMethod)queryNode
                 .GetTag(MultiTermRewriteMethodProcessor.TAG_ID);
@@ -40,12 +40,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             return q;
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/SlopQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/SlopQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/SlopQueryNodeBuilder.cs
index e64bb82..caeb118 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/SlopQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/SlopQueryNodeBuilder.cs
@@ -28,7 +28,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             SlopQueryNode phraseSlopNode = (SlopQueryNode)queryNode;
 
             Query query = (Query)phraseSlopNode.GetChild().GetTag(
-                QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
 
             if (query is PhraseQuery)
             {
@@ -44,12 +44,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
index 3fc51ba..7d82b99 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
@@ -42,7 +42,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
                 foreach (IQueryNode child in children)
                 {
-                    object obj = child.GetTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                    object obj = child.GetTag(QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
 
                     if (obj != null)
                     {
@@ -72,13 +72,13 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
 
         private static BooleanClause.Occur GetModifierValue(IQueryNode node)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryBuilder.cs
index 3554ab8..fafda9a 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryBuilder.cs
@@ -15,8 +15,10 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
     /// </summary>
     /// <seealso cref="IQueryBuilder"/>
     /// <seealso cref="QueryTreeBuilder"/>
-    public interface IStandardQueryBuilder : IQueryBuilder
+    public interface IStandardQueryBuilder : IQueryBuilder<Query>
     {
-        new Query Build(IQueryNode queryNode);
+        // LUCENENET specific - we don't need to redeclare Build here because
+        // it already exists in the now generic IQueryBuilder
+        //Query Build(IQueryNode queryNode);
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryTreeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryTreeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryTreeBuilder.cs
index f40040f..a99ae45 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryTreeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardQueryTreeBuilder.cs
@@ -18,7 +18,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
     /// </summary>
     /// <seealso cref="QueryTreeBuilder"/>
     /// <seealso cref="StandardQueryNodeProcessorPipeline"/>
-    public class StandardQueryTreeBuilder : QueryTreeBuilder, IStandardQueryBuilder
+    public class StandardQueryTreeBuilder : QueryTreeBuilder<Query>, IStandardQueryBuilder
     {
         public StandardQueryTreeBuilder()
         {
@@ -45,16 +45,16 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        public override object Build(IQueryNode queryNode)
+        public override /*object*/ Query Build(IQueryNode queryNode)
         {
             return base.Build(queryNode);
         }
-        /// <summary>
-        /// LUCENENET specific overload for supporting IStandardQueryBuilder
-        /// </summary>
-        Query IStandardQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return (Query)Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IStandardQueryBuilder
+        ///// </summary>
+        //Query IStandardQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return (Query)Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/TermRangeQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/TermRangeQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/TermRangeQueryNodeBuilder.cs
index f619137..965394e 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/TermRangeQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/TermRangeQueryNodeBuilder.cs
@@ -58,12 +58,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/WildcardQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/WildcardQueryNodeBuilder.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/WildcardQueryNodeBuilder.cs
index eb74378..4817427 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/WildcardQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/WildcardQueryNodeBuilder.cs
@@ -40,12 +40,12 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
             return q;
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.QueryParser/Flexible/Standard/StandardQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/StandardQueryParser.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/StandardQueryParser.cs
index f0f89b1..29e28f7 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/StandardQueryParser.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/StandardQueryParser.cs
@@ -16,7 +16,7 @@ using System.Threading.Tasks;
 
 namespace Lucene.Net.QueryParsers.Flexible.Standard
 {
-    public class StandardQueryParser : QueryParserHelper, ICommonQueryParserConfiguration
+    public class StandardQueryParser : QueryParserHelper<Query>, ICommonQueryParserConfiguration
     {
         
         /**
@@ -70,10 +70,10 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
          * @throws QueryNodeException
          *           if something wrong happens along the three phases
          */
-        public override /*Query*/ object Parse(string query, string defaultField) // LUCENENET TODO: Can this be return type Query?
+        public override Query Parse(string query, string defaultField)
         {
 
-            return (Query)base.Parse(query, defaultField);
+            return base.Parse(query, defaultField);
 
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
index 207502c..37e3a83 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
@@ -16,12 +16,13 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
         [Test]
         public virtual void TestSetFieldBuilder()
         {
-            QueryTreeBuilder qtb = new QueryTreeBuilder();
+            // LUCENENET TODO: Make additional non-generic QueryTreeBuilder of type object?
+            QueryTreeBuilder<object> qtb = new QueryTreeBuilder<object>();
             qtb.SetBuilder("field", new DummyBuilder());
             Object result = qtb.Build(new FieldQueryNode(new UnescapedCharSequence("field").ToString(), "foo", 0, 0));
             assertEquals("OK", result);
 
-            qtb = new QueryTreeBuilder();
+            qtb = new QueryTreeBuilder<object>();
             qtb.SetBuilder(typeof(DummyQueryNodeInterface), new DummyBuilder());
             result = qtb.Build(new DummyQueryNode());
             assertEquals("OK", result);
@@ -48,7 +49,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
 
         }
 
-        private class DummyBuilder : IQueryBuilder
+        private class DummyBuilder : IQueryBuilder<object>
         {
             public virtual object Build(IQueryNode queryNode)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
index 9c418a8..029f2bb 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
@@ -135,7 +135,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
 
         public Query GetQuery(string query, Analyzer a)
         {
-            return (Query)GetParser(a).Parse(query, "field"); // LUCENENET TODO: There was no cast here in the original - perhaps object is the wrong type on the interface
+            return GetParser(a).Parse(query, "field");
         }
 
         public void assertQueryEquals(string query, Analyzer a, string result)
@@ -154,7 +154,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
         {
             PrecedenceQueryParser qp = GetParser(null);
             qp.LowercaseExpandedTerms = (lowercase);
-            Query q = (Query)qp.Parse(query, "field");
+            Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
             if (!s.equals(result))
             {
@@ -166,7 +166,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
         public void assertWildcardQueryEquals(String query, String result)
         {
             PrecedenceQueryParser qp = GetParser(null);
-            Query q = (Query)qp.Parse(query, "field");
+            Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
             if (!s.equals(result))
             {
@@ -182,7 +182,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
             PrecedenceQueryParser qp = new PrecedenceQueryParser();
             qp.Analyzer = (a);
             qp.SetDefaultOperator(/*StandardQueryConfigHandler.*/Operator.AND);
-            return (Query)qp.Parse(query, "field");
+            return qp.Parse(query, "field");
         }
 
         public void assertQueryEqualsDOA(String query, Analyzer a, String result)
@@ -508,7 +508,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
         public void assertQueryEquals(PrecedenceQueryParser qp, String field, String query,
             String result)
         {
-            Query q = (Query)qp.Parse(query, field);
+            Query q = qp.Parse(query, field);
             String s = q.ToString(field);
             if (!s.equals(result))
             {
@@ -610,18 +610,18 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
 
             PrecedenceQueryParser qp = new PrecedenceQueryParser();
             qp.Analyzer = (oneStopAnalyzer);
-            Query q = (Query)qp.Parse("on^1.0", "field");
+            Query q = qp.Parse("on^1.0", "field");
             assertNotNull(q);
-            q = (Query)qp.Parse("\"hello\"^2.0", "field");
+            q = qp.Parse("\"hello\"^2.0", "field");
             assertNotNull(q);
             assertEquals(q.Boost, (float)2.0, (float)0.5);
-            q = (Query)qp.Parse("hello^2.0", "field");
+            q = qp.Parse("hello^2.0", "field");
             assertNotNull(q);
             assertEquals(q.Boost, (float)2.0, (float)0.5);
-            q = (Query)qp.Parse("\"on\"^1.0", "field");
+            q = qp.Parse("\"on\"^1.0", "field");
             assertNotNull(q);
 
-            q = (Query)GetParser(new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET)).Parse("the^3",
+            q = GetParser(new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET)).Parse("the^3",
                     "field");
             assertNotNull(q);
         }
@@ -670,49 +670,49 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
         public void testPrecedence()
         {
             PrecedenceQueryParser parser = GetParser(new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
-            Query query1 = (Query)parser.Parse("A AND B OR C AND D", "field");
-            Query query2 = (Query)parser.Parse("(A AND B) OR (C AND D)", "field");
+            Query query1 = parser.Parse("A AND B OR C AND D", "field");
+            Query query2 = parser.Parse("(A AND B) OR (C AND D)", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A OR B C", "field");
-            query2 = (Query)parser.Parse("(A B) C", "field");
+            query1 = parser.Parse("A OR B C", "field");
+            query2 = parser.Parse("(A B) C", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A AND B C", "field");
-            query2 = (Query)parser.Parse("(+A +B) C", "field");
+            query1 = parser.Parse("A AND B C", "field");
+            query2 = parser.Parse("(+A +B) C", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A AND NOT B", "field");
-            query2 = (Query)parser.Parse("+A -B", "field");
+            query1 = parser.Parse("A AND NOT B", "field");
+            query2 = parser.Parse("+A -B", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A OR NOT B", "field");
-            query2 = (Query)parser.Parse("A -B", "field");
+            query1 = parser.Parse("A OR NOT B", "field");
+            query2 = parser.Parse("A -B", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A OR NOT B AND C", "field");
-            query2 = (Query)parser.Parse("A (-B +C)", "field");
+            query1 = parser.Parse("A OR NOT B AND C", "field");
+            query2 = parser.Parse("A (-B +C)", "field");
             assertEquals(query1, query2);
 
             parser.SetDefaultOperator(/*StandardQueryConfigHandler.*/Operator.AND);
-            query1 = (Query)parser.Parse("A AND B OR C AND D", "field");
-            query2 = (Query)parser.Parse("(A AND B) OR (C AND D)", "field");
+            query1 = parser.Parse("A AND B OR C AND D", "field");
+            query2 = parser.Parse("(A AND B) OR (C AND D)", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A AND B C", "field");
-            query2 = (Query)parser.Parse("(A B) C", "field");
+            query1 = parser.Parse("A AND B C", "field");
+            query2 = parser.Parse("(A B) C", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A AND B C", "field");
-            query2 = (Query)parser.Parse("(+A +B) C", "field");
+            query1 = parser.Parse("A AND B C", "field");
+            query2 = parser.Parse("(+A +B) C", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A AND NOT B", "field");
-            query2 = (Query)parser.Parse("+A -B", "field");
+            query1 = parser.Parse("A AND NOT B", "field");
+            query2 = parser.Parse("+A -B", "field");
             assertEquals(query1, query2);
 
-            query1 = (Query)parser.Parse("A AND NOT B OR C", "field");
-            query2 = (Query)parser.Parse("(+A -B) OR C", "field");
+            query1 = parser.Parse("A AND NOT B OR C", "field");
+            query2 = parser.Parse("(+A -B) OR C", "field");
             assertEquals(query1, query2);
 
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanOrQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanOrQueryNodeBuilder.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanOrQueryNodeBuilder.cs
index c93c267..19b8e02 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanOrQueryNodeBuilder.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanOrQueryNodeBuilder.cs
@@ -32,19 +32,19 @@ namespace Lucene.Net.QueryParsers.Flexible.Spans
             foreach (IQueryNode child in children)
             {
                 spanQueries[i++] = (SpanQuery)child
-                    .GetTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
+                    .GetTag(QueryTreeBuilder<Query>.QUERY_TREE_BUILDER_TAGID);
             }
 
             return new SpanOrQuery(spanQueries);
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanTermQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanTermQueryNodeBuilder.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanTermQueryNodeBuilder.cs
index 30946d2..e8868fe 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanTermQueryNodeBuilder.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpanTermQueryNodeBuilder.cs
@@ -28,13 +28,13 @@ namespace Lucene.Net.QueryParsers.Flexible.Spans
 
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        object IQueryBuilder.Build(IQueryNode queryNode)
-        {
-            return Build(queryNode);
-        }
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //object IQueryBuilder.Build(IQueryNode queryNode)
+        //{
+        //    return Build(queryNode);
+        //}
 
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpansQueryTreeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpansQueryTreeBuilder.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpansQueryTreeBuilder.cs
index 31d94db..1f63e97 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpansQueryTreeBuilder.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Spans/SpansQueryTreeBuilder.cs
@@ -18,7 +18,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Spans
     /// - every BooleanQueryNode instance is delegated to the SpanOrQueryNodeBuilder
     /// - every FieldQueryNode instance is delegated to the SpanTermQueryNodeBuilder
     /// </summary>
-    public class SpansQueryTreeBuilder : QueryTreeBuilder, IStandardQueryBuilder
+    public class SpansQueryTreeBuilder : QueryTreeBuilder<Query>, IStandardQueryBuilder
     {
         public SpansQueryTreeBuilder()
         {
@@ -27,18 +27,22 @@ namespace Lucene.Net.QueryParsers.Flexible.Spans
 
         }
 
-
-        Query IStandardQueryBuilder.Build(IQueryNode queryTree)
+        public override Query Build(IQueryNode queryTree)
         {
-            return (Query)base.Build(queryTree);
+            return base.Build(queryTree);
         }
 
-        /// <summary>
-        /// LUCENENET specific overload for supporting IQueryBuilder
-        /// </summary>
-        public override object Build(IQueryNode queryTree)
-        {
-            return (Query)base.Build(queryTree);
-        }
+        //Query IStandardQueryBuilder.Build(IQueryNode queryTree)
+        //{
+        //    return (Query)base.Build(queryTree);
+        //}
+
+        ///// <summary>
+        ///// LUCENENET specific overload for supporting IQueryBuilder
+        ///// </summary>
+        //public override object Build(IQueryNode queryTree)
+        //{
+        //    return (Query)base.Build(queryTree);
+        //}
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs
index 84affc0..9ed9397 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestMultiFieldQPHelper.cs
@@ -51,7 +51,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             mfqp.SetMultiFields(fields);
             mfqp.Analyzer = (a);
 
-            Query q = (Query)mfqp.Parse(qtxt, null);
+            Query q = mfqp.Parse(qtxt, null);
             assertEquals(expectedRes, q.toString());
 
             q = QueryParserUtil.Parse(qtxt, fields, occur, a);
@@ -67,61 +67,61 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             mfqp.SetMultiFields(fields);
             mfqp.Analyzer = (new MockAnalyzer(Random()));
 
-            Query q = (Query)mfqp.Parse("one", null);
+            Query q = mfqp.Parse("one", null);
             assertEquals("b:one t:one", q.toString());
 
-            q = (Query)mfqp.Parse("one two", null);
+            q = mfqp.Parse("one two", null);
             assertEquals("(b:one t:one) (b:two t:two)", q.toString());
 
-            q = (Query)mfqp.Parse("+one +two", null);
+            q = mfqp.Parse("+one +two", null);
             assertEquals("+(b:one t:one) +(b:two t:two)", q.toString());
 
-            q = (Query)mfqp.Parse("+one -two -three", null);
+            q = mfqp.Parse("+one -two -three", null);
             assertEquals("+(b:one t:one) -(b:two t:two) -(b:three t:three)", q
                 .toString());
 
-            q = (Query)mfqp.Parse("one^2 two", null);
+            q = mfqp.Parse("one^2 two", null);
             assertEquals("((b:one t:one)^2.0) (b:two t:two)", q.toString());
 
-            q = (Query)mfqp.Parse("one~ two", null);
+            q = mfqp.Parse("one~ two", null);
             assertEquals("(b:one~2 t:one~2) (b:two t:two)", q.toString());
 
-            q = (Query)mfqp.Parse("one~0.8 two^2", null);
+            q = mfqp.Parse("one~0.8 two^2", null);
             assertEquals("(b:one~0 t:one~0) ((b:two t:two)^2.0)", q.toString());
 
-            q = (Query)mfqp.Parse("one* two*", null);
+            q = mfqp.Parse("one* two*", null);
             assertEquals("(b:one* t:one*) (b:two* t:two*)", q.toString());
 
-            q = (Query)mfqp.Parse("[a TO c] two", null);
+            q = mfqp.Parse("[a TO c] two", null);
             assertEquals("(b:[a TO c] t:[a TO c]) (b:two t:two)", q.toString());
 
-            q = (Query)mfqp.Parse("w?ldcard", null);
+            q = mfqp.Parse("w?ldcard", null);
             assertEquals("b:w?ldcard t:w?ldcard", q.toString());
 
-            q = (Query)mfqp.Parse("\"foo bar\"", null);
+            q = mfqp.Parse("\"foo bar\"", null);
             assertEquals("b:\"foo bar\" t:\"foo bar\"", q.toString());
 
-            q = (Query)mfqp.Parse("\"aa bb cc\" \"dd ee\"", null);
+            q = mfqp.Parse("\"aa bb cc\" \"dd ee\"", null);
             assertEquals("(b:\"aa bb cc\" t:\"aa bb cc\") (b:\"dd ee\" t:\"dd ee\")", q
                 .toString());
 
-            q = (Query)mfqp.Parse("\"foo bar\"~4", null);
+            q = mfqp.Parse("\"foo bar\"~4", null);
             assertEquals("b:\"foo bar\"~4 t:\"foo bar\"~4", q.toString());
 
             // LUCENE-1213: QueryParser was ignoring slop when phrase
             // had a field.
-            q = (Query)mfqp.Parse("b:\"foo bar\"~4", null);
+            q = mfqp.Parse("b:\"foo bar\"~4", null);
             assertEquals("b:\"foo bar\"~4", q.toString());
 
             // make sure that terms which have a field are not touched:
-            q = (Query)mfqp.Parse("one f:two", null);
+            q = mfqp.Parse("one f:two", null);
             assertEquals("(b:one t:one) f:two", q.toString());
 
             // AND mode:
             mfqp.SetDefaultOperator(/*StandardQueryConfigHandler.*/Operator.AND);
-            q = (Query)mfqp.Parse("one two", null);
+            q = mfqp.Parse("one two", null);
             assertEquals("+(b:one t:one) +(b:two t:two)", q.toString());
-            q = (Query)mfqp.Parse("\"aa bb cc\" \"dd ee\"", null);
+            q = mfqp.Parse("\"aa bb cc\" \"dd ee\"", null);
             assertEquals("+(b:\"aa bb cc\" t:\"aa bb cc\") +(b:\"dd ee\" t:\"dd ee\")",
                 q.toString());
 
@@ -140,24 +140,24 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             mfqp.Analyzer = (new MockAnalyzer(Random()));
 
             // Check for simple
-            Query q = (Query)mfqp.Parse("one", null);
+            Query q = mfqp.Parse("one", null);
             assertEquals("b:one^5.0 t:one^10.0", q.toString());
 
             // Check for AND
-            q = (Query)mfqp.Parse("one AND two", null);
+            q = mfqp.Parse("one AND two", null);
             assertEquals("+(b:one^5.0 t:one^10.0) +(b:two^5.0 t:two^10.0)", q
                 .toString());
 
             // Check for OR
-            q = (Query)mfqp.Parse("one OR two", null);
+            q = mfqp.Parse("one OR two", null);
             assertEquals("(b:one^5.0 t:one^10.0) (b:two^5.0 t:two^10.0)", q.toString());
 
             // Check for AND and a field
-            q = (Query)mfqp.Parse("one AND two AND foo:test", null);
+            q = mfqp.Parse("one AND two AND foo:test", null);
             assertEquals("+(b:one^5.0 t:one^10.0) +(b:two^5.0 t:two^10.0) +foo:test", q
                 .toString());
 
-            q = (Query)mfqp.Parse("one^3 AND two^4", null);
+            q = mfqp.Parse("one^3 AND two^4", null);
             assertEquals("+((b:one^5.0 t:one^10.0)^3.0) +((b:two^5.0 t:two^10.0)^4.0)",
                 q.toString());
         }
@@ -334,15 +334,15 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             parser.SetMultiFields(fields);
             parser.Analyzer = (new AnalyzerReturningNull());
 
-            Query q = (Query)parser.Parse("bla AND blo", null);
+            Query q = parser.Parse("bla AND blo", null);
             assertEquals("+(f2:bla f3:bla) +(f2:blo f3:blo)", q.toString());
             // the following queries are not affected as their terms are not
             // analyzed anyway:
-            q = (Query)parser.Parse("bla*", null);
+            q = parser.Parse("bla*", null);
             assertEquals("f1:bla* f2:bla* f3:bla*", q.toString());
-            q = (Query)parser.Parse("bla~", null);
+            q = parser.Parse("bla~", null);
             assertEquals("f1:bla~2 f2:bla~2 f3:bla~2", q.toString());
-            q = (Query)parser.Parse("[a TO c]", null);
+            q = parser.Parse("[a TO c]", null);
             assertEquals("f1:[a TO c] f2:[a TO c] f3:[a TO c]", q.toString());
         }
 
@@ -362,7 +362,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             mfqp.SetMultiFields(new String[] { "body" });
             mfqp.Analyzer = (analyzer);
             mfqp.SetDefaultOperator(/*StandardQueryConfigHandler.*/Operator.AND);
-            Query q = (Query)mfqp.Parse("the footest", null);
+            Query q = mfqp.Parse("the footest", null);
             IndexReader ir = DirectoryReader.Open(ramDir);
             IndexSearcher @is = NewSearcher(ir);
             ScoreDoc[] hits = @is.Search(q, null, 1000).ScoreDocs;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
index 29f6031..21aacb1 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestNumericQueryParser.cs
@@ -526,7 +526,7 @@
 //        {
 //            if (VERBOSE) Console.WriteLine("Parsing: " + queryStr);
 
-//            Query query = (Query)qp.Parse(queryStr, FIELD_NAME);
+//            Query query = qp.Parse(queryStr, FIELD_NAME);
 //            if (VERBOSE) Console.WriteLine("Querying: " + query);
 //            TopDocs topDocs = searcher.Search(query, 1000);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
index fdf12e7..c59896f 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
@@ -192,14 +192,14 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
 
         public Query GetQuery(String query, Analyzer a)
         {
-            return (Query)GetParser(a).Parse(query, "field");
+            return GetParser(a).Parse(query, "field");
         }
 
         public Query GetQueryAllowLeadingWildcard(String query, Analyzer a)
         {
             StandardQueryParser parser = GetParser(a);
             parser.AllowLeadingWildcard = (true);
-            return (Query)parser.Parse(query, "field");
+            return parser.Parse(query, "field");
         }
 
         public void assertQueryEquals(String query, Analyzer a, String result)
@@ -227,7 +227,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         public void assertQueryEquals(StandardQueryParser qp, String field,
             String query, String result)
         {
-            Query q = (Query)qp.Parse(query, field);
+            Query q = qp.Parse(query, field);
             String s = q.ToString(field);
             if (!s.equals(result))
             {
@@ -253,7 +253,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             StandardQueryParser qp = GetParser(null);
             qp.LowercaseExpandedTerms = (lowercase);
             qp.AllowLeadingWildcard = (allowLeadingWildcard);
-            Query q = (Query)qp.Parse(query, "field");
+            Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
             if (!s.equals(result))
             {
@@ -271,7 +271,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         public void assertWildcardQueryEquals(String query, String result)
         {
             StandardQueryParser qp = GetParser(null);
-            Query q = (Query)qp.Parse(query, "field");
+            Query q = qp.Parse(query, "field");
             String s = q.ToString("field");
             if (!s.equals(result))
             {
@@ -288,7 +288,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             qp.Analyzer = (a);
             qp.SetDefaultOperator(/*StandardQueryConfigHandler.*/Operator.AND);
 
-            return (Query)qp.Parse(query, "field");
+            return qp.Parse(query, "field");
 
         }
 
@@ -306,15 +306,15 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
         public void testConstantScoreAutoRewrite()
         {
             StandardQueryParser qp = new StandardQueryParser(new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
-            Query q = (Query)qp.Parse("foo*bar", "field");
+            Query q = qp.Parse("foo*bar", "field");
             assertTrue(q is WildcardQuery);
             assertEquals(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, ((MultiTermQuery)q).GetRewriteMethod());
 
-            q = (Query)qp.Parse("foo*", "field");
+            q = qp.Parse("foo*", "field");
             assertTrue(q is PrefixQuery);
             assertEquals(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, ((MultiTermQuery)q).GetRewriteMethod());
 
-            q = (Query)qp.Parse("[a TO z]", "field");
+            q = qp.Parse("[a TO z]", "field");
             assertTrue(q is TermRangeQuery);
             assertEquals(MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, ((MultiTermQuery)q).GetRewriteMethod());
         }
@@ -1008,21 +1008,21 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             StandardQueryParser qp = new StandardQueryParser();
             qp.Analyzer = (oneStopAnalyzer);
 
-            Query q = (Query)qp.Parse("on^1.0", "field");
+            Query q = qp.Parse("on^1.0", "field");
             assertNotNull(q);
-            q = (Query)qp.Parse("\"hello\"^2.0", "field");
+            q = qp.Parse("\"hello\"^2.0", "field");
             assertNotNull(q);
             assertEquals(q.Boost, (float)2.0, (float)0.5);
-            q = (Query)qp.Parse("hello^2.0", "field");
+            q = qp.Parse("hello^2.0", "field");
             assertNotNull(q);
             assertEquals(q.Boost, (float)2.0, (float)0.5);
-            q = (Query)qp.Parse("\"on\"^1.0", "field");
+            q = qp.Parse("\"on\"^1.0", "field");
             assertNotNull(q);
 
             StandardQueryParser qp2 = new StandardQueryParser();
             qp2.Analyzer = (new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET));
 
-            q = (Query)qp2.Parse("the^3", "field");
+            q = qp2.Parse("the^3", "field");
             // "the" is a stop word so the result is an empty query:
             assertNotNull(q);
             assertEquals("", q.toString());
@@ -1106,8 +1106,8 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             StandardQueryParser qp = new StandardQueryParser();
             qp.Analyzer = (new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
 
-            Query query1 = (Query)qp.Parse("A AND B OR C AND D", "field");
-            Query query2 = (Query)qp.Parse("+A +B +C +D", "field");
+            Query query1 = qp.Parse("A AND B OR C AND D", "field");
+            Query query2 = qp.Parse("+A +B +C +D", "field");
 
             assertEquals(query1, query2);
         }
@@ -1264,15 +1264,15 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             CharacterRunAutomaton stopSet = new CharacterRunAutomaton(new RegExp("the|foo").ToAutomaton());
             qp.Analyzer = (new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true, stopSet));
 
-            Query result = (Query)qp.Parse("a:the OR a:foo", "a");
+            Query result = qp.Parse("a:the OR a:foo", "a");
             assertNotNull("result is null and it shouldn't be", result);
             assertTrue("result is not a BooleanQuery", result is BooleanQuery);
             assertTrue(((BooleanQuery)result).Clauses.size() + " does not equal: "
                 + 0, ((BooleanQuery)result).Clauses.size() == 0);
-            result = (Query)qp.Parse("a:woo OR a:the", "a");
+            result = qp.Parse("a:woo OR a:the", "a");
             assertNotNull("result is null and it shouldn't be", result);
             assertTrue("result is not a TermQuery", result is TermQuery);
-            result = (Query)qp.Parse(
+            result = qp.Parse(
                     "(fieldX:xxxxx OR fieldy:xxxxxxxx)^2 AND (fieldx:the OR fieldy:foo)",
                     "a");
             assertNotNull("result is null and it shouldn't be", result);
@@ -1325,7 +1325,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             qp.Analyzer = (new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
             qp.Locale = new CultureInfo("en");//  (Locale.ENGLISH); // LUCENENET TODO: Fix API - we probably don't want to set Culture to a property
 
-            Query q = (Query)qp.Parse(query, "date");
+            Query q = qp.Parse(query, "date");
             ScoreDoc[] hits = @is.Search(q, null, 1000).ScoreDocs;
             assertEquals(expected, hits.Length);
         }
@@ -1409,7 +1409,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             IndexReader r = DirectoryReader.Open(w, true);
             IndexSearcher s = NewSearcher(r);
 
-            Query q = (Query)new StandardQueryParser(new CannedAnalyzer()).Parse("\"a\"", "field");
+            Query q = new StandardQueryParser(new CannedAnalyzer()).Parse("\"a\"", "field");
             assertTrue(q is MultiPhraseQuery);
             assertEquals(1, s.Search(q, 10).TotalHits);
             r.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/97a09054/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs
index cb9bfe5..5ceeff1 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestStandardQP.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
 
         public Query Parse(String query, StandardQueryParser qp)
         {
-            return (Query)qp.Parse(query, DefaultField);
+            return qp.Parse(query, DefaultField);
         }
 
 


Mime
View raw message