sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1748699 [1/2] - in /sis/branches/JDK6: ./ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-console/src/test/java/org/apache/sis/console/ application/sis-console/src/test/java/org/apache/sis/test/suite/ applicat...
Date Thu, 16 Jun 2016 12:19:27 GMT
Author: desruisseaux
Date: Thu Jun 16 12:19:26 2016
New Revision: 1748699

URL: http://svn.apache.org/viewvc?rev=1748699&view=rev
Log:
Merge from the JDK7 branch. Include a first draft of OpenOffice add-ins.

Added:
    sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java
      - copied, changed from r1748682, sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java
    sis/branches/JDK6/application/sis-openoffice/
      - copied from r1748682, sis/branches/JDK7/application/sis-openoffice/
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/
      - copied from r1748682, sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/
    sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/CodeType.java
      - copied, changed from r1748682, sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/CodeType.java
    sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/CodeTypeTest.java
      - copied unchanged from r1748682, sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/CodeTypeTest.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/CRSCommand.java
    sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/IdentifierCommand.java
    sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/MetadataCommand.java
    sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java
    sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataCommandTest.java
    sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/test/suite/ConsoleTestSuite.java
    sis/branches/JDK6/application/sis-openoffice/pom.xml
    sis/branches/JDK6/application/sis-openoffice/src/main/unopkg/sis.png   (props changed)
    sis/branches/JDK6/core/sis-build-helper/pom.xml
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java
    sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGInstaller.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AuthorityFactoriesTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/EPSGFactoryFallbackTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemRegistry.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/Modules.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/LogRecordCollector.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
    sis/branches/JDK6/pom.xml
    sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
    sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 16 12:19:26 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
-/sis/branches/JDK7:1394913-1746055
-/sis/branches/JDK8:1584960-1746054
+/sis/branches/JDK7:1394913-1748694
+/sis/branches/JDK8:1584960-1748692
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/CRSCommand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/CRSCommand.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/CRSCommand.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/CRSCommand.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -37,7 +37,7 @@ import org.apache.sis.io.wkt.Convention;
  */
 final class CRSCommand extends MetadataCommand {
     /**
-     * Creates the {@code "metadata"}, {@code "crs"} or {@code "identifier"} sub-command.
+     * Creates the {@code "crs"} sub-command.
      */
     CRSCommand(final int commandIndex, final String... args) throws InvalidOptionException {
         super(commandIndex, args);

Modified: sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/IdentifierCommand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/IdentifierCommand.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/IdentifierCommand.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/IdentifierCommand.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -91,7 +91,7 @@ final class IdentifierCommand extends Me
     }
 
     /**
-     * Creates the {@code "metadata"}, {@code "crs"} or {@code "identifier"} sub-command.
+     * Creates the {@code "identifier"} sub-command.
      */
     IdentifierCommand(final int commandIndex, final String... args) throws InvalidOptionException {
         super(commandIndex, args);

Modified: sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/MetadataCommand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/MetadataCommand.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/MetadataCommand.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/MetadataCommand.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -16,11 +16,8 @@
  */
 package org.apache.sis.console;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Set;
 import java.io.Console;
 import java.io.IOException;
 import javax.xml.bind.Marshaller;
@@ -39,6 +36,7 @@ import org.apache.sis.referencing.CRS;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStores;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.internal.storage.CodeType;
 import org.apache.sis.util.collection.TableColumn;
 import org.apache.sis.util.collection.TreeTable;
 import org.apache.sis.util.collection.TreeTableFormat;
@@ -58,18 +56,6 @@ import org.apache.sis.xml.XML;
  */
 class MetadataCommand extends CommandRunner {
     /**
-     * The protocol part of the filename to be recognized as a CRS authority.
-     * In such case, this class will delegate to {@link CRS#forCode(String)}
-     * instead of opening the file.
-     */
-    static final Set<String> AUTHORITIES = new HashSet<String>(Arrays.asList("URN", "EPSG", "CRS", "AUTO", "AUTO2"));
-
-    /**
-     * Length of the longest authority name declared in {@link #AUTHORITIES}.
-     */
-    static final int MAX_AUTHORITY_LENGTH = 5;
-
-    /**
      * The output format.
      */
     static enum Format {
@@ -142,39 +128,7 @@ class MetadataCommand extends CommandRun
     }
 
     /**
-     * Returns {@code true} if the given argument begins with one of the known authorities
-     * ("URN", "EPSG", "CRS", "AUTO", <i>etc.</i>).
-     */
-    static boolean isAuthorityCode(final String code) {
-        final char[] authority = new char[MAX_AUTHORITY_LENGTH];
-        final int length = code.length();
-        int p = 0, i = 0;
-        while (i < length) {
-            final int c = code.codePointAt(i);
-            if (c == ':') {
-                if (!AUTHORITIES.contains(new String(authority, 0, p))) {
-                    break;
-                }
-                return true;
-            }
-            if (!Character.isWhitespace(c)) {
-                if (p >= MAX_AUTHORITY_LENGTH || !Character.isLetterOrDigit(c)) {
-                    break;
-                }
-                /*
-                 * Casting to char is okay because AUTHORITIES contains only ASCII values.
-                 * If 'c' was a supplemental Unicode value, then the result of the cast
-                 * would not match any AUTHORITIES value anyway.
-                 */
-                authority[p++] = (char) Character.toUpperCase(c);
-            }
-            i += Character.charCount(c);
-        }
-        return false;
-    }
-
-    /**
-     * If the given argument begins with one of the known authorities ("URN", "EPSG", "CRS", "AUTO", <i>etc.</i>),
+     * If the given argument seems to be an authority code ("URN", "EPSG", "CRS", "AUTO", <i>etc.</i>),
      * delegates to {@link CRS#forCode(String)}. Otherwise reads the metadata using a datastore.
      *
      * @return A {@link Metadata} or {@link CoordinateReferenceSystem} instance, or {@code null} if none.
@@ -192,7 +146,7 @@ class MetadataCommand extends CommandRun
             return null;
         } else {
             final String file = files.get(0);
-            if (isAuthorityCode(file)) {
+            if (CodeType.guess(file).isCRS) {
                 return CRS.forCode(file);
             } else {
                 final DataStore store = DataStores.open(file);

Modified: sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -53,6 +53,7 @@ import org.apache.sis.geometry.Immutable
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.referencing.DirectPositionView;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
+import org.apache.sis.internal.storage.CodeType;
 import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.CRS;
@@ -164,7 +165,7 @@ final class TransformCommand extends Met
             final String name = option.label();
             throw new InvalidOptionException(Errors.format(Errors.Keys.MissingValueForOption_1, name), name);
         }
-        if (isAuthorityCode(identifier)) try {
+        if (CodeType.guess(identifier).isCRS) try {
             return CRS.forCode(identifier);
         } catch (NoSuchAuthorityCodeException e) {
             final String name = option.label();

Copied: sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java (from r1748682, sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java?p2=sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java&p1=sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java&r1=1748682&r2=1748699&rev=1748699&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/CRSCommandTest.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -21,7 +21,7 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.apache.sis.test.Assert.*;
+import static org.junit.Assert.*;
 
 
 /**
@@ -35,20 +35,20 @@ import static org.apache.sis.test.Assert
 @DependsOn(CommandRunnerTest.class)
 public final strictfp class CRSCommandTest extends TestCase {
     /**
-     * The Well Known Text for EPSG:4326.
+     * The Well Known Text for EPSG:4326 as a regular expression.
      */
     private static final String WGS84 =
-            "GeodeticCRS[\"WGS 84\",\n" +
+            "\\QGeodeticCRS[\"WGS 84\",\n" +
             "  Datum[\"World Geodetic System 1984\",\n" +
             "    Ellipsoid[\"WGS 84\", 6378137.0, 298.257223563]],\n" +
             "  CS[ellipsoidal, 2],\n" +
             "    Axis[\"Latitude (B)\", north],\n" +
             "    Axis[\"Longitude (L)\", east],\n" +
             "    Unit[\"degree\", 0.017453292519943295],\n" +
-            "  Scope[\"Horizontal component of 3D system. Used by the GPS satellite navigation system and for NATO military geodetic surveying.\"],\n" +
-            "  Area[\"World.\"],\n" +
+            "  Scope[\"Horizontal component of 3D system.\\E.*\\Q\"],\n" +                      // EPSG geodetic dataset provides more details here.
+            "  Area[\"\\E.*\\Q\"],\n" +                                                         // Language may vary because of SIS localization.
             "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
-            "  Id[\"EPSG\", 4326, \"8.9\", URI[\"urn:ogc:def:crs:EPSG:8.9:4326\"]]]\n";
+            "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E";  // Version number of EPSG dataset may vary.
 
     /**
      * Tests fetching the CRS from a simple code ({@code "EPSG:4326"}).
@@ -59,7 +59,8 @@ public final strictfp class CRSCommandTe
     public void testCode() throws Exception {
         final CRSCommand test = new CRSCommand(0, CommandRunner.TEST, "EPSG:4326");
         test.run();
-        assertMultilinesEquals(WGS84, test.outputBuffer.toString());
+        final String wkt = test.outputBuffer.toString();
+        assertTrue(wkt, wkt.matches(WGS84));
     }
 
     /**
@@ -72,7 +73,8 @@ public final strictfp class CRSCommandTe
     public void testURN() throws Exception {
         final CRSCommand test = new CRSCommand(0, CommandRunner.TEST, "urn:ogc:def:crs:epsg::4326");
         test.run();
-        assertMultilinesEquals(WGS84, test.outputBuffer.toString());
+        final String wkt = test.outputBuffer.toString();
+        assertTrue(wkt, wkt.matches(WGS84));
     }
 
     /**
@@ -85,6 +87,7 @@ public final strictfp class CRSCommandTe
     public void testHTTP() throws Exception {
         final CRSCommand test = new CRSCommand(0, CommandRunner.TEST, "http://www.opengis.net/gml/srs/epsg.xml#4326");
         test.run();
-        assertMultilinesEquals(WGS84, test.outputBuffer.toString());
+        final String wkt = test.outputBuffer.toString();
+        assertTrue(wkt, wkt.matches(WGS84));
     }
 }

Modified: sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataCommandTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataCommandTest.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataCommandTest.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/console/MetadataCommandTest.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -37,22 +37,9 @@ import static org.junit.Assert.*;
 @DependsOn(CommandRunnerTest.class)
 public final strictfp class MetadataCommandTest extends TestCase {
     /**
-     * Verifies the {@link MetadataCommand#MAX_AUTHORITY_LENGTH} value.
-     */
-    @Test
-    public void verifyMaxAuthorityLength() {
-        int length = 0;
-        for (final String authority : MetadataCommand.AUTHORITIES) {
-            final int c = authority.length();
-            if (c > length) length = c;
-        }
-        assertEquals("MAX_AUTHORITY_LENGTH", length, MetadataCommand.MAX_AUTHORITY_LENGTH);
-    }
-
-    /**
      * Tests the sub-command on a NetCDF file.
      *
-     * @throws Exception Should never happen.
+     * @throws Exception if an error occurred while creating the command.
      */
     @Test
     public void testNetCDF() throws Exception {
@@ -78,7 +65,7 @@ public final strictfp class MetadataComm
     /**
      * Tests with the same file than {@link #testNetCDF()}, but producing a XML output.
      *
-     * @throws Exception Should never happen.
+     * @throws Exception if an error occurred while creating the command.
      */
     @Test
     @DependsOnMethod("testNetCDF")

Modified: sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/test/suite/ConsoleTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/test/suite/ConsoleTestSuite.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/test/suite/ConsoleTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/test/java/org/apache/sis/test/suite/ConsoleTestSuite.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -26,7 +26,7 @@ import org.junit.BeforeClass;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  */
 @Suite.SuiteClasses({
@@ -34,7 +34,8 @@ import org.junit.BeforeClass;
     org.apache.sis.console.HelpCommandTest.class,
     org.apache.sis.console.AboutCommandTest.class,
     org.apache.sis.console.MimeTypeCommandTest.class,
-    org.apache.sis.console.MetadataCommandTest.class
+    org.apache.sis.console.MetadataCommandTest.class,
+    org.apache.sis.console.CRSCommandTest.class
 })
 public final strictfp class ConsoleTestSuite extends TestSuite {
     /**

Modified: sis/branches/JDK6/application/sis-openoffice/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-openoffice/pom.xml?rev=1748699&r1=1748682&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-openoffice/pom.xml (original)
+++ sis/branches/JDK6/application/sis-openoffice/pom.xml Thu Jun 16 12:19:26 2016
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>application</artifactId>
-    <version>0.8-jdk7-SNAPSHOT</version>
+    <version>0.8-jdk6-SNAPSHOT</version>
   </parent>
 
 

Propchange: sis/branches/JDK6/application/sis-openoffice/src/main/unopkg/sis.png
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 16 12:19:26 2016
@@ -2,6 +2,7 @@
 /sis/branches/Android/src/site/resources/images/banner.png:1430670-1480699
 /sis/branches/JDK6/application/sis-openoffice/src/main/unopkg/sis.png:1394913-1508480
 /sis/branches/JDK6/src/site/resources/images/banner.png:1394913-1498321
-/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/sis.png:1584960-1746656,1747178-1748678
+/sis/branches/JDK7/application/sis-openoffice/src/main/unopkg/sis.png:1394913-1746055,1748682
+/sis/branches/JDK8/application/sis-openoffice/src/main/unopkg/sis.png:1584960-1748678
 /sis/trunk/application/sis-openoffice/src/main/unopkg/sis.png:1394364-1508466,1519089-1519674
 /sis/trunk/src/site/resources/images/banner.png:1394364-1498284

Modified: sis/branches/JDK6/core/sis-build-helper/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/pom.xml?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/pom.xml (original)
+++ sis/branches/JDK6/core/sis-build-helper/pom.xml Thu Jun 16 12:19:26 2016
@@ -45,9 +45,9 @@
   <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
        The leading space after the first line is necessary for proper formatting. -->
 Define Maven Mojos and Javadoc taglets for generating resource files
- or formatting the Javadoc. While any project could use it, this module
- is primarily for internal use by Apache SIS and may change in any
- future version.
+ formatting the Javadoc or creating ".oxt" files for OpenOffice.org.
+ While any project could use it, this module is primarily for internal
+ use by Apache SIS and may change in any future version.
   </description>
 
 
@@ -108,12 +108,12 @@ Define Maven Mojos and Javadoc taglets f
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-core</artifactId>
-      <version>3.3.3</version>
+      <version>3.3.9</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>3.3.3</version>
+      <version>3.3.9</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugin-tools</groupId>

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -92,7 +92,7 @@ public class Assembler extends AbstractM
                  * have been zipped.  Now generate the Pack200 file and zip it directly (without creating
                  * a temporary "sis.pack.gz" file).
                  */
-                final Packer packer = new Packer(project.getName(), project.getUrl(), version, targetDirectory);
+                final Packer packer = new Packer(project.getName(), version, targetDirectory);
                 final ZipArchiveEntry entry = new ZipArchiveEntry(
                         artifactBase + '/' + LIB_DIRECTORY + '/' + FATJAR_FILE + PACK_EXTENSION);
                 entry.setMethod(ZipArchiveEntry.STORED);

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/BundleCreator.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -74,7 +74,7 @@ public class BundleCreator extends Abstr
         }
         final String version = project.getVersion();
         try {
-            final Packer packer = new Packer(project.getName(), project.getUrl(), version, targetDirectory);
+            final Packer packer = new Packer(project.getName(), version, targetDirectory);
             packer.preparePack200(FINALNAME_PREFIX + version + ".jar").pack();
         } catch (IOException e) {
             throw new MojoExecutionException(e.getLocalizedMessage(), e);

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -118,11 +118,10 @@ final class PackOutput implements Closea
      * Opens the given JAR file for writing and creates its manifest.
      *
      * @param  projectName The project name, or {@code null} if none.
-     * @param  projectURL  The project URL, or {@code null} if none.
      * @param  version     The project version, or {@code null} if none.
      * @throws IOException if the file can't be open.
      */
-    void open(final String projectName, final String projectURL, final String version) throws IOException {
+    void open(final String projectName, final String version) throws IOException {
         final Manifest manifest = new Manifest();
         Attributes attributes = manifest.getMainAttributes();
         attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0");
@@ -132,9 +131,6 @@ final class PackOutput implements Closea
             attributes.put(Attributes.Name.IMPLEMENTATION_TITLE,   projectName);
             attributes.put(Attributes.Name.IMPLEMENTATION_VENDOR,  projectName);
         }
-        if (projectURL != null) {
-            attributes.put(Attributes.Name.IMPLEMENTATION_URL, projectURL);
-        }
         if (version != null) {
             attributes.put(Attributes.Name.SPECIFICATION_VERSION,  version);
             attributes.put(Attributes.Name.IMPLEMENTATION_VERSION, version);
@@ -182,8 +178,7 @@ final class PackOutput implements Closea
                             copy(src, attributes, Attributes.Name.SPECIFICATION_VERSION)  |
                             copy(src, attributes, Attributes.Name.IMPLEMENTATION_TITLE)   |
                             copy(src, attributes, Attributes.Name.IMPLEMENTATION_VENDOR)  |
-                            copy(src, attributes, Attributes.Name.IMPLEMENTATION_VERSION) |
-                            copy(src, attributes, Attributes.Name.IMPLEMENTATION_URL))
+                            copy(src, attributes, Attributes.Name.IMPLEMENTATION_VERSION))
                         {
                             manifest.getEntries().put(packageName, attributes);
                         }
@@ -330,11 +325,13 @@ final class PackOutput implements Closea
         final File inputFile = outputJAR;
         final Pack200.Packer packer = Pack200.newPacker();
         final Map<String,String> p = packer.properties();
-        p.put(EFFORT, String.valueOf(9));  // Maximum compression level.
-        p.put(KEEP_FILE_ORDER,    FALSE);  // Reorder files for better compression.
-        p.put(MODIFICATION_TIME,  LATEST); // Smear modification times to a single value.
-        p.put(DEFLATE_HINT,       TRUE);   // Ignore all JAR deflation requests.
-        p.put(UNKNOWN_ATTRIBUTE,  ERROR);  // Throw an error if an attribute is unrecognized
+        p.put(EFFORT, String.valueOf(9));           // Maximum compression level.
+        p.put(SEGMENT_LIMIT,     "-1");             // use largest-possible archive segments (>10% better compression).
+        p.put(KEEP_FILE_ORDER,    FALSE);           // Reorder files for better compression.
+        p.put(MODIFICATION_TIME,  LATEST);          // Smear modification times to a single value.
+        p.put(DEFLATE_HINT,       TRUE);            // Ignore all JAR deflation requests.
+        p.put(UNKNOWN_ATTRIBUTE,  ERROR);           // Throw an error if an attribute is unrecognized
+        p.put(CODE_ATTRIBUTE_PFX+"LocalVariableTable", STRIP);        // discard debug attributes.
         final JarFile jarFile = new JarFile(inputFile);
         try {
             final OutputStream deflater = new GZIPOutputStream(out);

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -40,9 +40,9 @@ import static org.apache.sis.internal.ma
  */
 final class Packer implements FilenameFilter {
     /**
-     * The project name, URL and version to declare in the manifest file, or {@code null} if none.
+     * The project name and version to declare in the manifest file, or {@code null} if none.
      */
-    private final String projectName, projectURL, version;
+    private final String projectName, version;
 
     /**
      * The Maven target directory. Shall contain the {@code "binaries"} sub-directory,
@@ -59,16 +59,12 @@ final class Packer implements FilenameFi
      * Creates a packer.
      *
      * @param  projectName     The project name to declare in the manifest file, or {@code null} if none.
-     * @param  projectURL      The project URL to declare in the manifest file, or {@code null} if none.
      * @param  version         The project version to declare in the manifest file, or {@code null} if none.
      * @param  targetDirectory The Maven target directory.
      * @throws FileNotFoundException if the {@code target/binaries} directory is not found.
      */
-    Packer(final String projectName, final String projectURL, final String version,
-           final File targetDirectory) throws FileNotFoundException
-    {
+    Packer(final String projectName, final String version, final File targetDirectory) throws FileNotFoundException {
         this.projectName = projectName;
-        this.projectURL  = projectURL;
         this.version     = version;
         this.targetDirectory = targetDirectory;
         this.binariesDirectory = new File(targetDirectory, BINARIES_DIRECTORY);
@@ -130,7 +126,7 @@ final class Packer implements FilenameFi
         final File outDirectory = distributionDirectory(targetDirectory);
         final PackOutput output = new PackOutput(getInputJARs(), new File(outDirectory, outputJAR));
         try {
-            output.open(projectName, projectURL, version);
+            output.open(projectName, version);
             output.writeContent();
         } finally {
             output.close();

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java?rev=1748699&r1=1748682&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -85,8 +85,9 @@ final class FilteredJarFile extends JarF
         if (!ze.getName().equals(JarFile.MANIFEST_NAME)) {
             return in;
         }
-        final List<String> lines = new ArrayList<>();
-        try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, MANIFEST_ENCODING))) {
+        final List<String> lines = new ArrayList<String>();
+        final BufferedReader reader = new BufferedReader(new InputStreamReader(in, MANIFEST_ENCODING));
+        try {
             String line;
             while ((line = reader.readLine()) != null) {
                 if (line.trim().startsWith("SHA1-Digest:")) {
@@ -100,6 +101,8 @@ final class FilteredJarFile extends JarF
                 }
                 lines.add(line);
             }
+        } finally {
+            reader.close();
         }
         /*
          * 'in' has been closed at this point (indirectly, by closing the reader).

Modified: sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java?rev=1748699&r1=1748682&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -157,7 +157,8 @@ public final class UnoPkg extends Abstra
         final File    manifestFile = new File(sourceDirectory, manifestName);
         final File[]          jars = outputDirectory.listFiles(this);
         final File[]          rdbs = sourceDirectory.listFiles(this);
-        try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile))) {
+        final ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile));
+        try {
             out.setLevel(9);
             if (manifestFile.isFile()) {
                 copyFiltered(manifestFile, out, manifestName);
@@ -206,16 +207,21 @@ public final class UnoPkg extends Abstra
                     }
                     if (packer != null && name.endsWith(".jar")) {
                         name = name.substring(0, name.length()-3) + "pack";
-                        try (JarFile jar = new FilteredJarFile(file)) {
+                        final JarFile jar = new FilteredJarFile(file);
+                        try {
                             out.putNextEntry(new ZipEntry(name));
                             packer.pack(jar, out);
                             out.closeEntry();
+                        } finally {
+                            jar.close();
                         }
                     } else {
                         copy(file, out, name);
                     }
                 }
             }
+        } finally {
+            out.close();
         }
     }
 
@@ -237,12 +243,15 @@ public final class UnoPkg extends Abstra
             entry.setCrc(getCRC32(file));
         }
         out.putNextEntry(entry);
-        try (InputStream in = new FileInputStream(file)) {
+        final InputStream in = new FileInputStream(file);
+        try {
             final byte[] buffer = new byte[4*1024];
             int length;
             while ((length = in.read(buffer)) >= 0) {
                 out.write(buffer, 0, length);
             }
+        } finally {
+            in.close();
         }
         out.closeEntry();
     }
@@ -257,7 +266,8 @@ public final class UnoPkg extends Abstra
         final ZipEntry entry = new ZipEntry(name);
         out.putNextEntry(entry);
         final Writer writer = new OutputStreamWriter(out, ENCODING);
-        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), ENCODING))) {
+        final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), ENCODING));
+        try {
             String line; while ((line=in.readLine()) != null) {
                 int r=-1; while ((r=line.indexOf(SUBSTITUTE, r+1)) >= 0) {
                     line = line.substring(0, r) + finalName + line.substring(r + SUBSTITUTE.length());
@@ -265,6 +275,8 @@ public final class UnoPkg extends Abstra
                 writer.write(line);
                 writer.write('\n');
             }
+        } finally {
+            in.close();
         }
         writer.flush();
         out.closeEntry();
@@ -275,12 +287,15 @@ public final class UnoPkg extends Abstra
      */
     private static long getCRC32(final File file) throws IOException {
         final CRC32 crc = new CRC32();
-        try (InputStream in = new FileInputStream(file)) {
+        final InputStream in = new FileInputStream(file);
+        try {
             final byte[] buffer = new byte[4*1024];
             int length;
             while ((length = in.read(buffer)) >= 0) {
                 crc.update(buffer, 0, length);
             }
+        } finally {
+            in.close();
         }
         return crc.getValue();
     }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -19,7 +19,6 @@ package org.apache.sis.internal.metadata
 import java.util.Locale;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.ServiceLoader;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
 import java.security.AccessController;
@@ -37,6 +36,7 @@ import javax.naming.event.EventContext;
 import javax.naming.event.NamingEvent;
 import javax.naming.event.NamingExceptionEvent;
 import javax.naming.event.ObjectChangeListener;
+import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.system.DataDirectory;
 import org.apache.sis.internal.system.Shutdown;
 import org.apache.sis.internal.system.Loggers;
@@ -61,7 +61,7 @@ import org.apache.sis.internal.jdk7.Path
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public abstract class Initializer {
@@ -181,7 +181,7 @@ public abstract class Initializer {
                  */
                 Logging.recoverableException(Logging.getLogger(Loggers.SYSTEM), Listener.class, "objectChanged", e);
             }
-            for (Initializer init : ServiceLoader.load(Initializer.class)) {
+            for (Initializer init : DefaultFactories.createServiceLoader(Initializer.class)) {
                 init.dataSourceChanged();
             }
         }
@@ -299,7 +299,7 @@ public abstract class Initializer {
                 m.invoke(source, "create");
                 Connection c = source.getConnection();
                 try {
-                    for (Initializer init : ServiceLoader.load(Initializer.class)) {
+                    for (Initializer init : DefaultFactories.createServiceLoader(Initializer.class)) {
                         init.createSchema(c);
                     }
                 } finally {

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -33,7 +33,7 @@ import org.apache.sis.metadata.Modifiabl
 import org.apache.sis.internal.jaxb.IdentifierMapAdapter;
 import org.apache.sis.internal.jaxb.ModifiableIdentifierMap;
 import org.apache.sis.internal.metadata.MetadataUtilities;
-import org.apache.sis.internal.util.Utilities;
+import org.apache.sis.internal.system.Modules;
 import org.apache.sis.util.collection.Containers;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
@@ -96,7 +96,7 @@ public class ISOMetadata extends Modifia
                  * without invoking super.getIdentifiers(), in which case their identifiers will not be copied.
                  * For safety, we will do this optimization only if the implementation is an Apache SIS one.
                  */
-                if (Utilities.isSIS(object.getClass())) {
+                if (object.getClass().getName().startsWith(Modules.CLASSNAME_PREFIX)) {
                     return;
                 }
             }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -283,7 +283,7 @@ public class DefaultBand extends Default
 
     /**
      * Returns the wavelength at which the response is the highest.
-     * The units of measurement is given by {@link #getUnits()}.
+     * The units of measurement is given by {@link #getBoundUnits()}.
      *
      * @return Wavelength at which the response is the highest, or {@code null} if unspecified.
      */

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -40,7 +40,7 @@
  * {@code      └─} {@linkplain org.apache.sis.metadata.iso.extent.DefaultSpatialTemporalExtent Spatial temporal extent}<br>
  * </td><td class="sep" style="width: 50%; white-space: nowrap">
  *             {@linkplain org.apache.sis.metadata.iso.extent.DefaultExtent                Extent}<br>
- * {@code  ├─} {@linkplain org.apache.sis.metadata.iso.extent.AbstractGeographicExtent     Geographic extent}<br>
+ * {@code  ├─} {@linkplain org.apache.sis.metadata.iso.extent.AbstractGeographicExtent     Geographic extent} «abstract»<br>
  * {@code  ├─} {@linkplain org.apache.sis.metadata.iso.extent.DefaultVerticalExtent        Vertical extent}<br>
  * {@code  └─} {@linkplain org.apache.sis.metadata.iso.extent.DefaultTemporalExtent        Temporal extent}<br>
  *             {@linkplain org.apache.sis.metadata.iso.extent.DefaultSpatialTemporalExtent Spatial temporal extent}<br>

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -22,6 +22,12 @@ import java.util.LinkedHashSet;
 import java.util.Locale;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.NoSuchAuthorityCodeException;
+import org.opengis.referencing.datum.DatumAuthorityFactory;
+import org.opengis.referencing.datum.PrimeMeridian;
+import org.opengis.referencing.datum.Ellipsoid;
+import org.opengis.referencing.datum.Datum;
+import org.opengis.referencing.datum.GeodeticDatum;
+import org.opengis.referencing.datum.VerticalDatum;
 import org.opengis.referencing.crs.GeocentricCRS;
 import org.opengis.referencing.crs.GeographicCRS;
 import org.opengis.referencing.crs.ProjectedCRS;
@@ -49,11 +55,11 @@ import org.apache.sis.util.Debug;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @Fallback
-final class EPSGFactoryFallback extends GeodeticAuthorityFactory implements CRSAuthorityFactory {
+final class EPSGFactoryFallback extends GeodeticAuthorityFactory implements CRSAuthorityFactory, DatumAuthorityFactory {
     /**
      * Whether to disallow {@code CommonCRS} to use {@link org.apache.sis.referencing.factory.sql.EPSGFactory}
      * (in which case {@code CommonCRS} will fallback on hard-coded values).
@@ -65,7 +71,12 @@ final class EPSGFactoryFallback extends
     /**
      * The singleton instance.
      */
-    static final CRSAuthorityFactory INSTANCE = new EPSGFactoryFallback();
+    static final EPSGFactoryFallback INSTANCE = new EPSGFactoryFallback();
+
+    /**
+     * Kinds of object created by this factory. Used as bitmask.
+     */
+    private static final int CRS = 1, DATUM = 2, ELLIPSOID = 4, PRIME_MERIDIAN = 8;
 
     /**
      * The authority, created when first needed.
@@ -107,18 +118,22 @@ final class EPSGFactoryFallback extends
      */
     @Override
     public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) {
+        final boolean pm         = type.isAssignableFrom(PrimeMeridian.class);
+        final boolean ellipsoid  = type.isAssignableFrom(Ellipsoid    .class);
+        final boolean datum      = type.isAssignableFrom(GeodeticDatum.class);
         final boolean geographic = type.isAssignableFrom(GeographicCRS.class);
         final boolean geocentric = type.isAssignableFrom(GeocentricCRS.class);
         final boolean projected  = type.isAssignableFrom(ProjectedCRS .class);
         final Set<String> codes = new LinkedHashSet<String>();
+        if (pm) codes.add(StandardDefinitions.GREENWICH);
         for (final CommonCRS crs : CommonCRS.values()) {
+            if (ellipsoid)  add(codes, crs.ellipsoid);
+            if (datum)      add(codes, crs.datum);
+            if (geocentric) add(codes, crs.geocentric);
             if (geographic) {
                 add(codes, crs.geographic);
                 add(codes, crs.geo3D);
             }
-            if (geocentric) {
-                add(codes, crs.geocentric);
-            }
             if (projected && (crs.northUTM != 0 || crs.southUTM != 0)) {
                 for (int zone = crs.firstZone; zone <= crs.lastZone; zone++) {
                     if (crs.northUTM != 0) codes.add(Integer.toString(crs.northUTM + zone));
@@ -126,10 +141,13 @@ final class EPSGFactoryFallback extends
                 }
             }
         }
-        if (type.isAssignableFrom(VerticalCRS.class)) {
+        final boolean vertical = type.isAssignableFrom(VerticalCRS  .class);
+        final boolean vdatum   = type.isAssignableFrom(VerticalDatum.class);
+        if (vertical || vdatum) {
             for (final CommonCRS.Vertical candidate : CommonCRS.Vertical.values()) {
                 if (candidate.isEPSG) {
-                    codes.add(Integer.toString(candidate.crs));
+                    if (vertical) codes.add(Integer.toString(candidate.crs));
+                    if (vdatum)   codes.add(Integer.toString(candidate.datum));
                 }
             }
         }
@@ -147,11 +165,55 @@ final class EPSGFactoryFallback extends
     }
 
     /**
+     * Returns a prime meridian for the given EPSG code.
+     */
+    @Override
+    public PrimeMeridian createPrimeMeridian(final String code) throws NoSuchAuthorityCodeException {
+        return (PrimeMeridian) predefined(code, PRIME_MERIDIAN);
+    }
+
+    /**
+     * Returns an ellipsoid for the given EPSG code.
+     */
+    @Override
+    public Ellipsoid createEllipsoid(final String code) throws NoSuchAuthorityCodeException {
+        return (Ellipsoid) predefined(code, ELLIPSOID);
+    }
+
+    /**
+     * Returns a datum for the given EPSG code.
+     */
+    @Override
+    public Datum createDatum(final String code) throws NoSuchAuthorityCodeException {
+        return (Datum) predefined(code, DATUM);
+    }
+
+    /**
      * Returns a coordinate reference system for the given EPSG code. This method is invoked
      * as a fallback when {@link CRS#forCode(String)} can not create a CRS for a given code.
      */
     @Override
+    public CoordinateReferenceSystem createCoordinateReferenceSystem(final String code) throws NoSuchAuthorityCodeException {
+        return (CoordinateReferenceSystem) predefined(code, CRS);
+    }
+
+    /**
+     * Returns a coordinate reference system, datum or ellipsoid for the given EPSG code.
+     */
+    @Override
     public IdentifiedObject createObject(final String code) throws NoSuchAuthorityCodeException {
+        return predefined(code, -1);
+    }
+
+    /**
+     * Implementation of the {@code createFoo(String)} methods.
+     *
+     * @param  code  the EPSG code.
+     * @param  kind  any combination of {@link #CRS}, {@link #DATUM}, {@link #ELLIPSOID} or {@link #PRIME_MERIDIAN} bits.
+     * @return the requested object.
+     * @throws NoSuchAuthorityCodeException if no matching object has been found.
+     */
+    private IdentifiedObject predefined(String code, final int kind) throws NoSuchAuthorityCodeException {
         NumberFormatException cause = null;
         try {
             /*
@@ -161,35 +223,57 @@ 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(…).
              */
-            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();
+            }
             for (final CommonCRS crs : CommonCRS.values()) {
-                if (n == crs.geographic) return crs.geographic();
-                if (n == crs.geocentric) return crs.geocentric();
-                if (n == crs.geo3D)      return crs.geographic3D();
-                final double latitude;
-                int zone;
-                if (crs.northUTM != 0 && (zone = n - crs.northUTM) >= crs.firstZone && zone <= crs.lastZone) {
-                    latitude = +1;
-                } else if (crs.southUTM != 0 && (zone = n - crs.southUTM) >= crs.firstZone && zone <= crs.lastZone) {
-                    latitude = -1;
-                } else {
-                    continue;
+                /*
+                 * In a complete EPSG dataset we could have an ambiguity below because the same code can be used
+                 * for datum, ellipsoid and CRS objects. However in the particular case of this EPSG-subset, we
+                 * ensured that there is no such collision - see CommonCRSTest.ensureNoCodeCollision().
+                 */
+                if ((kind & ELLIPSOID) != 0  &&  n == crs.ellipsoid) return crs.ellipsoid();
+                if ((kind & DATUM)     != 0  &&  n == crs.datum)     return crs.datum();
+                if ((kind & CRS) != 0) {
+                    if (n == crs.geographic) return crs.geographic();
+                    if (n == crs.geocentric) return crs.geocentric();
+                    if (n == crs.geo3D)      return crs.geographic3D();
+                    final double latitude;
+                    int zone;
+                    if (crs.northUTM != 0 && (zone = n - crs.northUTM) >= crs.firstZone && zone <= crs.lastZone) {
+                        latitude = +1;
+                    } else if (crs.southUTM != 0 && (zone = n - crs.southUTM) >= crs.firstZone && zone <= crs.lastZone) {
+                        latitude = -1;
+                    } else {
+                        continue;
+                    }
+                    return crs.UTM(latitude, TransverseMercator.centralMeridian(zone));
                 }
-                return crs.UTM(latitude, TransverseMercator.centralMeridian(zone));
             }
-            for (final CommonCRS.Vertical candidate : CommonCRS.Vertical.values()) {
-                if (candidate.isEPSG && candidate.crs == n) {
-                    return candidate.crs();
+            if ((kind & (DATUM | CRS)) != 0) {
+                for (final CommonCRS.Vertical candidate : CommonCRS.Vertical.values()) {
+                    if (candidate.isEPSG) {
+                        if ((kind & DATUM) != 0  &&  candidate.datum == n) return candidate.datum();
+                        if ((kind & CRS)   != 0  &&  candidate.crs   == n) return candidate.crs();
+                    }
                 }
             }
         } catch (NumberFormatException e) {
             cause = e;
         }
-        final String authority = Constants.EPSG + " subset";
+        final Class<?> type;
+        switch (kind) {
+            case CRS:            type = CoordinateReferenceSystem.class; break;
+            case DATUM:          type = Datum.class; break;
+            case ELLIPSOID:      type = Ellipsoid.class; break;
+            case PRIME_MERIDIAN: type = PrimeMeridian.class; break;
+            default:             type = IdentifiedObject.class; break;
+        }
+        final String authority = Constants.EPSG + "-subset";
         final NoSuchAuthorityCodeException e = new NoSuchAuthorityCodeException(Errors.format(
-                Errors.Keys.NoSuchAuthorityCode_3, authority, CoordinateReferenceSystem.class, code), authority, code);
+                Errors.Keys.NoSuchAuthorityCode_3, authority, type, code), authority, code);
         e.initCause(cause);
         throw e;
     }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -153,12 +153,6 @@ public enum AxesConvention implements Ax
         }
 
         @Override
-        @Deprecated
-        public Unit<?> getUnitReplacement(Unit<?> unit) {
-            return getUnitReplacement(null, unit);
-        }
-
-        @Override
         public Unit<?> getUnitReplacement(final CoordinateSystemAxis axis, Unit<?> unit) {
             if (Units.isLinear(unit)) {
                 unit = SI.METRE;
@@ -171,12 +165,6 @@ public enum AxesConvention implements Ax
         }
 
         @Override
-        @Deprecated
-        public AxisDirection getDirectionReplacement(final AxisDirection direction) {
-            return getDirectionReplacement(null, direction);
-        }
-
-        @Override
         public AxisDirection getDirectionReplacement(final CoordinateSystemAxis axis, final AxisDirection direction) {
             /*
              * For now we do not touch to inter-cardinal directions (e.g. "North-East")
@@ -250,23 +238,11 @@ public enum AxesConvention implements Ax
         }
 
         @Override
-        @Deprecated
-        public Unit<?> getUnitReplacement(final Unit<?> unit) {
-            return unit;
-        }
-
-        @Override
         public Unit<?> getUnitReplacement(final CoordinateSystemAxis axis, final Unit<?> unit) {
             return unit;
         }
 
         @Override
-        @Deprecated
-        public AxisDirection getDirectionReplacement(final AxisDirection direction) {
-            return getDirectionReplacement(null, direction);
-        }
-
-        @Override
         public AxisDirection getDirectionReplacement(CoordinateSystemAxis axis, AxisDirection direction) {
             return NORMALIZED.getDirectionReplacement(axis, direction);
         }
@@ -306,23 +282,11 @@ public enum AxesConvention implements Ax
         }
 
         @Override
-        @Deprecated
-        public Unit<?> getUnitReplacement(final Unit<?> unit) {
-            return unit;
-        }
-
-        @Override
         public Unit<?> getUnitReplacement(CoordinateSystemAxis axis, final Unit<?> unit) {
             return unit;
         }
 
         @Override
-        @Deprecated
-        public AxisDirection getDirectionReplacement(final AxisDirection direction) {
-            return direction;
-        }
-
-        @Override
         public AxisDirection getDirectionReplacement(CoordinateSystemAxis axis, final AxisDirection direction) {
             return direction;
         }
@@ -358,23 +322,11 @@ public enum AxesConvention implements Ax
         }
 
         @Override
-        @Deprecated
-        public Unit<?> getUnitReplacement(final Unit<?> unit) {
-            return unit;
-        }
-
-        @Override
         public Unit<?> getUnitReplacement(CoordinateSystemAxis axis, final Unit<?> unit) {
             return unit;
         }
 
         @Override
-        @Deprecated
-        public AxisDirection getDirectionReplacement(final AxisDirection direction) {
-            return direction;
-        }
-
-        @Override
         public AxisDirection getDirectionReplacement(CoordinateSystemAxis axis, final AxisDirection direction) {
             return direction;
         }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -83,15 +83,6 @@ public interface AxisFilter {
     AxisDirection getDirectionReplacement(CoordinateSystemAxis axis, AxisDirection direction);
 
     /**
-     * @deprecated Use {@link #getDirectionReplacement(CoordinateSystemAxis, AxisDirection)} instead.
-     *
-     * @param  direction The original axis direction.
-     * @return The new axis direction, or {@code direction} if there is no change.
-     */
-    @Deprecated
-    AxisDirection getDirectionReplacement(AxisDirection direction);
-
-    /**
      * Returns a replacement for the given axis unit.
      *
      * <div class="note"><b>Example:</b>
@@ -116,13 +107,4 @@ public interface AxisFilter {
      * @since 0.7
      */
     Unit<?> getUnitReplacement(CoordinateSystemAxis axis, Unit<?> unit);
-
-    /**
-     * @deprecated Use {@link #getUnitReplacement(CoordinateSystemAxis, Unit)} instead.
-     *
-     * @param  unit The original axis unit.
-     * @return The new axis unit, or {@code unit} if there is no change.
-     */
-    @Deprecated
-    Unit<?> getUnitReplacement(Unit<?> unit);
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -446,16 +446,6 @@ public final class CoordinateSystems ext
             public AxisDirection getDirectionReplacement(CoordinateSystemAxis axis, AxisDirection direction) {
                 return direction;
             }
-
-            @Deprecated @Override
-            public AxisDirection getDirectionReplacement(AxisDirection direction) {
-                return direction;
-            }
-
-            @Deprecated @Override
-            public Unit<?> getUnitReplacement(Unit<?> unit) {
-                return getUnitReplacement(null, unit);
-            }
         });
     }
 
@@ -497,16 +487,6 @@ public final class CoordinateSystems ext
             public AxisDirection getDirectionReplacement(CoordinateSystemAxis axis, AxisDirection direction) {
                 return direction;
             }
-
-            @Deprecated @Override
-            public AxisDirection getDirectionReplacement(AxisDirection direction) {
-                return direction;
-            }
-
-            @Deprecated @Override
-            public Unit<?> getUnitReplacement(Unit<?> unit) {
-                return getUnitReplacement(null, unit);
-            }
         });
     }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -182,6 +182,9 @@ abstract class AuthorityFactoryProxy<T>
             @Override InternationalString createFromAPI(AuthorityFactory factory, String code) throws FactoryException {
                 return factory.getDescriptionText(code);
             }
+            @Override AuthorityFactoryProxy<InternationalString> specialize(String typeName) {
+                return this;
+            }
     };
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -751,7 +751,8 @@ public class MultiAuthoritiesFactory ext
                 if (code == null) {
                     message = Errors.format(Errors.Keys.MissingComponentInElement_2, s, "code");
                 } else {
-                    message = Errors.format(Errors.Keys.CanNotCreateObjectAsInstanceOf_2, type, uri.type);
+                    message = Errors.format(Errors.Keys.CanNotCreateObjectAsInstanceOf_2, type,
+                            DefinitionURI.PREFIX + DefinitionURI.SEPARATOR + uri.type);
                 }
                 throw new NoSuchAuthorityCodeException(message, authority, code, s);
             }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGInstaller.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGInstaller.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGInstaller.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGInstaller.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.referencing.factory.sql;
 
 import java.util.Locale;
-import java.util.ServiceLoader;
 import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
@@ -32,6 +31,7 @@ import java.io.BufferedReader;
 import org.apache.sis.util.StringBuilders;
 import org.apache.sis.internal.metadata.sql.ScriptRunner;
 import org.apache.sis.internal.metadata.sql.SQLUtilities;
+import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.util.Fallback;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Exceptions;
@@ -52,7 +52,7 @@ import org.apache.sis.internal.jdk8.BiFu
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 final class EPSGInstaller extends ScriptRunner {
@@ -278,7 +278,7 @@ final class EPSGInstaller extends Script
      */
     private static InstallationResources lookupProvider(final Locale locale) throws IOException {
         InstallationResources fallback = null;
-        for (final InstallationResources provider : ServiceLoader.load(InstallationResources.class)) {
+        for (final InstallationResources provider : DefaultFactories.createServiceLoader(InstallationResources.class)) {
             if (provider.getAuthorities().contains(EPSG)) {
                 if (provider.getClass().isAnnotationPresent(Fallback.class)) {
                     return provider;

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -47,8 +47,8 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.internal.referencing.provider.MapProjection;
 import org.apache.sis.internal.metadata.ReferencingServices;
 import org.apache.sis.internal.referencing.Formulas;
+import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.util.Constants;
-import org.apache.sis.internal.util.Utilities;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.util.resources.Errors;
 
@@ -594,7 +594,7 @@ public abstract class NormalizedProjecti
             group = DESCRIPTORS.get(type);
             if (group == null) {
                 final ParameterBuilder builder = new ParameterBuilder().setRequired(true);
-                if (Utilities.isSIS(type)) {
+                if (type.getName().startsWith(Modules.CLASSNAME_PREFIX)) {
                     builder.setCodeSpace(Citations.SIS, Constants.SIS);
                 }
                 final String[] names = getInternalParameterNames();

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -424,18 +424,6 @@ public class ContextualParameters extend
     }
 
     /**
-     * @deprecated Replaced by {@link #getMatrix(MatrixRole)}.
-     *
-     * @param  norm {@code true} for fetching the <cite>normalization</cite> transform to apply before the kernel,
-     *         or {@code false} for the <cite>denormalization</cite> transform to apply after the kernel.
-     * @return The matrix for the requested normalization ({@code true}) or denormalization ({@code false}) affine transform.
-     */
-    @Deprecated
-    public final MatrixSIS getMatrix(final boolean norm) {
-        return getMatrix(norm ? MatrixRole.NORMALIZATION : MatrixRole.DENORMALIZATION);
-    }
-
-    /**
      * Prepends a normalization step converting input ordinates in the two first dimensions from degrees to radians.
      * The normalization can optionally subtract the given λ₀ value (in degrees) from the longitude.
      *

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -1189,35 +1189,6 @@ public class DefaultMathTransformFactory
     }
 
     /**
-     * Creates a transform from a base to a derived CS using an existing parameterized transform.
-     * The given {@code parameterized} transform shall expect
-     * {@linkplain org.apache.sis.referencing.cs.AxesConvention#NORMALIZED normalized} input coordinates and
-     * produce normalized output coordinates.
-     *
-     * @param  baseCS        The source coordinate system.
-     * @param  parameterized A <cite>base to derived</cite> transform for normalized input and output coordinates.
-     * @param  derivedCS     The target coordinate system.
-     * @return The transform from {@code baseCS} to {@code derivedCS}, including unit conversions and axis swapping.
-     * @throws FactoryException if the object creation failed. This exception is thrown
-     *         if some required parameter has not been supplied, or has illegal value.
-     *
-     * @deprecated Replaced by {@link #swapAndScaleAxes(MathTransform, Context)}.
-     */
-    @Deprecated
-    public MathTransform createBaseToDerived(final CoordinateSystem baseCS,
-            final MathTransform parameterized, final CoordinateSystem derivedCS)
-            throws FactoryException
-    {
-        ArgumentChecks.ensureNonNull("baseCS",        baseCS);
-        ArgumentChecks.ensureNonNull("parameterized", parameterized);
-        ArgumentChecks.ensureNonNull("derivedCS",     derivedCS);
-        final Context context = new Context();
-        context.setSource(baseCS);
-        context.setTarget(derivedCS);
-        return swapAndScaleAxes(parameterized, context);
-    }
-
-    /**
      * Creates a math transform that represent a change of coordinate system.
      *
      * @param source the source coordinate system.

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AuthorityFactoriesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AuthorityFactoriesTest.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AuthorityFactoriesTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AuthorityFactoriesTest.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -46,7 +46,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final strictfp class AuthorityFactoriesTest extends TestCase {
@@ -66,6 +66,20 @@ public final strictfp class AuthorityFac
     }
 
     /**
+     * Tests {@link CRSAuthorityFactory#getDescriptionText(String)}.
+     *
+     * @throws FactoryException if the EPSG:4326 name can not be obtained.
+     *
+     * @since 0.8
+     */
+    @Test
+    public void testGetDescriptionText() throws FactoryException {
+        final CRSAuthorityFactory factory = AuthorityFactories.ALL;
+        assertEquals("WGS 84", factory.getDescriptionText("EPSG:4326").toString());
+        assertEquals("WGS 84", factory.getDescriptionText("urn:ogc:def:crs:epsg::4326").toString());
+    }
+
+    /**
      * Tests creation of {@code CRS:84} from various codes.
      *
      * @throws FactoryException if a CRS:84 creation failed.

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -16,10 +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.apache.sis.referencing.crs.DefaultCompoundCRS;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 import org.apache.sis.referencing.crs.HardCodedCRS;
@@ -40,7 +41,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -106,6 +107,21 @@ 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 NoSuchAuthorityCodeException} happened.
+     */
+    @Test
+    public void testForInvalidCode() throws FactoryException {
+        try {
+            CRS.forCode("EPSG:4");
+            fail("Should not find EPSG:4");
+        } catch (NoSuchAuthorityCodeException e) {
+            assertEquals("4", e.getAuthorityCode());
+        }
+    }
+
+    /**
      * Tests simple WKT parsing. It is not the purpose of this class to test extensively the WKT parser;
      * those tests are rather done by {@link org.apache.sis.io.wkt.GeodeticObjectParserTest}.
      * Here we merely test that {@link CRS#fromWKT(String)} is connected to the parser.

Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java?rev=1748699&r1=1748698&r2=1748699&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java [UTF-8] Thu Jun 16 12:19:26 2016
@@ -17,6 +17,8 @@
 package org.apache.sis.referencing;
 
 import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.crs.TemporalCRS;
 import org.opengis.referencing.crs.VerticalCRS;
@@ -49,7 +51,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -64,6 +66,58 @@ public final strictfp class CommonCRSTes
     private static final double DAY_LENGTH = 24 * 60 * 60 * 1000;
 
     /**
+     * Verifies that the same EPSG code is not used for two objects. Collisions are not allowed between
+     * {@code geographic}, {@code geocentric}, {@code geo3D} and all UTM projections. Strictly speaking
+     * all the above-cited codes may collide with {@code datum} and {@code ellipsoid}, but we nevertheless
+     * avoid those collisions in order to simplify {@link EPSGFactoryFallback#createObject(String)} implementation.
+     */
+    @Test
+    public void ensureNoCodeCollision() {
+        final Map<Integer,Enum<?>> codes = new HashMap<Integer,Enum<?>>();
+        final CommonCRS[] values = CommonCRS.values();
+        for (final CommonCRS crs : values) {
+            assertNoCodeCollision(codes, crs, crs.geographic);
+            assertNoCodeCollision(codes, crs, crs.geocentric);
+            assertNoCodeCollision(codes, crs, crs.geo3D);
+            for (int zone = crs.firstZone; zone <= crs.lastZone; zone++) {
+                if (crs.northUTM != 0) assertNoCodeCollision(codes, crs, crs.northUTM + zone);
+                if (crs.southUTM != 0) assertNoCodeCollision(codes, crs, crs.southUTM + zone);
+            }
+        }
+        final CommonCRS.Vertical[] vertical = CommonCRS.Vertical.values();
+        for (final CommonCRS.Vertical crs : vertical) {
+            if (crs.isEPSG) {
+                assertNoCodeCollision(codes, crs, crs.crs);
+            }
+        }
+        /*
+         * Following restrictions are not strictly required, but their enforcement
+         * simplifies the EPSGFactoryFallback.createObject(String) implementation.
+         */
+        assertNull(codes.put(Integer.valueOf(StandardDefinitions.GREENWICH), CommonCRS.WGS84));
+        for (final CommonCRS crs : values) assertNull   (crs.name(),      codes.get(Integer.valueOf(crs.ellipsoid)));
+        for (final CommonCRS crs : values) assertNotSame(crs.name(), crs, codes.put(Integer.valueOf(crs.ellipsoid), crs));
+        for (final CommonCRS crs : values) assertNull   (crs.name(),      codes.get(Integer.valueOf(crs.datum)));
+        for (final CommonCRS.Vertical crs : vertical) {
+            if (crs.isEPSG) {
+                assertNull(crs.name(), codes.get(Integer.valueOf(crs.datum)));
+            }
+        }
+    }
+
+    /**
+     * Helper method for {@link #ensureNoCodeCollision()} only.
+     */
+    private static void assertNoCodeCollision(final Map<Integer,Enum<?>> codes, final Enum<?> crs, final int n) {
+        if (n != 0) {
+            final Enum<?> existing = codes.put(n, crs);
+            if (existing != null) {
+                fail(existing + " and " + crs + " both use the same EPSG:" + n + " code.");
+            }
+        }
+    }
+
+    /**
      * Tests the {@link CommonCRS#geographic()} method.
      */
     @Test



Mime
View raw message