diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java index 6e767b1737f4b1fd7d6298e8eb9c48b0f5705def..2f5a169564f60284975346c0c865ccedb3ddc314 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 fb22fd5d58c4322e0f935a74126c9842b4298328..2308472f7cd28059a2435011ed4781e192c1582e 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 98accfea1a8d160274ffda1df62ead21d62997bc..d4e4233712f770d87078de92551a4c85f95e5a06 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 17aaf40fb7ac0c4e67fd495a2af944196f4575c8..f7a6ba09e6c318da3933319069704415ee4a697d 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 decb81efaec6ae5c664585fbd09fbd67a207ae4b..829148b61a9983536aa7bb11a6ddebb17d59298f 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; } }