From a4bcfda237c906a0f7ca35cf1c313fc3af41beec Mon Sep 17 00:00:00 2001
From: Luc Maisonobe <luc@orekit.org>
Date: Fri, 12 Dec 2014 11:39:01 +0100
Subject: [PATCH] Fixed findbugs warnings.

---
 .../orekit/rugged/api/SensorPixelCrossing.java   |  2 +-
 .../org/orekit/rugged/raster/TilesCache.java     | 11 +++++++++--
 .../rugged/utils/NormalizedGeodeticPoint.java    | 16 ++++++++++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/orekit/rugged/api/SensorPixelCrossing.java b/src/main/java/org/orekit/rugged/api/SensorPixelCrossing.java
index 8325b951..1c3f85c2 100644
--- a/src/main/java/org/orekit/rugged/api/SensorPixelCrossing.java
+++ b/src/main/java/org/orekit/rugged/api/SensorPixelCrossing.java
@@ -35,7 +35,7 @@ import org.orekit.time.AbsoluteDate;
 class SensorPixelCrossing {
 
     /** Margin before and after end pixels, in order to avoid search failures near boundaries. */
-    private final double MARGIN = 5.0;
+    private static final double MARGIN = 5.0;
 
     /** Line sensor. */
     private final LineSensor sensor;
diff --git a/src/main/java/org/orekit/rugged/raster/TilesCache.java b/src/main/java/org/orekit/rugged/raster/TilesCache.java
index 4606083a..90123308 100644
--- a/src/main/java/org/orekit/rugged/raster/TilesCache.java
+++ b/src/main/java/org/orekit/rugged/raster/TilesCache.java
@@ -16,6 +16,7 @@
  */
 package org.orekit.rugged.raster;
 
+import java.io.Serializable;
 import java.lang.reflect.Array;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -341,7 +342,10 @@ public class TilesCache<T extends Tile> {
     }
 
     /** Comparator for sorting with respect to latitude. */
-    private static class LatitudeComparator implements Comparator<LatitudeProvider> {
+    private static class LatitudeComparator implements Comparator<LatitudeProvider>, Serializable {
+
+        /** Serializable UID. */
+        private static final long serialVersionUID = 20141212L;
 
         /** {@inheritDoc} */
         @Override
@@ -352,7 +356,10 @@ public class TilesCache<T extends Tile> {
     }
 
     /** Comparator for sorting with respect to longitude. */
-    private static class LongitudeComparator implements Comparator<LongitudeProvider> {
+    private static class LongitudeComparator implements Comparator<LongitudeProvider>, Serializable {
+
+        /** Serializable UID. */
+        private static final long serialVersionUID = 20141212L;
 
         /** {@inheritDoc} */
         @Override
diff --git a/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java b/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java
index e60879a6..4f181374 100644
--- a/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java
+++ b/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java
@@ -55,4 +55,20 @@ public class NormalizedGeodeticPoint extends GeodeticPoint {
         return normalizedLongitude;
     }
 
+    /** {@inheritDoc} */
+    @Override
+    public boolean equals(final Object object) {
+        // we override the method just to make it clear that we INTENTIONALLY
+        // consider normalized point are just similar to regular points
+        return super.equals(object);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public int hashCode() {
+        // we override the method just to make it clear that we INTENTIONALLY
+        // consider normalized point are just similar to regular points
+        return super.hashCode();
+    }
+
 }
-- 
GitLab