| Index: lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java |
| IDEA additional info: |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| <+>UTF-8 |
| =================================================================== |
| --- lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java (revision 1391289) |
| +++ lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java (revision ) |
| @@ -19,7 +19,6 @@ |
| */ |
| |
| import com.spatial4j.core.context.SpatialContext; |
| -import com.spatial4j.core.io.ShapeReadWriter; |
| import com.spatial4j.core.io.sample.SampleData; |
| import com.spatial4j.core.io.sample.SampleDataReader; |
| import com.spatial4j.core.shape.Shape; |
| @@ -89,7 +88,7 @@ |
| Document document = new Document(); |
| document.add(new StringField("id", data.id, Field.Store.YES)); |
| document.add(new StringField("name", data.name, Field.Store.YES)); |
| - Shape shape = new ShapeReadWriter(ctx).readShape(data.shape); |
| + Shape shape = ctx.readShape(data.shape); |
| shape = convertShapeFromGetDocuments(shape); |
| if (shape != null) { |
| for (Field f : strategy.createIndexableFields(shape)) { |
| @@ -130,7 +129,7 @@ |
| SearchResults got = executeQuery(strategy.makeQuery(q.args), 100); |
| if (storeShape && got.numFound > 0) { |
| //check stored value is there & parses |
| - assertNotNull(new ShapeReadWriter(ctx).readShape(got.results.get(0).document.get(strategy.getFieldName()))); |
| + assertNotNull(ctx.readShape(got.results.get(0).document.get(strategy.getFieldName()))); |
| } |
| if (concern.orderIsImportant) { |
| Iterator<String> ids = q.ids.iterator(); |
| @@ -174,7 +173,7 @@ |
| } |
| |
| protected void adoc(String id, String shapeStr) throws IOException { |
| - Shape shape = shapeStr==null ? null : new ShapeReadWriter(ctx).readShape(shapeStr); |
| + Shape shape = shapeStr==null ? null : ctx.readShape(shapeStr); |
| addDocument(newDoc(id, shape)); |
| } |
| protected void adoc(String id, Shape shape) throws IOException { |
| Index: lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialArgsParser.java |
| IDEA additional info: |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| <+>UTF-8 |
| =================================================================== |
| --- lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialArgsParser.java (revision 1391289) |
| +++ lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialArgsParser.java (revision ) |
| @@ -86,7 +86,7 @@ |
| throw new IllegalArgumentException("missing body : " + v, null); |
| } |
| |
| - Shape shape = new ShapeReadWriter(ctx).readShape(body); |
| + Shape shape = ctx.readShape(body); |
| SpatialArgs args = new SpatialArgs(op, shape); |
| |
| if (v.length() > (edx + 1)) { |
| Index: lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java |
| IDEA additional info: |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| <+>UTF-8 |
| =================================================================== |
| --- lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java (revision 1391289) |
| +++ lucene/spatial/src/test/org/apache/lucene/spatial/SpatialExample.java (revision ) |
| @@ -19,7 +19,6 @@ |
| |
| import com.spatial4j.core.context.SpatialContext; |
| import com.spatial4j.core.distance.DistanceUtils; |
| -import com.spatial4j.core.io.ShapeReadWriter; |
| import com.spatial4j.core.shape.Point; |
| import com.spatial4j.core.shape.Shape; |
| import org.apache.lucene.document.Document; |
| @@ -111,7 +110,7 @@ |
| //When parsing a string to a shape, the presence of a comma means it's y-x |
| // order (lon, lat) |
| indexWriter.addDocument(newSampleDocument( |
| - 4, new ShapeReadWriter(ctx).readShape("-50.7693246, 60.9289094"))); |
| + 4, ctx.readShape("-50.7693246, 60.9289094"))); |
| |
| indexWriter.addDocument(newSampleDocument( |
| 20, ctx.makePoint(0.1,0.1), ctx.makePoint(0, 0))); |
| Index: lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java |
| IDEA additional info: |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| <+>UTF-8 |
| =================================================================== |
| --- lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java (revision 1391289) |
| +++ lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java (revision ) |
| @@ -21,7 +21,6 @@ |
| import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; |
| import com.spatial4j.core.context.SpatialContext; |
| import com.spatial4j.core.distance.DistanceUtils; |
| -import com.spatial4j.core.io.ShapeReadWriter; |
| import com.spatial4j.core.shape.Point; |
| import com.spatial4j.core.shape.Shape; |
| import org.apache.lucene.search.FilteredQuery; |
| @@ -162,7 +161,7 @@ |
| |
| private void _checkHits(boolean bbox, String ptStr, double distKM, int assertNumFound, int... assertIds) { |
| SpatialOperation op = SpatialOperation.Intersects; |
| - Point pt = (Point) new ShapeReadWriter(ctx).readShape(ptStr); |
| + Point pt = (Point) ctx.readShape(ptStr); |
| double distDEG = DistanceUtils.dist2Degrees(distKM, DistanceUtils.EARTH_MEAN_RADIUS_KM); |
| Shape shape = ctx.makeCircle(pt, distDEG); |
| if (bbox) |