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 2016/06/16 11:22:28 UTC
svn commit: r1748687 - in /sis/branches/JDK7: ./
core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
Author: desruisseaux
Date: Thu Jun 16 11:22:27 2016
New Revision: 1748687
URL: http://svn.apache.org/viewvc?rev=1748687&view=rev
Log:
Merge the fix for a test failure.
Modified:
sis/branches/JDK7/ (props changed)
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 16 11:22:27 2016
@@ -1,4 +1,4 @@
/sis/branches/Android:1430670-1480699
/sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1748678
+/sis/branches/JDK8:1584960-1748686
/sis/trunk:1394364-1508466,1519089-1519674
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java?rev=1748687&r1=1748686&r2=1748687&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java [UTF-8] Thu Jun 16 11:22:27 2016
@@ -213,7 +213,7 @@ final class EPSGFactoryFallback extends
* @return the requested object.
* @throws NoSuchAuthorityCodeException if no matching object has been found.
*/
- private IdentifiedObject predefined(final String code, final int kind) throws NoSuchAuthorityCodeException {
+ private IdentifiedObject predefined(String code, final int kind) throws NoSuchAuthorityCodeException {
NumberFormatException cause = null;
try {
/*
@@ -223,9 +223,8 @@ final class EPSGFactoryFallback extends
* is used directly (not through MultiAuthoritiesFactory), which should be rare. The main case is
* when using the factory returned by AuthorityFactories.fallback(\u2026).
*/
- final int n = Integer.parseInt(CharSequences.trimWhitespaces(code,
- code.lastIndexOf(DefaultNameSpace.DEFAULT_SEPARATOR) + 1,
- code.length()).toString());
+ code = CharSequences.trimWhitespaces(code, code.lastIndexOf(DefaultNameSpace.DEFAULT_SEPARATOR) + 1, code.length()).toString();
+ final int n = Integer.parseInt(code);
if ((kind & PRIME_MERIDIAN) != 0 && n == 8901) {
return CommonCRS.WGS84.primeMeridian();
}
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java?rev=1748687&r1=1748686&r2=1748687&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java [UTF-8] Thu Jun 16 11:22:27 2016
@@ -16,11 +16,11 @@
*/
package org.apache.sis.referencing;
+import org.opengis.util.FactoryException;
+import org.opengis.referencing.NoSuchAuthorityCodeException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.GeodeticCRS;
import org.opengis.referencing.crs.SingleCRS;
-import org.opengis.util.FactoryException;
-import org.opengis.util.NoSuchIdentifierException;
import org.apache.sis.referencing.crs.DefaultCompoundCRS;
import org.apache.sis.referencing.crs.DefaultGeographicCRS;
import org.apache.sis.referencing.crs.HardCodedCRS;
@@ -109,15 +109,15 @@ public final strictfp class CRSTest exte
/**
* Test {@link CRS#forCode(String)} with values that should be invalid.
*
- * @throws FactoryException if an error other than {@link NoSuchIdentifierException} happened.
+ * @throws FactoryException if an error other than {@link NoSuchAuthorityCodeException} happened.
*/
@Test
public void testForInvalidCode() throws FactoryException {
try {
CRS.forCode("EPSG:4");
fail("Should not find EPSG:4");
- } catch (NoSuchIdentifierException e) {
- assertEquals("4", e.getIdentifierCode());
+ } catch (NoSuchAuthorityCodeException e) {
+ assertEquals("4", e.getAuthorityCode());
}
}