From d4372b8a0e8b8c97af606a1c5213ba59192352ef Mon Sep 17 00:00:00 2001 From: gprat <guylaine.prat@csgroup.eu> Date: Thu, 8 Dec 2022 16:00:20 +0100 Subject: [PATCH] Checkstyle corrections. --- checkstyle.xml | 12 +++++++++--- .../InterSensorsOptimizationProblemBuilder.java | 4 +++- .../java/org/orekit/rugged/errors/DumpManager.java | 4 +++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index 154548d4..b39d4a9c 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -42,10 +42,14 @@ <module name="MissingSwitchDefault"/> <module name="ModifierOrder"/> <module name="MultipleStringLiterals"> - <property name="ignoreStringsRegexp" value='^(("")|("."))$'/> + <property name="ignoreStringsRegexp" value='^(("")|(".")|("\\\\"))$'/> </module> <module name="MultipleVariableDeclarations"/> - <module name="NoWhitespaceAfter"/> + <module name="NoWhitespaceAfter"> + <property name="tokens" + value="AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, + ARRAY_DECLARATOR, INDEX_OP"/> + </module> <module name="NoWhitespaceBefore"/> <module name="OperatorWrap"> <property name="option" value="eol"/> @@ -56,12 +60,13 @@ <property name="severity" value="warning"/> </module> <module name="UnnecessaryParentheses"/> + <module name="NeedBraces"/> <module name="UnusedImports"/> <module name="VisibilityModifier"/> <module name="WhitespaceAfter"/> <module name="WhitespaceAround"> <property name="tokens" - value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, + value="ASSIGN, ARRAY_INIT, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, @@ -98,6 +103,7 @@ </module> <module name="RegexpHeader"> <property name="headerFile" value="${checkstyle.header.file}" /> + <property name="fileExtensions" value="java" /> </module> <module name="FileTabCharacter"/> <module name="NewlineAtEndOfFile"> diff --git a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java index fdddbed9..c5d5d793 100644 --- a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java @@ -137,7 +137,9 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB int i = 0; for (Iterator<Map.Entry<SensorPixel, SensorPixel>> gtIt = reference.getMapping().iterator(); gtIt.hasNext(); i++) { - if (i == reference.getMapping().size()) break; + if (i == reference.getMapping().size()) { + break; + } // Get LOS distance final Double losDistance = reference.getLosDistance(i); diff --git a/src/main/java/org/orekit/rugged/errors/DumpManager.java b/src/main/java/org/orekit/rugged/errors/DumpManager.java index 932e9b83..8b576bb2 100644 --- a/src/main/java/org/orekit/rugged/errors/DumpManager.java +++ b/src/main/java/org/orekit/rugged/errors/DumpManager.java @@ -114,7 +114,9 @@ public class DumpManager { */ public static void endNicely() { isSuspended = false; - if (isActive()) deactivate(); + if (isActive()) { + deactivate(); + } } -- GitLab