@@ -113,6 +113,9 @@ public void checkBoundariesReferenceRecordsPrecision2() throws Exception {
113113 @ SuppressWarnings ("BusyWait" )
114114 private static void checkFile (@ Nonnull final String baseFileName ) throws Exception {
115115
116+ // High-precision means 8 digits.
117+ final int highPprecision = 8 ;
118+
116119 // Reset error count.
117120 final AtomicLong deltaNm = new AtomicLong (0 );
118121 final AtomicInteger errors = new AtomicInteger (0 );
@@ -166,7 +169,7 @@ public void run() {
166169 if (reference .mapcodes .size () != results .size ()) {
167170 final ArrayList <MapcodeRec > resultsConverted = new ArrayList <MapcodeRec >(results .size ());
168171 for (final Mapcode mapcode : results ) {
169- resultsConverted .add (new MapcodeRec (mapcode .getCode (2 ), mapcode .getTerritory ()));
172+ resultsConverted .add (new MapcodeRec (mapcode .getCode (highPprecision ), mapcode .getTerritory ()));
170173 }
171174 LOG .error ("checkFile: Incorrect number of results:" +
172175 "\n lat/lon = {}" +
@@ -185,7 +188,7 @@ public void run() {
185188 for (final Mapcode result : results ) {
186189 boolean found = false ;
187190 for (final MapcodeRec referenceMapcodeRec : reference .mapcodes ) {
188- precision = (referenceMapcodeRec .mapcode .lastIndexOf ('-' ) > 4 ) ? 2 : 0 ;
191+ precision = (referenceMapcodeRec .mapcode .lastIndexOf ('-' ) > 4 ) ? highPprecision : 0 ;
189192
190193 if (referenceMapcodeRec .territory .equals (result .getTerritory ())) {
191194 if (referenceMapcodeRec .mapcode .equals (result .getCode (precision ))) {
@@ -207,7 +210,7 @@ public void run() {
207210
208211 // For every Mapcode in the reference set, check if it is contained in the result set.
209212 for (final MapcodeRec referenceMapcodeRec : reference .mapcodes ) {
210- precision = (referenceMapcodeRec .mapcode .lastIndexOf ('-' ) > 4 ) ? 2 : 0 ;
213+ precision = (referenceMapcodeRec .mapcode .lastIndexOf ('-' ) > 4 ) ? highPprecision : 0 ;
211214 boolean found = false ;
212215 for (final Mapcode result : results ) {
213216 if (referenceMapcodeRec .territory .equals (result .getTerritory ())) {
@@ -237,7 +240,7 @@ public void run() {
237240 }
238241
239242 final long maxDeltaNm = (long ) (((mapcodeRec .mapcode .lastIndexOf ('-' ) > 4 ) ?
240- Mapcode .getSafeMaxOffsetInMeters (2 ) : Mapcode .getSafeMaxOffsetInMeters (0 )) * 1000000.0 );
243+ Mapcode .getSafeMaxOffsetInMeters (highPprecision ) : Mapcode .getSafeMaxOffsetInMeters (0 )) * 1000000.0 );
241244 if (distanceNm > maxDeltaNm ) {
242245 LOG .error ("Mapcode {} {} was generated for point {}, but decodes to point {} " +
243246 "which is {} meters from the original point (max is {} meters)." ,
0 commit comments