You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2017/03/01 22:10:54 UTC

svn commit: r1785052 - /sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java

Author: desruisseaux
Date: Wed Mar  1 22:10:54 2017
New Revision: 1785052

URL: http://svn.apache.org/viewvc?rev=1785052&view=rev
Log:
Verify that the latitude band is inside expected range.

Modified:
    sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java

Modified: sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java?rev=1785052&r1=1785051&r2=1785052&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java [UTF-8] Wed Mar  1 22:10:54 2017
@@ -1053,10 +1053,12 @@ parse:                  switch (part) {
                  * This estimation is needed because the 100 kilometres square identification is insufficient;
                  * we may need to add some multiple of 2000 kilometres (20 squares).
                  */
-                \u03bb0  = ZONER.centralMeridian(zone);
                 \u03c6s = latitudeBand * LATITUDE_BAND_HEIGHT + TransverseMercator.Zoner.SOUTH_BOUNDS;
+                if (latitudeBand < 0 || latitudeBand >= ROW_RESOLVER.length) {
+                    throw new GazetteerException(Resources.format(Resources.Keys.IllegalLatitudeBand_1, Encoder.latitudeBand(\u03c6s)));
+                }
+                \u03bb0  = ZONER.centralMeridian(zone);
                 crs = owner.projection(Math.signum(\u03c6s), \u03bb0);
-
                 final int info = ROW_RESOLVER[latitudeBand];        // Contains the above-cited northing value.
                 if (hasSquareIdentification) {
                     int rowBit = 1 << (row + NORTHING_BITS_COUNT);  // Bit mask of the row to check for existence.