Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6E900200BEE for ; Fri, 25 Nov 2016 12:07:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6D583160B1D; Fri, 25 Nov 2016 11:07:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6C3BB160B22 for ; Fri, 25 Nov 2016 12:07:10 +0100 (CET) Received: (qmail 14014 invoked by uid 500); 25 Nov 2016 11:07:09 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 12787 invoked by uid 99); 25 Nov 2016 11:07:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2016 11:07:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BA1AEF17E1; Fri, 25 Nov 2016 11:07:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Date: Fri, 25 Nov 2016 11:07:27 -0000 Message-Id: <7ebbf9dae0d5446ba08eb9ebc9ae92a4@git.apache.org> In-Reply-To: <4b7d02e6d14e4335bbd00bdbef53edd9@git.apache.org> References: <4b7d02e6d14e4335bbd00bdbef53edd9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [22/26] lucenenet git commit: Spatial: Removed commented code that helped with the port archived-at: Fri, 25 Nov 2016 11:07:11 -0000 Spatial: Removed commented code that helped with the port Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/aa35405f Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/aa35405f Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/aa35405f Branch: refs/heads/master Commit: aa35405f94b5ffeef2357aa8e85b19fffa9d9b9b Parents: d21093a Author: Shad Storhaug Authored: Fri Nov 18 00:10:21 2016 +0700 Committer: Shad Storhaug Committed: Fri Nov 18 01:38:31 2016 +0700 ---------------------------------------------------------------------- .../Prefix/AbstractVisitingPrefixTreeFilter.cs | 2 - .../Prefix/Tree/QuadPrefixTree.cs | 4 - .../Serialized/SerializedDVStrategy.cs | 115 ------------------- .../Util/DistanceToShapeValueSource.cs | 21 ---- .../Util/ShapeFieldCacheProvider.cs | 5 - .../Util/ShapePredicateValueSource.cs | 20 ---- .../QueryEqualsHashCodeTest.cs | 23 ---- 7 files changed, 190 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs index 42c76d1..1286158 100644 --- a/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs +++ b/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs @@ -435,8 +435,6 @@ namespace Lucene.Net.Spatial.Prefix { get { - //Debug.Assert(cellIter.Current != null); - //vNode.Reset(cellIter.Current); return vNode; } } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs b/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs index 74dd43d..1222d27 100644 --- a/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs +++ b/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs @@ -121,10 +121,6 @@ namespace Lucene.Net.Spatial.Prefix.Tree { // Format the number to min 3 integer digits and exactly 5 fraction digits const string FORMAT_STR = @"000.00000"; - /*NumberFormat nf = NumberFormat.GetNumberInstance(CultureInfo.Root); - nf.SetMaximumFractionDigits(5); - nf.SetMinimumFractionDigits(5); - nf.SetMinimumIntegerDigits(3);*/ for (int i = 0; i < maxLevels; i++) { @out.WriteLine(i + "]\t" + levelW[i].ToString(FORMAT_STR) + "\t" + levelH[i].ToString(FORMAT_STR) + "\t" + http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs b/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs index ca383e9..33926ee 100644 --- a/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs +++ b/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs @@ -69,17 +69,6 @@ namespace Lucene.Net.Spatial.Serialized //this is a hack to avoid redundant byte array copying by byteStream.toByteArray() byteStream.WriteTo(new OutputStreamAnonymousHelper(bytesRef)); - - - // byteStream.WriteTo(new FilterOutputStream(null/*not used*/) { - // @Override - // public void write(byte[] b, int off, int len) throws IOException - // { - // bytesRef.bytes = b; - // bytesRef.offset = off; - // bytesRef.length = len; - // } - //}); } catch (IOException e) { @@ -157,42 +146,6 @@ namespace Lucene.Net.Spatial.Serialized public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs) { return new DocIdSetAnonymousHelper(this, context, acceptDocs); - - // return new DocIdSet() - // { - // @Override - // public DocIdSetIterator iterator() throws IOException - // { - // throw new UnsupportedOperationException( - // "Iteration is too slow; instead try FilteredQuery.QUERY_FIRST_FILTER_STRATEGY"); - // //Note that if you're truly bent on doing this, then see FunctionValues.getRangeScorer - // } - - // @Override - // public Bits bits() throws IOException - // { - // //null Map context -- we simply don't have one. That's ok. - // final FunctionValues predFuncValues = predicateValueSource.getValues(null, context); - - // return new Bits() - // { - - // @Override - // public boolean get(int index) - // { - // if (acceptDocs != null && !acceptDocs.get(index)) - // return false; - // return predFuncValues.boolVal(index); - // } - - // @Override - // public int length() - // { - // return context.reader().maxDoc(); - // } - //}; - // } - //}; } internal class DocIdSetAnonymousHelper : DocIdSet @@ -293,74 +246,6 @@ namespace Lucene.Net.Spatial.Serialized BinaryDocValues docValues = readerContext.AtomicReader.GetBinaryDocValues(fieldName); return new FuctionValuesAnonymousHelper(this, docValues); - - // return new FunctionValues() - //{ - // int bytesRefDoc = -1; - // BytesRef bytesRef = new BytesRef();//scratch - - // bool fillBytes(int doc) { - // if (bytesRefDoc != doc) - // { - // docValues.Get(doc, bytesRef); - // bytesRefDoc = doc; - // } - // return bytesRef.length != 0; - // } - - // @Override - // public boolean exists(int doc) - //{ - // return fillBytes(doc); - //} - - //@Override - // public boolean bytesVal(int doc, BytesRef target) - //{ - // if (fillBytes(doc)) - // { - // target.bytes = bytesRef.bytes; - // target.offset = bytesRef.offset; - // target.length = bytesRef.length; - // return true; - // } - // else - // { - // target.length = 0; - // return false; - // } - //} - - //@Override - // public Object objectVal(int docId) - //{ - // if (!fillBytes(docId)) - // return null; - // DataInputStream dataInput = new DataInputStream( - // new ByteArrayInputStream(bytesRef.bytes, bytesRef.offset, bytesRef.length)); - // try - // { - // return binaryCodec.readShape(dataInput); - // } - // catch (IOException e) - // { - // throw new RuntimeException(e); - // } - //} - - //@Override - // public Explanation explain(int doc) - //{ - // return new Explanation(Float.NaN, toString(doc)); - //} - - //@Override - // public String toString(int doc) - //{ - // return description() + "=" + objectVal(doc);//TODO truncate? - //} - - // }; } internal class FuctionValuesAnonymousHelper : FunctionValues http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs b/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs index 76fc7bd..c108e54 100644 --- a/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs +++ b/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs @@ -70,27 +70,6 @@ namespace Lucene.Net.Spatial.Util FunctionValues shapeValues = shapeValueSource.GetValues(context, readerContext); return new DoubleDocValuesAnonymousHelper(this, shapeValues); - - //return new DoubleDocValues(this) - // { - // @Override - // public double doubleVal(int doc) - // { - // Shape shape = (Shape)shapeValues.objectVal(doc); - // if (shape == null || shape.isEmpty()) - // return nullValue; - // Point pt = shape.getCenter(); - // return distCalc.distance(queryPoint, pt) * multiplier; - // } - - // @Override - // public Explanation explain(int doc) - // { - // Explanation exp = super.explain(doc); - // exp.addDetail(shapeValues.explain(doc)); - // return exp; - // } - //}; } internal class DoubleDocValuesAnonymousHelper : DoubleDocValues http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs b/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs index 8e8dbc8..4fba809 100644 --- a/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs +++ b/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs @@ -39,13 +39,8 @@ namespace Lucene.Net.Spatial.Util { //private Logger log = Logger.GetLogger(GetType().FullName); -#if !NET35 private readonly WeakDictionary> sidx = new WeakDictionary>(); -#else - private readonly WeakDictionary> sidx = - new WeakDictionary>(); -#endif protected internal readonly int defaultSize; protected internal readonly string shapeField; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs b/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs index 7f65893..8914343 100644 --- a/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs +++ b/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs @@ -70,26 +70,6 @@ namespace Lucene.Net.Spatial.Util FunctionValues shapeValues = shapeValuesource.GetValues(context, readerContext); return new BoolDocValuesAnonymousHelper(this, shapeValues); - - //return new BoolDocValues(this) - // { - // @Override - // public boolean boolVal(int doc) - // { - // Shape indexedShape = (Shape)shapeValues.objectVal(doc); - // if (indexedShape == null) - // return false; - // return op.evaluate(indexedShape, queryShape); - // } - - // @Override - // public Explanation explain(int doc) - // { - // Explanation exp = super.explain(doc); - // exp.addDetail(shapeValues.explain(doc)); - // return exp; - // } - //}; } internal class BoolDocValuesAnonymousHelper : BoolDocValues http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs b/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs index 25db926..33417b5 100644 --- a/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs +++ b/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs @@ -102,31 +102,8 @@ namespace Lucene.Net.Spatial SpatialArgs args1 = MakeArgs1(); SpatialArgs args2 = MakeArgs2(); TestEqualsHashcode(args1, args2, new ObjGeneratorQueryAnonymousHelper(strategy)); - // testEqualsHashcode(args1, args2, new ObjGenerator() { - // @Override - // public Object gen(SpatialArgs args) - // { - // return strategy.makeQuery(args); - // } - //}); TestEqualsHashcode(args1, args2, new ObjGeneratorFilterAnonymousHelper(strategy)); - // testEqualsHashcode(args1, args2, new ObjGenerator() - // { - // @Override - // public Object gen(SpatialArgs args) - // { - // return strategy.makeFilter(args); - // } - //}); TestEqualsHashcode(args1, args2, new ObjGeneratorDistanceValueSourceAnonymousHelper(strategy)); - // testEqualsHashcode(args1, args2, new ObjGenerator() - //{ - // @Override - // public Object gen(SpatialArgs args) - //{ - // return strategy.makeDistanceValueSource(args.getShape().getCenter()); - //} - // }); } private void TestEqualsHashcode(SpatialArgs args1, SpatialArgs args2, ObjGenerator generator)