nknize commented on a change in pull request #1258: LUCENE-9225: Rectangle should extend LatLonGeometry URL: https://github.com/apache/lucene-solr/pull/1258#discussion_r380381973
########## File path: lucene/core/src/java/org/apache/lucene/geo/Rectangle2D.java ########## @@ -415,16 +217,63 @@ public boolean equals(Object o) { return minX == that.minX && maxX == that.maxX && minY == that.minY && - maxY == that.maxY && - Arrays.equals(bbox, that.bbox) && - Arrays.equals(west, that.west); + maxY == that.maxY; } @Override public int hashCode() { int result = Objects.hash(minX, maxX, minY, maxY); - result = 31 * result + Arrays.hashCode(bbox); - result = 31 * result + Arrays.hashCode(west); return result; } -} + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("XYRectangle(x="); + sb.append(minX); + sb.append(" TO "); + sb.append(maxX); + sb.append(" y="); + sb.append(minY); + sb.append(" TO "); + sb.append(maxY); + sb.append(")"); + return sb.toString(); + } + + /** create a component2D from the provided XY rectangle */ + static Component2D create(XYRectangle rectangle) { + return new Rectangle2D(rectangle.minX, rectangle.maxX, rectangle.minY, rectangle.maxY); + } + + private static double MIN_LON_INCL_QUANTIZE = decodeLongitude(encodeLongitude(MIN_LON_INCL)); Review comment: ```suggestion private static double MIN_LON_INCL_QUANTIZE = decodeLongitude(GeoEncodingUtils.MIN_LON_ENCODED); ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org