From 7d189f860d62a50e47792e12ffc93cc46b3be0b6 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Mon, 25 Oct 2021 14:07:36 +0200 Subject: [PATCH] Fixed checkstyle warnings. --- src/main/java/org/orekit/rugged/api/Rugged.java | 10 +++++----- .../java/org/orekit/rugged/errors/DumpReplayer.java | 4 ++-- .../java/org/orekit/rugged/errors/RuggedMessages.java | 6 +++--- .../rugged/refraction/AtmosphericRefraction.java | 6 +++--- .../orekit/rugged/utils/SpacecraftToObservedBody.java | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java index 6e767b17..2f5a1695 100644 --- a/src/main/java/org/orekit/rugged/api/Rugged.java +++ b/src/main/java/org/orekit/rugged/api/Rugged.java @@ -686,7 +686,7 @@ public class Rugged { // =========================================== // Need to be computed only once for a given sensor (with the same minLine and maxLine) if (atmosphericRefraction.getBifPixel() == null || atmosphericRefraction.getBifLine() == null || // lazy evaluation - (!atmosphericRefraction.isSameContext(sensorName, minLine, maxLine))) { // Must be recomputed if the context changed + !atmosphericRefraction.isSameContext(sensorName, minLine, maxLine)) { // Must be recomputed if the context changed // Definition of a regular grid (at sensor level) atmosphericRefraction.configureCorrectionGrid(sensor, minLine, maxLine); @@ -814,10 +814,10 @@ public class Rugged { } // Check if the pixel is inside the sensor (with a margin) OR if the inverse location was impossible (null result) - if ((sensorPixelGrid[uIndex][vIndex] != null && - (sensorPixelGrid[uIndex][vIndex].getPixelNumber() < (-INVLOC_MARGIN) || - sensorPixelGrid[uIndex][vIndex].getPixelNumber() > (INVLOC_MARGIN + sensor.getNbPixels() - 1))) || - (sensorPixelGrid[uIndex][vIndex] == null) ) { + if (sensorPixelGrid[uIndex][vIndex] != null && + (sensorPixelGrid[uIndex][vIndex].getPixelNumber() < -INVLOC_MARGIN || + sensorPixelGrid[uIndex][vIndex].getPixelNumber() > (INVLOC_MARGIN + sensor.getNbPixels() - 1)) || + sensorPixelGrid[uIndex][vIndex] == null) { // In order for the dump to end nicely DumpManager.endNicely(); // Impossible to find the point in the given min line diff --git a/src/main/java/org/orekit/rugged/errors/DumpReplayer.java b/src/main/java/org/orekit/rugged/errors/DumpReplayer.java index fb22fd5d..2308472f 100644 --- a/src/main/java/org/orekit/rugged/errors/DumpReplayer.java +++ b/src/main/java/org/orekit/rugged/errors/DumpReplayer.java @@ -1072,8 +1072,8 @@ public class DumpReplayer { public boolean isInterpolable(final double latitude, final double longitude) { final int latitudeIndex = (int) FastMath.floor((latitude - minLatitude) / latitudeStep); final int longitudeIndex = (int) FastMath.floor((longitude - minLongitude) / longitudeStep); - return (latitudeIndex >= 0) && (latitudeIndex <= latitudeRows - 2) && - (longitudeIndex >= 0) && (longitudeIndex <= longitudeColumns - 2); + return latitudeIndex >= 0 && latitudeIndex <= latitudeRows - 2 && + longitudeIndex >= 0 && longitudeIndex <= longitudeColumns - 2; } /** Update the tile according to the Digital Elevation Model. diff --git a/src/main/java/org/orekit/rugged/errors/RuggedMessages.java b/src/main/java/org/orekit/rugged/errors/RuggedMessages.java index 98accfea..d4e42337 100644 --- a/src/main/java/org/orekit/rugged/errors/RuggedMessages.java +++ b/src/main/java/org/orekit/rugged/errors/RuggedMessages.java @@ -116,9 +116,9 @@ public enum RuggedMessages implements Localizable { ResourceBundle.getBundle(RESOURCE_BASE_NAME, locale, new UTF8Control()); if (bundle.getLocale().getLanguage().equals(locale.getLanguage())) { final String translated = bundle.getString(name()); - if ((translated != null) && - (translated.length() > 0) && - (!translated.toLowerCase(locale).contains("missing translation"))) { + if (translated != null && + translated.length() > 0 && + !translated.toLowerCase(locale).contains("missing translation")) { // the value of the resource is the translated format return translated; } diff --git a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java index 17aaf40f..f7a6ba09 100644 --- a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java +++ b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java @@ -120,9 +120,9 @@ public abstract class AtmosphericRefraction { */ public Boolean isSameContext(final String sensorName, final int minLine, final int maxLine) { - return (Double.compare(atmosphericParams.getMinLineSensor(), minLine) == 0) && - (Double.compare(atmosphericParams.getMaxLineSensor(), maxLine) == 0) && - (atmosphericParams.getSensorName().compareTo(sensorName) == 0); + return Double.compare(atmosphericParams.getMinLineSensor(), minLine) == 0 && + Double.compare(atmosphericParams.getMaxLineSensor(), maxLine) == 0 && + atmosphericParams.getSensorName().compareTo(sensorName) == 0; } /** Get the computation parameters. diff --git a/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java b/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java index decb81ef..829148b6 100644 --- a/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java +++ b/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java @@ -300,8 +300,8 @@ public class SpacecraftToObservedBody implements Serializable { * @return true if date is in the supported range */ public boolean isInRange(final AbsoluteDate date) { - return (minDate.durationFrom(date) <= overshootTolerance) && - (date.durationFrom(maxDate) <= overshootTolerance); + return minDate.durationFrom(date) <= overshootTolerance && + date.durationFrom(maxDate) <= overshootTolerance; } } -- GitLab