From 1b2d98dd3d8c471ddc5eaccd9c2f506e23cffae5 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 27 Mar 2014 16:27:05 +0100 Subject: [PATCH] DATAMONGO-890 - Fixed Point.toString(). The toString() representation no lists x,y instead of the previously (wrong latitude, longitude). --- .../data/mongodb/core/geo/Point.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Point.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Point.java index 16f3c8793..4734911a2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Point.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/Point.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,10 +30,8 @@ import org.springframework.util.Assert; */ public class Point { - @Field(order = 10) - private final double x; - @Field(order = 20) - private final double y; + @Field(order = 10) private final double x; + @Field(order = 20) private final double y; @PersistenceConstructor public Point(double x, double y) { @@ -69,9 +67,9 @@ public class Point { int result = 1; long temp; temp = Double.doubleToLongBits(x); - result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + (int) (temp ^ temp >>> 32); temp = Double.doubleToLongBits(y); - result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + (int) (temp ^ temp >>> 32); return result; } @@ -98,6 +96,6 @@ public class Point { @Override public String toString() { - return String.format("Point [latitude=%f, longitude=%f]", x, y); + return String.format("Point [x=%f, y=%f]", x, y); } }