From dae7181a97122271aab316cd2776621ad333716c Mon Sep 17 00:00:00 2001 From: Tim Grein Date: Tue, 14 May 2024 16:31:34 +0200 Subject: [PATCH] Align toString methods in geo module (#13302) * Align toString methods in geo module --- lucene/core/src/java/org/apache/lucene/geo/Circle.java | 2 +- lucene/core/src/java/org/apache/lucene/geo/Line.java | 2 +- lucene/core/src/java/org/apache/lucene/geo/Polygon.java | 1 + lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java | 2 +- lucene/core/src/java/org/apache/lucene/geo/XYCircle.java | 2 +- lucene/core/src/java/org/apache/lucene/geo/XYLine.java | 2 +- lucene/core/src/java/org/apache/lucene/geo/XYPoint.java | 2 +- lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java | 1 + 8 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/geo/Circle.java b/lucene/core/src/java/org/apache/lucene/geo/Circle.java index 07c2fc5b25c..9d5357a7111 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Circle.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Circle.java @@ -93,7 +93,7 @@ public final class Circle extends LatLonGeometry { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("CIRCLE("); + sb.append("Circle("); sb.append("[" + lat + "," + lon + "]"); sb.append(" radius = " + radiusMeters + " meters"); sb.append(')'); diff --git a/lucene/core/src/java/org/apache/lucene/geo/Line.java b/lucene/core/src/java/org/apache/lucene/geo/Line.java index 0cf6662883f..bf19deadc77 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Line.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Line.java @@ -134,7 +134,7 @@ public class Line extends LatLonGeometry { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("LINE("); + sb.append("Line("); for (int i = 0; i < lats.length; i++) { sb.append("[").append(lons[i]).append(", ").append(lats[i]).append("]"); } diff --git a/lucene/core/src/java/org/apache/lucene/geo/Polygon.java b/lucene/core/src/java/org/apache/lucene/geo/Polygon.java index cd9dd14d7ad..3abe29dca0f 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Polygon.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Polygon.java @@ -208,6 +208,7 @@ public final class Polygon extends LatLonGeometry { @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Polygon"); for (int i = 0; i < polyLats.length; i++) { sb.append("[").append(polyLats[i]).append(", ").append(polyLons[i]).append("] "); } diff --git a/lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java b/lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java index 9fb4b552075..664c0a733af 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java +++ b/lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java @@ -274,7 +274,7 @@ final class Rectangle2D implements Component2D { @Override public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("XYRectangle(x="); + sb.append("Rectangle2D(x="); sb.append(minX); sb.append(" TO "); sb.append(maxX); diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java b/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java index 88d163b5f79..5916e8b2e2a 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYCircle.java @@ -94,7 +94,7 @@ public final class XYCircle extends XYGeometry { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("CIRCLE("); + sb.append("XYCircle("); sb.append("[" + x + "," + y + "]"); sb.append(" radius = " + radius); sb.append(')'); diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYLine.java b/lucene/core/src/java/org/apache/lucene/geo/XYLine.java index 513a779ed15..dab8f0d6471 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYLine.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYLine.java @@ -126,7 +126,7 @@ public class XYLine extends XYGeometry { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("XYLINE("); + sb.append("XYLine("); for (int i = 0; i < x.length; i++) { sb.append("[").append(x[i]).append(", ").append(y[i]).append("]"); } diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java b/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java index d261f5dbd14..033ac681850 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYPoint.java @@ -78,7 +78,7 @@ public final class XYPoint extends XYGeometry { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Point("); + sb.append("XYPoint("); sb.append(x); sb.append(","); sb.append(y); diff --git a/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java b/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java index 1b3bbb72234..ef55e52d339 100644 --- a/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java +++ b/lucene/core/src/java/org/apache/lucene/geo/XYPolygon.java @@ -187,6 +187,7 @@ public final class XYPolygon extends XYGeometry { @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("XYPolygon"); for (int i = 0; i < x.length; i++) { sb.append("[").append(x[i]).append(", ").append(y[i]).append("] "); }