sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1682276 [2/3] - in /sis/branches/JDK8: core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ core/si...
Date Thu, 28 May 2015 16:51:06 GMT
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -26,7 +26,7 @@ import org.apache.sis.measure.Range;
 import org.apache.sis.measure.NumberRange;
 import org.apache.sis.measure.MeasurementRange;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
-import org.apache.sis.metadata.iso.citation.HardCodedCitations;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
@@ -147,7 +147,7 @@ public final strictfp class DefaultParam
     public static DefaultParameterDescriptor<Double> createEPSG(final String name, final short code) {
         final Map<String, Object> properties = properties(name);
         assertNull(properties.put(DefaultParameterDescriptor.IDENTIFIERS_KEY,
-                new ImmutableIdentifier(HardCodedCitations.IOGP, Constants.EPSG, Short.toString(code))));
+                new ImmutableIdentifier(Citations.EPSG, Constants.EPSG, Short.toString(code))));
         return new DefaultParameterDescriptor<>(properties, 0, 1, Double.class, null, null, null);
     }
 
@@ -323,6 +323,6 @@ public final strictfp class DefaultParam
     @DependsOnMethod("testWKT")
     public void testIdentifiedParameterWKT() {
         final DefaultParameterDescriptor<Double> descriptor = createEPSG("A0", Constants.A0);
-        assertWktEquals("Parameter[“A0”, Id[“EPSG”, 8623, Citation[“IOGP”], URI[“urn:ogc:def:parameter:EPSG::8623”]]]", descriptor);
+        assertWktEquals("Parameter[“A0”, Id[“EPSG”, 8623, URI[“urn:ogc:def:parameter:EPSG::8623”]]]", descriptor);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -604,6 +604,6 @@ public final strictfp class DefaultParam
     @DependsOnMethod("testWKT")
     public void testIdentifiedParameterWKT() {
         final Watcher<Double> parameter = new Watcher<>(DefaultParameterDescriptorTest.createEPSG("A0", Constants.A0));
-        assertWktEquals("Parameter[“A0”, null, Id[“EPSG”, 8623, Citation[“IOGP”]]]", parameter);
+        assertWktEquals("Parameter[“A0”, null, Id[“EPSG”, 8623]]", parameter);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -21,7 +21,7 @@ import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import org.opengis.util.GenericName;
 import org.opengis.parameter.ParameterDescriptor;
-import org.apache.sis.metadata.iso.citation.HardCodedCitations;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -79,11 +79,11 @@ public final strictfp class ParameterBui
     @DependsOnMethod("testCreate")
     public void testMercatorProjection() {
         final ParameterBuilder builder = new ParameterBuilder();
-        builder.setCodeSpace(HardCodedCitations.IOGP, "EPSG").setRequired(true);
+        builder.setCodeSpace(Citations.EPSG, "EPSG").setRequired(true);
         final ParameterDescriptor<?>[] parameters = {
             builder.addName("Longitude of natural origin")
-                   .addName(HardCodedCitations.OGC, "central_meridian")
-                   .addName(HardCodedCitations.GEOTIFF, "NatOriginLong")
+                   .addName(Citations.OGC, "central_meridian")
+                   .addName(Citations.GEOTIFF, "NatOriginLong")
                    .setRemarks("Some remarks.")               .createBounded(-180, +180, 0, NonSI.DEGREE_ANGLE),
             builder.addName("Latitude of natural origin")     .createBounded( -80,  +84, 0, NonSI.DEGREE_ANGLE),
             builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Unit.ONE),

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -35,8 +35,8 @@ import org.junit.AfterClass;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
-import static org.apache.sis.metadata.iso.citation.HardCodedCitations.OGC;
-import static org.apache.sis.metadata.iso.citation.HardCodedCitations.IOGP;
+import static org.apache.sis.metadata.iso.citation.Citations.OGC;
+import static org.apache.sis.metadata.iso.citation.Citations.EPSG;
 
 
 /**
@@ -62,7 +62,7 @@ public final strictfp class ParameterFor
     @BeforeClass
     public static void createParameterDescriptor() {
         ParameterBuilder builder = new ParameterBuilder();
-        builder.setCodeSpace(IOGP, "EPSG").setRequired(true);
+        builder.setCodeSpace(EPSG, "EPSG").setRequired(true);
         ParameterDescriptor<?>[] parameters = {
             builder.addName("Latitude of natural origin")      .addName(OGC, "latitude_of_origin").createBounded( -80,  +84,  40, NonSI.DEGREE_ANGLE),
             builder.addName("Longitude of natural origin")     .addName(OGC, "central_meridian")  .createBounded(-180, +180, -60, NonSI.DEGREE_ANGLE),

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -22,7 +22,7 @@ import java.util.Locale;
 import org.opengis.test.Validators;
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
-import org.apache.sis.metadata.iso.citation.HardCodedCitations;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.metadata.iso.extent.DefaultExtent;
 import org.apache.sis.metadata.iso.extent.DefaultTemporalExtent;
 import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
@@ -101,7 +101,7 @@ public final strictfp class AbstractRefe
         assertNull(properties.put(SCOPE_KEY, "Large scale topographic mapping and cadastre."));
         assertNull(properties.put(REMARKS_KEY, "注です。"));
         assertNull(properties.put(IDENTIFIERS_KEY, new ImmutableIdentifier(
-                HardCodedCitations.IOGP, "EPSG", "4326", "8.2", null)));
+                Citations.EPSG, "EPSG", "4326", "8.2", null)));
         assertNull(properties.put(DOMAIN_OF_VALIDITY_KEY, new DefaultExtent("Netherlands offshore.",
                 new DefaultGeographicBoundingBox(2.54, 6.40, 51.43, 55.77),
                 new DefaultVerticalExtent(10, 1000, VerticalCRSMock.DEPTH),
@@ -122,7 +122,7 @@ public final strictfp class AbstractRefe
                 "  Area[“Netherlands offshore.”],\n" +
                 "  BBox[51.43, 2.54, 55.77, 6.40],\n" +
                 "  VerticalExtent[-1000, -10, LengthUnit[“metre”, 1]],\n" +
-                "  Id[“EPSG”, 4326, “8.2”, Citation[“IOGP”], URI[“urn:ogc:def:referenceSystem:EPSG:8.2:4326”]],\n" +
+                "  Id[“EPSG”, 4326, “8.2”, URI[“urn:ogc:def:referenceSystem:EPSG:8.2:4326”]],\n" +
                 "  Remarks[“注です。”]]",
                 object);
 
@@ -132,7 +132,7 @@ public final strictfp class AbstractRefe
                 "  Area[“Netherlands offshore.”],\n" +
                 "  BBox[51.43, 2.54, 55.77, 6.40],\n" +
                 "  VerticalExtent[-1000, -10],\n" +
-                "  Id[“EPSG”, 4326, “8.2”, Citation[“IOGP”], URI[“urn:ogc:def:referenceSystem:EPSG:8.2:4326”]],\n" +
+                "  Id[“EPSG”, 4326, “8.2”, URI[“urn:ogc:def:referenceSystem:EPSG:8.2:4326”]],\n" +
                 "  Remarks[“注です。”]]",
                 object);
 
@@ -142,7 +142,7 @@ public final strictfp class AbstractRefe
                 "  Area[“Netherlands offshore.”],\n" +
                 "  BBox[51.43, 2.54, 55.77, 6.40],\n" +
                 "  VerticalExtent[-1000, -10],\n" +
-                "  Id[“EPSG”, 4326, “8.2”, Citation[“IOGP”]],\n" +
+                "  Id[“EPSG”, 4326, “8.2”],\n" +
                 "  Remarks[“注です。”]]",
                 object);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -23,15 +23,16 @@ import org.opengis.util.GenericName;
 import org.opengis.util.NameFactory;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.Identifier;
+import org.apache.sis.internal.simple.SimpleCitation;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
-import static org.apache.sis.metadata.iso.citation.HardCodedCitations.*;
 
 
 /**
@@ -66,15 +67,16 @@ public final strictfp class BuilderTest
     @Test
     public void testSetCodeSpace() {
         final BuilderMock builder = new BuilderMock();
-        builder.setCodeSpace(IOGP, "EPSG");
+        builder.setCodeSpace(Citations.EPSG, "EPSG");
         builder.addName("Mercator (variant A)");
         /*
          * Setting the same codespace should have no effect, while attempt to
          * set a new codespace after we added a name shall not be allowed.
          */
-        builder.setCodeSpace(IOGP, "EPSG");
+        final SimpleCitation IOGP = new SimpleCitation("IOGP");
+        builder.setCodeSpace(Citations.EPSG, "EPSG");
         try {
-            builder.setCodeSpace(EPSG, "EPSG");
+            builder.setCodeSpace(IOGP, "EPSG");
             fail("Setting a different codespace shall not be allowed.");
         } catch (IllegalStateException e) {
             final String message = e.getMessage();
@@ -83,18 +85,18 @@ public final strictfp class BuilderTest
         /*
          * The failed attempt to set a new codespace shall not have modified builder state.
          */
-        assertEquals("EPSG", builder.properties.get(Identifier.CODESPACE_KEY));
-        assertSame  (IOGP,   builder.properties.get(Identifier.AUTHORITY_KEY));
+        assertEquals("EPSG",         builder.properties.get(Identifier.CODESPACE_KEY));
+        assertSame  (Citations.EPSG, builder.properties.get(Identifier.AUTHORITY_KEY));
         /*
          * After a cleanup (normally after a createXXX(…) method call), user shall be allowed to
          * set a new codespace again. Note that the cleanup operation shall not clear the codespace.
          */
         builder.onCreate(true);
+        assertEquals("EPSG",         builder.properties.get(Identifier.CODESPACE_KEY));
+        assertSame  (Citations.EPSG, builder.properties.get(Identifier.AUTHORITY_KEY));
+        builder.setCodeSpace(IOGP, "EPSG");
         assertEquals("EPSG", builder.properties.get(Identifier.CODESPACE_KEY));
-        assertSame  (IOGP,   builder.properties.get(Identifier.AUTHORITY_KEY));
-        builder.setCodeSpace(EPSG, "EPSG");
-        assertEquals("EPSG", builder.properties.get(Identifier.CODESPACE_KEY));
-        assertSame  ( EPSG,  builder.properties.get(Identifier.AUTHORITY_KEY));
+        assertSame  ( IOGP,  builder.properties.get(Identifier.AUTHORITY_KEY));
     }
 
     /**
@@ -137,16 +139,16 @@ public final strictfp class BuilderTest
      */
     private static BuilderMock createMercator(final boolean withNames, final boolean withIdentifiers) {
         final BuilderMock builder = new BuilderMock();
-        assertSame(builder, builder.setCodeSpace(IOGP, "EPSG"));
+        assertSame(builder, builder.setCodeSpace(Citations.EPSG, "EPSG"));
         if (withNames) {
-            assertSame(builder, builder.addName(         "Mercator (variant A)")); // EPSG version 7.6 and later.
-            assertSame(builder, builder.addName(         "Mercator (1SP)"));       // EPSG before version 7.6.
-            assertSame(builder, builder.addName(OGC,     "Mercator_1SP"));
-            assertSame(builder, builder.addName(GEOTIFF, "CT_Mercator"));
+            assertSame(builder, builder.addName(                   "Mercator (variant A)")); // EPSG version 7.6 and later.
+            assertSame(builder, builder.addName(                   "Mercator (1SP)"));       // EPSG before version 7.6.
+            assertSame(builder, builder.addName(Citations.OGC,     "Mercator_1SP"));
+            assertSame(builder, builder.addName(Citations.GEOTIFF, "CT_Mercator"));
         }
         if (withIdentifiers) {
-            assertSame(builder, builder.addIdentifier(      "9804"));
-            assertSame(builder, builder.addIdentifier(GEOTIFF, "7"));
+            assertSame(builder, builder.addIdentifier(                "9804"));
+            assertSame(builder, builder.addIdentifier(Citations.GEOTIFF, "7"));
         }
         builder.onCreate(false);
         return builder;
@@ -163,8 +165,8 @@ public final strictfp class BuilderTest
         // Expected values to be used later in the test.
         final String      name   = "Mercator (variant A)";
         final GenericName alias1 = factory.createLocalName(scope(factory, "EPSG"), "Mercator (1SP)");
-        final GenericName alias2 = new NamedIdentifier(OGC,     "Mercator_1SP");
-        final GenericName alias3 = new NamedIdentifier(GEOTIFF, "CT_Mercator");
+        final GenericName alias2 = new NamedIdentifier(Citations.OGC,     "Mercator_1SP");
+        final GenericName alias3 = new NamedIdentifier(Citations.GEOTIFF, "CT_Mercator");
         assertTrue ("That name should not have a scope.", alias3.scope().isGlobal());
         assertTrue ("That name should not have a scope.", alias2.scope().isGlobal());
         assertFalse("That name should be in EPSG scope.", alias1.scope().isGlobal());
@@ -187,14 +189,13 @@ public final strictfp class BuilderTest
     }
 
     /**
-     * Tests {@link Builder#addIdentifier(Citation, String)} and {@link Builder#addIdentifier(String)}
-     * with codespace.
+     * Tests {@link Builder#addIdentifier(Citation, String)} and {@link Builder#addIdentifier(String)} with code space.
      */
     @Test
     public void testAddIdentifiers() {
         // Expected values to be used later in the test.
-        final Identifier id1 = new ImmutableIdentifier(IOGP,     "EPSG",    "9804");
-        final Identifier id2 = new ImmutableIdentifier(GEOTIFF, "GeoTIFF", "7");
+        final Identifier id1 = new ImmutableIdentifier(Citations.EPSG,    "EPSG", "9804");
+        final Identifier id2 = new ImmutableIdentifier(Citations.GEOTIFF, "GeoTIFF", "7");
         assertEquals("EPSG:9804", IdentifiedObjects.toString(id1));
         assertEquals("GeoTIFF:7", IdentifiedObjects.toString(id2));
 
@@ -218,7 +219,7 @@ public final strictfp class BuilderTest
             final Object value = entry.getValue();
             switch (entry.getKey()) {
                 case Identifier.AUTHORITY_KEY: {
-                    assertSame("Authority and codespace shall be unchanged.", IOGP, value);
+                    assertSame("Authority and codespace shall be unchanged.", Citations.EPSG, value);
                     break;
                 }
                 case Identifier.CODESPACE_KEY: {
@@ -249,7 +250,7 @@ public final strictfp class BuilderTest
         final BuilderMock builder = createMercator(true, false);
 
         // Replace "OGC:Mercator_1SP" and insert a new OGC code before the GeoTIFF one.
-        assertSame(builder, builder.rename(OGC, "Replacement 1", "Replacement 2"));
+        assertSame(builder, builder.rename(Citations.OGC, "Replacement 1", "Replacement 2"));
         builder.onCreate(false);
         assertArrayEquals(new String[] {
             "Mercator (variant A)",
@@ -260,7 +261,7 @@ public final strictfp class BuilderTest
         }, builder.getAsStrings(1));
 
         // Replace "EPSG:Mercator (variant A)" and "(1SP)", and insert a new EPSG code as an alias.
-        assertSame(builder, builder.rename(IOGP, "Replacement 3", "Replacement 4", "Replacement 5"));
+        assertSame(builder, builder.rename(Citations.EPSG, "Replacement 3", "Replacement 4", "Replacement 5"));
         builder.onCreate(false);
         assertArrayEquals(new String[] {
             "Replacement 3",
@@ -272,7 +273,7 @@ public final strictfp class BuilderTest
         }, builder.getAsStrings(1));
 
         // Remove all EPSG codes.
-        assertSame(builder, builder.rename(IOGP, (String[]) null));
+        assertSame(builder, builder.rename(Citations.EPSG, (String[]) null));
         builder.onCreate(false);
         assertArrayEquals(new String[] {
             "OGC:Replacement 1",

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -23,6 +23,7 @@ import org.opengis.util.GenericName;
 import org.opengis.util.NameFactory;
 import org.opengis.metadata.Identifier;
 import org.opengis.test.Validators;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.util.iso.DefaultInternationalString;
 import org.apache.sis.test.DependsOnMethod;
@@ -30,8 +31,6 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
-import static org.apache.sis.metadata.iso.citation.HardCodedCitations.IOGP;
-import static org.apache.sis.metadata.iso.citation.HardCodedCitations.EPSG;
 
 
 /**
@@ -49,16 +48,16 @@ public final strictfp class NamedIdentif
      */
     @Test
     public void testCreateFromCode() {
-        final NamedIdentifier identifier = new NamedIdentifier(IOGP, "EPSG", "4326", "8.3", null);
+        final NamedIdentifier identifier = new NamedIdentifier(Citations.EPSG, "EPSG", "4326", "8.3", null);
         Validators.validate((Identifier)  identifier);
         Validators.validate((GenericName) identifier);
 
         // ImmutableIdentifier properties
-        assertEquals("code",      "4326", identifier.getCode());
-        assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
-        assertSame  ("authority",  IOGP,  identifier.getAuthority());
-        assertEquals("version",   "8.3",  identifier.getVersion());
-        assertNull  ("description",       identifier.getDescription());
+        assertEquals("code",       "4326",         identifier.getCode());
+        assertEquals("codeSpace",  "EPSG",         identifier.getCodeSpace());
+        assertSame  ("authority",  Citations.EPSG, identifier.getAuthority());
+        assertEquals("version",    "8.3",          identifier.getVersion());
+        assertNull  ("description",                identifier.getDescription());
 
         // NamedIdentifier properties
         assertEquals("depth",  2,          identifier.depth());
@@ -82,7 +81,7 @@ public final strictfp class NamedIdentif
         // ImmutableIdentifier properties
         assertEquals("code",      "4326", identifier.getCode());
         assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
-        assertEquals("authority", "IOGP", identifier.getAuthority().getTitle().toString());
+        assertEquals("authority", "IOGP", Citations.getIdentifier(identifier.getAuthority()));
         assertNull  ("version",           identifier.getVersion());
         assertNull  ("description",       identifier.getDescription());
 
@@ -104,7 +103,7 @@ public final strictfp class NamedIdentif
         i18n.add(Locale.ENGLISH,  "name");
         i18n.add(Locale.FRENCH,   "nom");
         i18n.add(Locale.JAPANESE, "名前");
-        return new NamedIdentifier(EPSG, i18n);
+        return new NamedIdentifier(Citations.EPSG, i18n);
     }
 
     /**
@@ -118,11 +117,11 @@ public final strictfp class NamedIdentif
         Validators.validate((GenericName) identifier);
 
         // ImmutableIdentifier properties
-        assertEquals("code",      "name", identifier.getCode());
-        assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
-        assertSame  ("authority",  EPSG,  identifier.getAuthority());
-        assertNull  ("version",           identifier.getVersion());
-        assertNull  ("description",       identifier.getDescription());
+        assertEquals("code",      "name",         identifier.getCode());
+        assertEquals("codeSpace", "EPSG",         identifier.getCodeSpace());
+        assertSame  ("authority", Citations.EPSG, identifier.getAuthority());
+        assertNull  ("version",                   identifier.getVersion());
+        assertNull  ("description",               identifier.getDescription());
 
         // NamedIdentifier properties
         assertEquals("depth",  2,          identifier.depth());
@@ -142,7 +141,7 @@ public final strictfp class NamedIdentif
     @Test
     @DependsOnMethod("testCreateFromInternationalString")
     public void testSerialization() {
-        NamedIdentifier unserial = assertSerializedEquals(new NamedIdentifier(EPSG, "4326"));
+        NamedIdentifier unserial = assertSerializedEquals(new NamedIdentifier(Citations.EPSG, "4326"));
         assertEquals("EPSG:4326", unserial.toInternationalString().toString(Locale.ENGLISH));
         /*
          * Try again with an international string. We would not been able to get back the

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -173,7 +173,7 @@ public final strictfp class DefaultDeriv
                 "      Ellipsoid[“NTF”, 6378249.2, 293.4660212936269, LengthUnit[“metre”, 1]]],\n" +
                 "      PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967]]],\n" +
                 "  DerivingConversion[“Paris to Greenwich”,\n" +
-                "    Method[“Longitude rotation”, Id[“EPSG”, 9601, Citation[“IOGP”]]],\n" +
+                "    Method[“Longitude rotation”, Id[“EPSG”, 9601]],\n" +
                 "    Parameter[“Longitude offset”, 2.33722917, Id[“EPSG”, 8602]]],\n" +
                 "  CS[“ellipsoidal”, 2],\n" +
                 "    Axis[“Latitude (B)”, north, Order[1]],\n" +

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -120,7 +120,7 @@ public final strictfp class DefaultProje
                 "      Ellipsoid[“NTF”, 6378249.2, 293.4660212936269, LengthUnit[“metre”, 1]]],\n" +
                 "      PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967]]],\n" +
                 "  Conversion[“Lambert zone II”,\n" +
-                "    Method[“Lambert Conic Conformal (1SP)”, Id[“EPSG”, 9801, Citation[“IOGP”]]],\n" +
+                "    Method[“Lambert Conic Conformal (1SP)”, Id[“EPSG”, 9801]],\n" +
                 "    Parameter[“Latitude of natural origin”, 52.0, AngleUnit[“grade”, 0.015707963267948967], Id[“EPSG”, 8801]],\n" +
                 "    Parameter[“Longitude of natural origin”, 0.0, AngleUnit[“degree”, 0.017453292519943295], Id[“EPSG”, 8802]],\n" +
                 "    Parameter[“Scale factor at natural origin”, 0.99987742, ScaleUnit[“unity”, 1], Id[“EPSG”, 8805]],\n" +
@@ -130,7 +130,7 @@ public final strictfp class DefaultProje
                 "    Axis[“Easting (E)”, east, Order[1]],\n" +
                 "    Axis[“Northing (N)”, north, Order[2]],\n" +
                 "    LengthUnit[“metre”, 1],\n" +
-                "  Id[“EPSG”, 27572, Citation[“IOGP”], URI[“urn:ogc:def:crs:EPSG::27572”]]]",
+                "  Id[“EPSG”, 27572, URI[“urn:ogc:def:crs:EPSG::27572”]]]",
                 crs);
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -215,9 +215,9 @@ public final strictfp class DefaultCarte
         final CoordinateSystemAxis N = cs.getAxis(1);
         assertEquals("name",    "Easting, northing (E,N)", cs.getName().getCode());
         assertEquals("remarks", "Used in ProjectedCRS.", cs.getRemarks().toString());
-        assertIdentifierEquals(        "identifier", "IOGP", "EPSG", null, "4400", getSingleton(cs.getIdentifiers()));
-        assertIdentifierEquals("axis[0].identifier", "IOGP", "EPSG", null, "1",    getSingleton(E.getIdentifiers()));
-        assertIdentifierEquals("axis[1].identifier", "IOGP", "EPSG", null, "2",    getSingleton(N.getIdentifiers()));
+        assertIdentifierEquals(        "identifier", "EPSG Geodetic Parameter Dataset", "EPSG", null, "4400", getSingleton(cs.getIdentifiers()));
+        assertIdentifierEquals("axis[0].identifier", "EPSG Geodetic Parameter Dataset", "EPSG", null, "1",    getSingleton(E.getIdentifiers()));
+        assertIdentifierEquals("axis[1].identifier", "EPSG Geodetic Parameter Dataset", "EPSG", null, "2",    getSingleton(N.getIdentifiers()));
         /*
          * Marshal and compare with the original file.
          */

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -129,9 +129,9 @@ public final strictfp class DefaultEllip
         final CoordinateSystemAxis λ = cs.getAxis(1);
         assertEquals("name",    "Latitude (north), Longitude (east)",     cs.getName().getCode());
         assertEquals("remarks", "Used in two-dimensional GeographicCRS.", cs.getRemarks().toString());
-        assertIdentifierEquals(        "identifier", "IOGP", "EPSG", null, "6422", getSingleton(cs.getIdentifiers()));
-        assertIdentifierEquals("axis[0].identifier", "IOGP", "EPSG", null, "106",  getSingleton(φ.getIdentifiers()));
-        assertIdentifierEquals("axis[1].identifier", "IOGP", "EPSG", null, "107",  getSingleton(λ.getIdentifiers()));
+        assertIdentifierEquals(        "identifier", "EPSG Geodetic Parameter Dataset", "EPSG", null, "6422", getSingleton(cs.getIdentifiers()));
+        assertIdentifierEquals("axis[0].identifier", "EPSG Geodetic Parameter Dataset", "EPSG", null, "106",  getSingleton(φ.getIdentifiers()));
+        assertIdentifierEquals("axis[1].identifier", "EPSG Geodetic Parameter Dataset", "EPSG", null, "107",  getSingleton(λ.getIdentifiers()));
         assertEquals("axis[0].abbreviation", "φ", φ.getAbbreviation());
         assertEquals("axis[1].abbreviation", "λ", λ.getAbbreviation());
         /*

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -268,18 +268,18 @@ public final strictfp class DefaultGeode
         assertWktEquals(Convention.WKT2,
                 "Datum[“World Geodetic System 1984”,\n" +
                 "  Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, LengthUnit[“metre”, 1]],\n" +
-                "  Id[“EPSG”, 6326, Citation[“IOGP”], URI[“urn:ogc:def:datum:EPSG::6326”]]]",
+                "  Id[“EPSG”, 6326, URI[“urn:ogc:def:datum:EPSG::6326”]]]",
                 datum);
 
         assertWktEquals(Convention.INTERNAL,
                 "Datum[“World Geodetic System 1984”,\n" +
-                "  Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, Id[“EPSG”, 7030, Citation[“IOGP”]],\n" +
+                "  Ellipsoid[“WGS 84”, 6378137.0, 298.257223563, Id[“EPSG”, 7030],\n" +
                 "    Remarks[“Defining parameters cited in EPSG database.”]],\n" +
                 "  Anchor[“Station coordinates changed by a few centimetres in 1994, 1997, 2002 and 2012.”],\n" +
                 "  Scope[“Satellite navigation.”],\n" +
                 "  Area[“World.”],\n" +
                 "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
-                "  Id[“EPSG”, 6326, Citation[“IOGP”]],\n" +
+                "  Id[“EPSG”, 6326],\n" +
                 "  Remarks[“No distinction between the original and subsequent WGS 84 frames.”]]",
                 datum);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -150,9 +150,9 @@ public final strictfp class DefaultPrime
         assertWktEquals(Convention.WKT1,
                 "PRIMEM[“Paris”, 2.33722917, AUTHORITY[“EPSG”, “8903”]]", pm);
         assertWktEquals(Convention.WKT2,
-                "PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“IOGP”], URI[“urn:ogc:def:meridian:EPSG::8903”]]]", pm);
+                "PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, URI[“urn:ogc:def:meridian:EPSG::8903”]]]", pm);
         assertWktEquals(Convention.INTERNAL,
-                "PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903, Citation[“IOGP”]],\n" +
+                "PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967], Id[“EPSG”, 8903],\n" +
                 "  Remarks[“Equivalent to 2°20′14.025″.”]]", pm);
         assertXmlEquals(
                 "<gml:PrimeMeridian xmlns:gml=\"" + Namespaces.GML + "\">\n" +

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -104,7 +104,7 @@ public final strictfp class DefaultTempo
     @Test
     public void testUnmarshalling() throws JAXBException {
         final DefaultTemporalDatum datum = unmarshalFile(DefaultTemporalDatum.class, XML_FILE);
-        assertIdentifierEquals("identifier", "SIS", "SIS", null, "MJ",
+        assertIdentifierEquals("identifier", "Apache Spatial Information System", "SIS", null, "MJ",
                 getSingleton(datum.getIdentifiers()));
         assertEquals("name", "Modified Julian",
                 datum.getName().getCode());

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -25,8 +25,8 @@ import org.opengis.referencing.operation
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
-import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 import org.apache.sis.parameter.DefaultParameterDescriptorGroup;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
@@ -66,7 +66,7 @@ public final strictfp class DefaultOpera
         final Map<String,Object> properties = new HashMap<>(8);
         assertNull(properties.put(OperationMethod.NAME_KEY, method));
         assertNull(properties.put(Identifier.CODESPACE_KEY, "EPSG"));
-        assertNull(properties.put(Identifier.AUTHORITY_KEY, HardCodedCitations.IOGP));
+        assertNull(properties.put(Identifier.AUTHORITY_KEY, Citations.EPSG));
         /*
          * The parameter group for a Mercator projection is actually not empty, but it is not the purpose of
          * this class to test DefaultParameterDescriptorGroup. So we use an empty group of parameters here.
@@ -77,7 +77,7 @@ public final strictfp class DefaultOpera
          * Then define the other properties to be given to OperationMethod.
          */
         assertNotNull(properties.put(OperationMethod.NAME_KEY, pg.getName()));
-        assertNull(properties.put(OperationMethod.IDENTIFIERS_KEY, new ImmutableIdentifier(HardCodedCitations.IOGP, "EPSG", identifier)));
+        assertNull(properties.put(OperationMethod.IDENTIFIERS_KEY, new ImmutableIdentifier(Citations.EPSG, "EPSG", identifier)));
         assertNull(properties.put(OperationMethod.FORMULA_KEY, new DefaultCitation(formula)));
         return new DefaultOperationMethod(properties, dimension, dimension, pg);
     }
@@ -161,7 +161,7 @@ public final strictfp class DefaultOpera
     @DependsOnMethod("testConstruction")
     public void testWKT() {
         final OperationMethod method = create("Mercator (variant A)", "9804", "EPSG guidance note #7-2", 2);
-        assertWktEquals("Method[“Mercator (variant A)”, Id[“EPSG”, 9804, Citation[“IOGP”], URI[“urn:ogc:def:method:EPSG::9804”]]]", method);
+        assertWktEquals("Method[“Mercator (variant A)”, Id[“EPSG”, 9804, URI[“urn:ogc:def:method:EPSG::9804”]]]", method);
         assertWktEquals(Convention.WKT1, "PROJECTION[“Mercator (variant A)”, AUTHORITY[“EPSG”, “9804”]]", method);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -176,7 +176,7 @@ public final strictfp class DefaultTrans
                 "      Axis[“(Y)”, geocentricY, Order[2]],\n" +
                 "      Axis[“(Z)”, geocentricZ, Order[3]],\n" +
                 "      LengthUnit[“metre”, 1]]],\n" +
-                "  Method[“Geocentric translations”, Id[“EPSG”, 1031, Citation[“IOGP”]]],\n" +
+                "  Method[“Geocentric translations”, Id[“EPSG”, 1031]],\n" +
                 "  Parameter[“X-axis translation”, -146.414, Id[“EPSG”, 8605]],\n" +
                 "  Parameter[“Y-axis translation”, 507.337, Id[“EPSG”, 8606]],\n" +
                 "  Parameter[“Z-axis translation”, 680.507, Id[“EPSG”, 8607]]]", op);

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] Thu May 28 16:51:05 2015
@@ -79,7 +79,7 @@ public strictfp class ReferencingAssert
 
     /**
      * Asserts that the given identifier has the expected code and the {@code "EPSG"} code space.
-     * The authority is expected to have the {@code "IOGP"} title or alternate title.
+     * The authority is expected to have the {@code "EPSG"} title, alternate title or identifier.
      *
      * @param expected The expected identifier code.
      * @param actual   The identifier to verify.
@@ -90,7 +90,7 @@ public strictfp class ReferencingAssert
         assertNotNull(actual);
         assertEquals("code",       expected, actual.getCode());
         assertEquals("codeSpace",  EPSG,  actual.getCodeSpace());
-        assertEquals("authority",  IOGP,  Citations.getIdentifier(actual.getAuthority()));
+        assertEquals("authority",  EPSG,  Citations.getIdentifier(actual.getAuthority()));
         assertEquals("identifier", EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + expected,
                 IdentifiedObjects.toString(actual));
     }
@@ -100,8 +100,8 @@ public strictfp class ReferencingAssert
      * EPSG code. As a special case if the given code is 0, then this method verifies that the given object has no
      * identifier.
      *
-     * @param expected    The expected EPSG code, or {@code 0} if we expect no EPSG code.
-     * @param actual The set of identifiers in which to verify the EPSG code.
+     * @param expected The expected EPSG code, or {@code 0} if we expect no EPSG code.
+     * @param actual   The set of identifiers in which to verify the EPSG code.
      */
     public static void assertEpsgIdentifierEquals(final int expected, final Collection<? extends Identifier> actual) {
         assertNotNull(actual);

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] Thu May 28 16:51:05 2015
@@ -180,7 +180,8 @@ public final strictfp class ReferencingI
      * @param object The object to verify.
      */
     private static void verifyIdentifiers(final String code, final IdentifiedObject object) {
-        assertIdentifierEquals("identifier", "SIS", "SIS", null, code, getSingleton(object.getIdentifiers()));
+        assertIdentifierEquals("identifier", "Apache Spatial Information System", "SIS",
+                null, code, getSingleton(object.getIdentifiers()));
         assertIdentifierEquals("name", null, null, null, "Depth", object.getName());
     }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java [UTF-8] Thu May 28 16:51:05 2015
@@ -19,18 +19,10 @@ package org.apache.sis.internal.jaxb;
 import java.util.Iterator;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Locale;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.io.Serializable;
-import java.lang.reflect.Field;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
-import org.apache.sis.internal.simple.SimpleCitation;
+import org.apache.sis.internal.simple.CitationConstant;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
-import org.apache.sis.util.Debug;
-import org.apache.sis.util.logging.Logging;
-import org.apache.sis.util.resources.Errors;
 import org.apache.sis.xml.IdentifierSpace;
 
 
@@ -65,29 +57,23 @@ import org.apache.sis.xml.IdentifierSpac
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.6
  * @module
  *
  * @see IdentifierSpace
  */
-public final class NonMarshalledAuthority<T> extends SimpleCitation implements IdentifierSpace<T>, Serializable {
+public final class NonMarshalledAuthority<T> extends CitationConstant.Authority<T> {
     /**
      * For cross-version compatibility.
      */
     private static final long serialVersionUID = 6299502270649111201L;
 
     /**
-     * Sets to {@code true} if {@link #getCitation(String)} has already logged a warning.
-     * This is used in order to avoid flooding the logs with the same message.
-     */
-    private static volatile boolean warningLogged;
-
-    /**
      * Ordinal values for switch statements. The constant defined here shall
      * mirror the constants defined in the {@link IdentifierSpace} interface
      * and {@link org.apache.sis.metadata.iso.citation.DefaultCitation} class.
      */
-    public static final int ID=0, UUID=1, HREF=2, XLINK=3, ISSN=4, ISBN=5;
+    public static final byte ID=0, UUID=1, HREF=2, XLINK=3, ISSN=4, ISBN=5;
     // If more codes are added, please update readResolve() below.
 
     /**
@@ -98,39 +84,21 @@ public final class NonMarshalledAuthorit
      * versions of the SIS library (the attribute name is more reliable). This instance should
      * be replaced by one of the exiting constants at deserialization time anyway.</p>
      */
-    final transient int ordinal;
+    final transient byte ordinal;
 
     /**
-     * Creates a new enum for the given attribute.
+     * Creates a new citation for the given XML attribute name.
      *
      * @param attribute The XML attribute name, to be returned by {@link #getName()}.
      * @param ordinal   Ordinal value for switch statement, as one of the {@link #ID},
      *                  {@link #UUID}, <i>etc.</i> constants.
      */
-    public NonMarshalledAuthority(final String attribute, final int ordinal) {
+    public NonMarshalledAuthority(final String attribute, final byte ordinal) {
         super(attribute);
         this.ordinal = ordinal;
     }
 
     /**
-     * Returns the XML attribute name with its prefix. Attribute names can be {@code "gml:id"},
-     * {@code "gco:uuid"} or {@code "xlink:href"}.
-     */
-    @Override
-    public String getName() {
-        return title;
-    }
-
-    /**
-     * Returns a string representation of this identifier space.
-     */
-    @Debug
-    @Override
-    public String toString() {
-        return "IdentifierSpace[" + title + ']';
-    }
-
-    /**
      * Returns the first marshallable identifier from the given collection. This method omits
      * "special" identifiers (ISO 19139 attributes, ISBN codes...), which are recognized by
      * the implementation class of their authority.
@@ -269,54 +237,25 @@ public final class NonMarshalledAuthorit
     }
 
     /**
-     * Returns one of the constants in the {@link org.apache.sis.metadata.iso.citation.DefaultCitation} class,
-     * or {@code null} if none. We need to use Java reflection because the {@code sis-metadata} module may not
-     * be in the classpath.
-     */
-    private static IdentifierSpace<?> getCitation(final String name) {
-        try {
-            final Field field = Class.forName("org.apache.sis.metadata.iso.citation.DefaultCitation").getDeclaredField(name);
-            field.setAccessible(true);
-            return (IdentifierSpace<?>) field.get(null);
-        } catch (ReflectiveOperationException e) {
-            if (!warningLogged) {
-                warningLogged = true;
-                final LogRecord record = Errors.getResources((Locale) null).getLogRecord(Level.WARNING,
-                        Errors.Keys.MissingRequiredModule_1, "sis-metadata");
-                /*
-                 * Log directly the the logger rather than invoking the Context.warningOccured(…) method because
-                 * this warning does not occur during XML (un)marshalling. It may occurs only during serialization.
-                 */
-                record.setThrown(e);
-                Logging.log(NonMarshalledAuthority.class, "readResolve", record);
-            }
-        }
-        return null;
-    }
-
-    /**
      * Invoked at deserialization time in order to replace the deserialized instance
      * by the appropriate instance defined in the {@link IdentifierSpace} interface.
+     *
+     * @return The instance to use, as an unique instance if possible.
      */
-    private Object readResolve() {
+    @Override
+    protected Object readResolve() {
+        final String name = getName();
+        IdentifierSpace<?> candidate;
         int code = 0;
-        while (true) {
-            final IdentifierSpace<?> candidate;
-            switch (code) {
+        do {
+            switch (code++) {
                 case ID:    candidate = IdentifierSpace.ID;    break;
                 case UUID:  candidate = IdentifierSpace.UUID;  break;
                 case HREF:  candidate = IdentifierSpace.HREF;  break;
                 case XLINK: candidate = IdentifierSpace.XLINK; break;
-                case ISBN:  candidate = getCitation("ISBN");   break;
-                case ISSN:  candidate = getCitation("ISSN");   break;
-                default: return this;
-            }
-            if (candidate instanceof NonMarshalledAuthority<?> &&
-                    ((NonMarshalledAuthority<?>) candidate).title.equals(title))
-            {
-                return candidate;
+                default: return super.readResolve();
             }
-            code++;
-        }
+        } while (!((NonMarshalledAuthority<?>) candidate).getName().equals(name));
+        return candidate;
     }
 }

Copied: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java (from r1682275, sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Authority.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java?p2=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java&p1=sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Authority.java&r1=1682275&r2=1682276&rev=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Authority.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java [UTF-8] Thu May 28 16:51:05 2015
@@ -14,50 +14,165 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.metadata.iso.citation;
+package org.apache.sis.internal.simple;
 
-import org.apache.sis.internal.simple.SimpleCitation;
+import java.util.Date;
+import java.util.Collection;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.citation.CitationDate;
+import org.opengis.metadata.citation.OnlineResource;
+import org.opengis.metadata.citation.PresentationForm;
+import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.Series;
+import org.opengis.metadata.identification.BrowseGraphic;
+import org.opengis.util.InternationalString;
+import org.apache.sis.util.Debug;
 import org.apache.sis.xml.IdentifierSpace;
+import org.apache.sis.internal.util.MetadataServices;
 
 
 /**
- * A citation constant also used as a namespace for identifiers.
- *
- * @param <T> The identifier type.
+ * Base class for the {@code public static final Citation} constants defined in some SIS classes.
+ * This base class contains only an abbreviation (e.g. {@code "OGC"} or {@code "EPSG"}) which can
+ * be used as the primary key where to search for more information in a database. If no database
+ * is available, then that simple primary key will be used as the citation title.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @since   0.4
- * @version 0.4
+ * @since   0.6
+ * @version 0.6
  * @module
  *
- * @see Citations#EPSG
+ * @see IdentifierSpace
+ * @see org.apache.sis.metadata.iso.citation.Citations
  */
-final class Authority<T> extends SimpleCitation implements IdentifierSpace<T> {
+public class CitationConstant extends SimpleCitation {
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = 9049409961960288134L;
+    private static final long serialVersionUID = 7812463864874105717L;
+
+    /**
+     * Class of {@code public static final Citation} constants which are also used as namespace for identifiers.
+     * The most typical example is the "EPSG" authority which manage the codes identifying Coordinate Reference
+     * System (CRS) objects in the EPSG namespace.
+     *
+     * @param <T> The type of object used as identifier values.
+     */
+    public static class Authority<T> extends CitationConstant implements IdentifierSpace<T> {
+        /**
+         * For cross-version compatibility.
+         */
+        private static final long serialVersionUID = 2067932813561130294L;
+
+        /**
+         * Creates a new citation for an authority managing codes in the given namespace.
+         *
+         * @param namespace The namespace of codes managed by this authority (e.g. "EPSG").
+         */
+        public Authority(final String namespace) {
+            super(namespace);
+        }
+
+        /**
+         * Returns the name space given at construction time. Can be one of the following:
+         * <ul>
+         *   <li>Abbreviation of the authority managing the codes (e.g. {@code "EPSG"} or {@code "ISBN"}).</li>
+         *   <li>XML attribute name with its prefix (e.g. {@code "gml:id"}, {@code "gco:uuid"} or {@code "xlink:href"}).</li>
+         * </ul>
+         */
+        @Override
+        public final String getName() {
+            return title;
+        }
+
+        /**
+         * Returns a string representation of this identifier space.
+         */
+        @Debug
+        @Override
+        public final String toString() {
+            return "IdentifierSpace[“" + getName() + "”]";
+        }
+    }
+
+    /**
+     * The citation which contain the "real" data, or {@code null} if not yet created.
+     */
+    private transient volatile Citation delegate;
+
+    /**
+     * Creates a new proxy for the given primary key.
+     * The key should be readable enough for being usable as a fallback if the database is not available.
+     *
+     * @param name A human-understandable primary key for fetching more information.
+     */
+    public CitationConstant(final String name) {
+        super(name);
+    }
 
     /**
-     * The identifier namespace.
+     * Notify this instance that the database content may have changed, or that the classpath has changed.
      */
-    private final String namespace;
+    public final void refresh() {
+        delegate = null;
+    }
 
     /**
-     * Creates a new citation of the given title.
+     * Returns the citation instance which contain the actual data. That instance is provided by the
+     * {@code sis-metadata} module, which is optional.  If that module is not on the classpath, then
+     * this {@code delegate()} method will use the few information provided by the current instance.
      *
-     * @param title The title to be returned by {@link #getTitle()}.
+     * <p>Note that it should be very rare to not have {@code sis-metadata} on the classpath,
+     * since that module is required by {@code sis-referencing} which is itself required by
+     * almost all other SIS modules.</p>
      */
-    Authority(final String title, final String namespace) {
-        super(title);
-        this.namespace = namespace;
+    private Citation delegate() {
+        Citation c = delegate;
+        if (c == null) {
+            synchronized (this) {
+                c = delegate;
+                if (c == null) {
+                    c = MetadataServices.getInstance().createCitation(title);
+                    if (c == null) {
+                        // 'sis-metadata' module not on the classpath (should be very rare).
+                        c = new SimpleCitation(title);
+                    }
+                    delegate = c;
+                }
+            }
+        }
+        return c;
     }
 
     /**
-     * Returns the name of this identifier space.
+     * Redirects the call to the delegate citation (the instance which actually contain the data).
+     *
+     * @return The value returned by the delegate.
+     */
+    @Override public InternationalString                        getTitle()                   {return delegate().getTitle();}
+    @Override public Collection<? extends InternationalString>  getAlternateTitles()         {return delegate().getAlternateTitles();}
+    @Override public Collection<? extends CitationDate>         getDates()                   {return delegate().getDates();}
+    @Override public InternationalString                        getEdition()                 {return delegate().getEdition();}
+    @Override public Date                                       getEditionDate()             {return delegate().getEditionDate();}
+    @Override public Collection<? extends Identifier>           getIdentifiers()             {return delegate().getIdentifiers();}
+    @Override public Collection<? extends Responsibility>       getCitedResponsibleParties() {return delegate().getCitedResponsibleParties();}
+    @Override public Collection<PresentationForm>               getPresentationForms()       {return delegate().getPresentationForms();}
+    @Override public Series                                     getSeries()                  {return delegate().getSeries();}
+    @Override public Collection<? extends InternationalString>  getOtherCitationDetails()    {return delegate().getOtherCitationDetails();}
+    @Override public Collection<? extends OnlineResource>       getOnlineResources()         {return delegate().getOnlineResources();}
+    @Override public Collection<? extends BrowseGraphic>        getGraphics()                {return delegate().getGraphics();}
+    @Override public String                                     getISBN()                    {return delegate().getISBN();}
+    @Override public String                                     getISSN()                    {return delegate().getISSN();}
+
+    /**
+     * Invoked at deserialization time in order to replace the deserialized instance by the existing
+     * instance defined in the {@link org.apache.sis.metadata.iso.citation.Citations} class.
+     *
+     * @return The instance to use, as an unique instance if possible.
      */
-    @Override
-    public String getName() {
-        return namespace;
+    protected Object readResolve() {
+        final Citation c = MetadataServices.getInstance().getCitationConstant(title);
+        return (c != null) ? c : this;
     }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java [UTF-8] Thu May 28 16:51:05 2015
@@ -39,6 +39,12 @@ import java.util.Objects;
 /**
  * A trivial implementation of {@link Citation} containing only a title.
  *
+ * <div class="note"><b>Design note:</b>
+ * we do not put more field than {@link #title} in this {@code SimpleCitation} in order to keep it simple,
+ * because the title is the only "universal" property (the need for all other fields will be determined in
+ * subclasses on a case-by-case basis) and because {@code SimpleCitation} are sometime only proxy identified
+ * by the {@link #title}.</div>
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
  * @version 0.3
@@ -53,10 +59,10 @@ public class SimpleCitation implements C
     /**
      * The title to be returned by {@link #getTitle()}.
      */
-    protected final String title;
+    public final String title;
 
     /**
-     * Creates a new object for the given name.
+     * Creates a new object for the given title.
      *
      * @param title The title to be returned by {@link #getTitle()}.
      */
@@ -75,27 +81,26 @@ public class SimpleCitation implements C
     }
 
     /**
-     * Methods inherited from the {@link Citation} interface which are
-     * not of interest to this {@code SimpleCitation} implementation.
-     * Those methods will be removed in the JDK8 branch.
+     * Methods inherited from the {@link Citation} interface which are not of interest to this
+     * {@code SimpleCitation} implementation. Those methods may be removed in the JDK8 branch.
      *
      * @return An empty list.
      */
-    @Override public Collection<InternationalString>  getAlternateTitles()         {return Collections.emptyList();}
-    @Override public Collection<CitationDate>         getDates()                   {return Collections.emptyList();}
-    @Override public InternationalString              getEdition()                 {return null;}
-    @Override public Date                             getEditionDate()             {return null;}
-    @Override public Collection<? extends Identifier> getIdentifiers()             {return Collections.emptyList();}
-    @Override public Collection<Responsibility>       getCitedResponsibleParties() {return Collections.emptyList();}
-    @Override public Collection<PresentationForm>     getPresentationForms()       {return Collections.emptyList();}
-    @Override public Series                           getSeries()                  {return null;}
-    @Override public Collection<InternationalString>  getOtherCitationDetails()    {return Collections.emptyList();}
-    @Override public String                           getISBN()                    {return null;}
-    @Override public String                           getISSN()                    {return null;}
-    @Override public Collection<OnlineResource>       getOnlineResources()         {return Collections.emptyList();}
-    @Override public Collection<BrowseGraphic>        getGraphics()                {return Collections.emptyList();}
+    @Override public Collection<? extends InternationalString>  getAlternateTitles()         {return Collections.emptyList();}
+    @Override public Collection<? extends CitationDate>         getDates()                   {return Collections.emptyList();}
+    @Override public InternationalString                        getEdition()                 {return null;}
+    @Override public Date                                       getEditionDate()             {return null;}
+    @Override public Collection<? extends Identifier>           getIdentifiers()             {return Collections.emptyList();}
+    @Override public Collection<? extends Responsibility>       getCitedResponsibleParties() {return Collections.emptyList();}
+    @Override public Collection<PresentationForm>               getPresentationForms()       {return Collections.emptyList();}
+    @Override public Series                                     getSeries()                  {return null;}
+    @Override public Collection<? extends InternationalString>  getOtherCitationDetails()    {return Collections.emptyList();}
+    @Override public Collection<? extends OnlineResource>       getOnlineResources()         {return Collections.emptyList();}
+    @Override public Collection<? extends BrowseGraphic>        getGraphics()                {return Collections.emptyList();}
+    @Override public String                                     getISBN()                    {return null;}
+    @Override public String                                     getISSN()                    {return null;}
     @Deprecated
-    @Override public InternationalString              getCollectiveTitle()         {return null;}
+    @Override public InternationalString                        getCollectiveTitle()         {return null;}
 
     /**
      * Compares the given object with this citation for equality.
@@ -125,6 +130,6 @@ public class SimpleCitation implements C
     @Debug
     @Override
     public String toString() {
-        return "Citation[\"" + title + "\"]";
+        return "Citation[“" + title + "”]";
     }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] Thu May 28 16:51:05 2015
@@ -24,6 +24,7 @@ import org.apache.sis.internal.util.Cita
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.Debug;
+import org.apache.sis.util.Deprecable;
 
 import static org.apache.sis.util.iso.DefaultNameSpace.DEFAULT_SEPARATOR;
 
@@ -39,10 +40,10 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.6
  * @module
  */
-public class SimpleIdentifier implements Identifier, Serializable {
+public class SimpleIdentifier implements Identifier, Deprecable, Serializable {
     /**
      * For cross-version compatibility.
      */
@@ -69,14 +70,21 @@ public class SimpleIdentifier implements
     protected final String code;
 
     /**
+     * {@code true} if this identifier is deprecated.
+     */
+    protected final boolean isDeprecated;
+
+    /**
      * Creates a new reference identifier.
      *
-     * @param authority Responsible party for definition and maintenance of the code, or null.
-     * @param code Alphanumeric value identifying an instance in the namespace.
-     */
-    public SimpleIdentifier(final Citation authority, final String code) {
-        this.authority = authority;
-        this.code = code;
+     * @param authority     Responsible party for definition and maintenance of the code, or null.
+     * @param code          Alphanumeric value identifying an instance in the namespace.
+     * @param isDeprecated  {@code true} if this identifier is deprecated.
+     */
+    public SimpleIdentifier(final Citation authority, final String code, final boolean isDeprecated) {
+        this.authority    = authority;
+        this.code         = code;
+        this.isDeprecated = isDeprecated;
     }
 
     /**
@@ -150,6 +158,26 @@ public class SimpleIdentifier implements
     }
 
     /**
+     * An optional free text.
+     *
+     * @since 0.6
+     */
+    @Override
+    public InternationalString getRemarks() {
+        return null;
+    }
+
+    /**
+     * {@code true} if this identifier is deprecated.
+     *
+     * @since 0.6
+     */
+    @Override
+    public boolean isDeprecated() {
+        return isDeprecated;
+    }
+
+    /**
      * Returns {@code true} if the given object is of the same class than this
      * {@code SimpleIdentifier} and has the same values.
      *
@@ -160,7 +188,9 @@ public class SimpleIdentifier implements
     public boolean equals(final Object obj) {
         if (obj != null && obj.getClass() == getClass()) {
             final SimpleIdentifier that = (SimpleIdentifier) obj;
-            return Objects.equals(code, that.code) && Objects.equals(authority, that.authority);
+            return Objects.equals(code, that.code) &&
+                   Objects.equals(authority, that.authority) &&
+                   isDeprecated == that.isDeprecated;
         }
         return false;
     }
@@ -172,7 +202,7 @@ public class SimpleIdentifier implements
      */
     @Override
     public int hashCode() {
-        return Objects.hash(authority, code) ^ (int) serialVersionUID;
+        return Objects.hash(authority, code, isDeprecated) ^ (int) serialVersionUID;
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java [UTF-8] Thu May 28 16:51:05 2015
@@ -28,7 +28,7 @@ import org.apache.sis.util.ArraysExt;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.6
  * @module
  */
 public abstract class SystemListener implements EventListener {
@@ -45,7 +45,7 @@ public abstract class SystemListener imp
     private final String module;
 
     /**
-     * Creates a nes listener.
+     * Creates a new listener.
      *
      * @param module The OSGi module symbolic name, as declared in the {@code Bundle-SymbolicName}
      *        entry of the {@code META-INF/MANIFEST.MF} file. Shall be one of {@link Modules} constants.
@@ -134,7 +134,16 @@ public abstract class SystemListener imp
 
     /**
      * Invoked when the classpath is likely to have changed.
-     * Any classes using {@link java.util.ServiceLoader} are advised to clear their cache.
+     * When this method is invoked, any classes using {@link java.util.ServiceLoader} are advised to clear their cache.
      */
     protected abstract void classpathChanged();
+
+    /**
+     * Invoked when the database content changed.
+     * When this method is invoked, EPSG and Citations database are advised to clear their cache.
+     *
+     * @since 0.6
+     */
+    protected void databaseChanged() {
+    }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java?rev=1682276&r1=1682275&r2=1682276&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] Thu May 28 16:51:05 2015
@@ -25,13 +25,9 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Characters;
+import org.apache.sis.util.Deprecable;
 import org.apache.sis.util.Static;
 
-import static org.apache.sis.util.CharSequences.equalsFiltered;
-import static org.apache.sis.util.CharSequences.trimWhitespaces;
-import static org.apache.sis.util.CharSequences.isUnicodeIdentifier;
-import static org.apache.sis.util.Characters.Filter.LETTERS_AND_DIGITS;
-
 // Branch-dependent imports
 import java.util.Objects;
 
@@ -66,12 +62,34 @@ public final class Citations extends Sta
     }
 
     /**
+     * Return {@code true} if the given object is deprecated.
+     */
+    private static boolean isDeprecated(final Object object) {
+        return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated();
+    }
+
+    /**
      * Returns a "unlocalized" string representation of the given international string,
      * or {@code null} if none. This method is used by {@link #getIdentifier(Citation, boolean)},
      * which is why we don't want the localized string.
      */
     private static String toString(final InternationalString title) {
-        return (title != null) ? trimWhitespaces(title.toString(Locale.ROOT)) : null;
+        return (title != null) ? CharSequences.trimWhitespaces(title.toString(Locale.ROOT)) : null;
+    }
+
+    /**
+     * The method to be used consistently for comparing titles or identifiers in all {@code fooMathes(…)}
+     * methods declared in this class.
+     *
+     * @param  s1 The first characters sequence to compare, or {@code null}.
+     * @param  s2 The second characters sequence to compare, or {@code null}.
+     * @return {@code true}if both arguments are {@code null} or if the two given texts are equal,
+     *         ignoring case and any characters other than digits and letters.
+     *
+     * @since 0.6
+     */
+    public static boolean equalsFiltered(final CharSequence s1, final CharSequence s2) {
+        return CharSequences.equalsFiltered(s1, s2, Characters.Filter.LETTERS_AND_DIGITS, true);
     }
 
     /**
@@ -133,12 +151,12 @@ public final class Citations extends Sta
             do {
                 if (candidate != null) {
                     final String unlocalized = candidate.toString(Locale.ROOT);
-                    if (equalsFiltered(unlocalized, title, LETTERS_AND_DIGITS, true)) {
+                    if (equalsFiltered(unlocalized, title)) {
                         return true;
                     }
                     final String localized = candidate.toString();
                     if (!Objects.equals(localized, unlocalized) // Slight optimization for a common case.
-                            && equalsFiltered(localized, title, LETTERS_AND_DIGITS, true))
+                            && equalsFiltered(localized, title))
                     {
                         return true;
                     }
@@ -196,14 +214,14 @@ public final class Citations extends Sta
 
     /**
      * Returns {@code true} if the given citation has at least one identifier equals to the given string,
-     * ignoring case and non-alphanumeric characters. If and <em>only</em> if the citations do not contain
+     * ignoring case and non-alphanumeric characters. If and <em>only</em> if the citation does not contain
      * any identifier, then this method fallback on titles comparison.
      * See {@link org.apache.sis.metadata.iso.citation.Citations#identifierMatches(Citation, String)}
      * for the public documentation of this method.
      *
      * @param  citation   The citation to check for, or {@code null}.
-     * @param  identifier The identifier to compare, or {@code null} to unknown.
-     * @param  code       The identifier code to compare, or {@code null}.
+     * @param  identifier The identifier to compare, or {@code null} if unknown.
+     * @param  code       Value of {@code identifier.getCode()}, or {@code null}.
      * @return {@code true} if both arguments are non-null, and an identifier matches the given string.
      */
     public static boolean identifierMatches(final Citation citation, final Identifier identifier, final CharSequence code) {
@@ -214,13 +232,13 @@ public final class Citations extends Sta
             }
             while (identifiers.hasNext()) {
                 final Identifier id = identifiers.next();
-                if (id != null && equalsFiltered(code, id.getCode(), LETTERS_AND_DIGITS, true)) {
+                if (id != null && equalsFiltered(code, id.getCode())) {
                     if (identifier != null) {
                         final String codeSpace = identifier.getCodeSpace();
                         if (codeSpace != null) {
                             final String cs = id.getCodeSpace();
                             if (cs != null) {
-                                return equalsFiltered(codeSpace, cs, LETTERS_AND_DIGITS, true);
+                                return equalsFiltered(codeSpace, cs);
                             }
                         }
                     }
@@ -315,18 +333,18 @@ public final class Citations extends Sta
      *         or {@code null} if the given citation is null or does not declare any identifier or title.
      */
     public static String getIdentifier(final Citation citation, final boolean strict) {
-        boolean isUnicode = false; // Whether 'identifier' is a Unicode identifier.
+        boolean isUnicode = false;      // Whether 'identifier' is a Unicode identifier.
         String identifier = null;
         if (citation != null) {
             final Iterator<? extends Identifier> it = iterator(citation.getIdentifiers());
             if (it != null) while (it.hasNext()) {
                 final Identifier id = it.next();
-                if (id != null) {
-                    final String candidate = trimWhitespaces(id.getCode());
+                if (id != null && !isDeprecated(id)) {
+                    final String candidate = CharSequences.trimWhitespaces(id.getCode());
                     if (candidate != null) {
                         final int length = candidate.length();
                         if (length != 0 && (identifier == null || length < identifier.length())) {
-                            final boolean s = isUnicodeIdentifier(candidate);
+                            final boolean s = CharSequences.isUnicodeIdentifier(candidate);
                             if (s || !isUnicode) {
                                 identifier = candidate;
                                 isUnicode = s;
@@ -341,12 +359,12 @@ public final class Citations extends Sta
              * often used for abbreviations.
              */
             if (identifier == null) {
-                identifier = toString(citation.getTitle()); // Whitepaces removed by toString(…).
+                identifier = toString(citation.getTitle());     // Whitepaces removed by toString(…).
                 if (identifier != null) {
                     if (identifier.isEmpty()) {
                         identifier = null;
                     } else {
-                        isUnicode = isUnicodeIdentifier(identifier);
+                        isUnicode = CharSequences.isUnicodeIdentifier(identifier);
                     }
                 }
                 final Iterator<? extends InternationalString> iterator = iterator(citation.getAlternateTitles());
@@ -355,7 +373,7 @@ public final class Citations extends Sta
                     if (candidate != null) {
                         final int length = candidate.length();
                         if (length != 0 && (identifier == null || length < identifier.length())) {
-                            final boolean s = isUnicodeIdentifier(candidate);
+                            final boolean s = CharSequences.isUnicodeIdentifier(candidate);
                             if (s || !isUnicode) {
                                 identifier = candidate;
                                 isUnicode = s;
@@ -430,9 +448,11 @@ public final class Citations extends Sta
 
     /**
      * Infers a code space from the given citation, or returns {@code null} if none.
-     * This method is very close to {@link #getUnicodeIdentifier(Citation)}; its main difference is regarding
-     * the {@link org.apache.sis.metadata.iso.citation.Citations#EPSG} constant: this method returns "EPSG"
-     * instead than "IOGP".
+     * This method is very close to {@link #getUnicodeIdentifier(Citation)}, except that it looks for
+     * {@link IdentifierSpace#getName()} before to scan the identifiers and titles. The result should
+     * be the same in most cases, except some cases like the SIS citation constant for {@code "Proj.4"}
+     * in which case this method returns {@code "Proj4"} instead of {@code null}. As a side effect,
+     * using this method also avoid constructing the full {@code DefaultCitation} objects when not needed
      *
      * @param  citation The citation for which to infer the code space, or {@code null}.
      * @return A non-empty code space for the given citation without leading or trailing whitespaces,

Added: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java?rev=1682276&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java (added)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java [UTF-8] Thu May 28 16:51:05 2015
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.util;
+
+import org.opengis.metadata.citation.Citation;
+import org.apache.sis.internal.system.Modules;
+import org.apache.sis.internal.system.SystemListener;
+import org.apache.sis.util.logging.Logging;
+
+
+/**
+ * Provides access to services defined in the {@code "sis-metadata"} module.
+ * This class searches for the {@link org.apache.sis.internal.metadata.ServicesForUtility}
+ * implementation using Java reflection.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+public class MetadataServices extends SystemListener {
+    /**
+     * The services, fetched when first needed.
+     */
+    private static volatile MetadataServices instance;
+
+    /**
+     * For subclass only. This constructor registers this instance as a {@link SystemListener}
+     * in order to force a new {@code MetadataServices} lookup if the classpath changes.
+     */
+    protected MetadataServices() {
+        super(Modules.UTILITIES);
+        SystemListener.add(this);
+    }
+
+    /**
+     * Invoked when the classpath changed. Resets the {@link #instance} to {@code null} in order
+     * to force the next call to {@link #getInstance()} to fetch a new one, which may be different.
+     */
+    @Override
+    protected final void classpathChanged() {
+        synchronized (MetadataServices.class) {
+            SystemListener.remove(this);
+            instance = null;
+        }
+    }
+
+    /**
+     * Returns the singleton instance.
+     *
+     * @return The singleton instance.
+     */
+    public static MetadataServices getInstance() {
+        MetadataServices c = instance;
+        if (c == null) {
+            synchronized (MetadataServices.class) {
+                c = instance;
+                if (c == null) {
+                    /*
+                     * Double-checked locking: okay since Java 5 provided that the 'instance' field is volatile.
+                     * In the particular case of this class, the intend is to ensure that SystemListener.add(…)
+                     * is invoked only once.
+                     */
+                    try {
+                        c = (MetadataServices) Class.forName("org.apache.sis.internal.metadata.ServicesForUtility").newInstance();
+                    } catch (ClassNotFoundException exception) {
+                        Logging.recoverableException(MetadataServices.class, "getInstance", exception);
+                        c = new MetadataServices();
+                    } catch (ReflectiveOperationException exception) {
+                        // Should never happen if we didn't broke our helper class.
+                        throw new AssertionError(exception);
+                    }
+                    instance = c;
+                }
+            }
+        }
+        return c;
+    }
+
+    /**
+     * Returns the constant defined in the {@link org.apache.sis.metadata.iso.citation.Citations} class for the
+     * given name. This is used at {@link org.apache.sis.internal.simple.CitationConstant} deserialization time,
+     * for which the two citations of interest are {@code "ISBN"} (International Standard Book Number) and
+     * {@code "ISSN"} (International Standard Serial Number) citation.
+     *
+     * @param  name The name of one of the citation constants defined in the {@code Citations} class.
+     * @return The requested citation, or {@code null} if the {@code sis-metadata} module is not available.
+     */
+    public Citation getCitationConstant(final String name) {
+        return null;
+    }
+
+    /**
+     * Returns the build-in citation for the given primary key, or {@code null} if none.
+     * The metadata module will search in a database for information like a descriptive
+     * title, abbreviations, identifiers, URL to a web site, <i>etc</i>.
+     *
+     * @param  key The primary key of the desired citation.
+     * @return The requested citation, or {@code null} if the {@code sis-metadata} module is not available.
+     */
+    public Citation createCitation(final String key) {
+        return null;
+    }
+}

Propchange: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message