Author: desruisseaux
Date: Mon Oct  6 01:00:52 2014
New Revision: 1629558

URL: http://svn.apache.org/r1629558
Log:
Merge from the JDK6 branch. This changeset includes the merge of 
ReferenceIdentifier
into the Identifier parent interface, which is only partially applied since we 
do not
yet change the API on trunk (the API is changed on branches however).

Added:
    
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
      - copied, changed from r1629496, 
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
    
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java
      - copied unchanged from r1629496, 
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java
Removed:
    
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java
    
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleReferenceIdentifierTest.java
Modified:
    sis/trunk/   (props changed)
    sis/trunk/core/sis-feature/pom.xml
    
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
   (contents, props changed)
    
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
    
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
    
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
    
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
    
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
    
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java
    
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java
    
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
    
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
    
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldDescriptor.java
    
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java

Propchange: sis/trunk/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1627891-1629469
  Merged /sis/branches/JDK7:r1627894-1629470
  Merged /sis/branches/JDK6:r1627901-1629496

Modified: sis/trunk/core/sis-feature/pom.xml
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/pom.xml?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/pom.xml (original)
+++ sis/trunk/core/sis-feature/pom.xml Mon Oct  6 01:00:52 2014
@@ -58,7 +58,26 @@ Representations of geographic features.
         <role>developer</role>
       </roles>
     </developer>
+    <developer>
+      <name>Martin Desruisseaux</name>
+      <id>desruisseaux</id>
+      <email>[email protected]</email>
+      <organization>Geomatys</organization>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
+      <timezone>+1</timezone>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </developer>
   </developers>
+  <contributors>
+    <contributor>
+      <name>Marc le Bihan</name>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </contributor>
+  </contributors>
 
 
   <!-- ===========================================================

Modified: 
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -31,6 +31,7 @@ import org.apache.sis.util.resources.Err
  * all (or almost all) elements in the array will be assigned a value.
  *
  * @author  Martin Desruisseaux (Geomatys)
+ * @author  Marc le Bihan
  * @since   0.5
  * @version 0.5
  * @module
@@ -96,17 +97,21 @@ final class DenseFeature extends Abstrac
     @Override
     public Object getProperty(final String name) throws 
IllegalArgumentException {
         ArgumentChecks.ensureNonNull("name", name);
-        final int index = getIndex(name);
-        if (properties instanceof Property[]) {
-            final Property property = ((Property[]) properties)[index];
-            if (property != null) {
-                return property;
-            }
-        } else {
+        final int index = getIndex(name); // Invoked first because this method 
checks name validity.
+
+        // Are the properties currently initialized? If not, wrap the values 
we can find.
+        if (!(properties instanceof Property[])) {
             wrapValuesInProperties();
         }
-        final Property property = createProperty(name);
-        properties[index] = property;
+
+        // Find the wanted property.
+        Property property = ((Property[]) properties)[index];
+
+        // If the property still have a null value, we create it, but we can 
only tell its type.
+        if (property == null) {
+            property = createProperty(name);
+            properties[index] = property;
+        }
         return property;
     }
 

Propchange: 
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DenseFeature.java
            ('svn:mergeinfo' removed)

Modified: 
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -91,9 +91,7 @@ public final strictfp class DefaultAttri
      * @return An attribute type for the name of the parliament in a capital.
      */
     public static DefaultAttributeType<String> parliament() {
-        return new DefaultAttributeType<String>(
-                singletonMap(DefaultAttributeType.NAME_KEY, "parliament"),
-                String.class, 1, 1, null);
+        return attribute("parliament");
     }
 
     /**
@@ -109,6 +107,15 @@ public final strictfp class DefaultAttri
     }
 
     /**
+     * Creates a mandatory attribute type of type {@link String}.
+     * This is the kind of attribute created by the ShapeFile reader.
+     */
+    static DefaultAttributeType<String> attribute(final String name) {
+        return new 
DefaultAttributeType<String>(singletonMap(DefaultAttributeType.NAME_KEY, name),
+                String.class, 1, 1, null);
+    }
+
+    /**
      * Tests the creation of a simple {@link DefaultAttributeType} instance 
for a mandatory singleton.
      */
     @Test

Modified: 
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -36,6 +36,7 @@ import static org.apache.sis.test.Assert
  * Tests common to {@link DenseFeatureTest} and {@link SparseFeatureTest}.
  *
  * @author  Martin Desruisseaux (Geomatys)
+ * @author  Marc le Bihan
  * @since   0.5
  * @version 0.5
  * @module
@@ -129,11 +130,44 @@ public abstract strictfp class FeatureTe
     }
 
     /**
+     * Tests the {@link AbstractFeature#getProperty(String)} method. This test 
uses a very simple and
+     * straightforward {@code FeatureType} similar to the ones obtained when 
reading a ShapeFile.
+     *
+     * <div class="note">In a previous SIS version, the first property value 
was always {@code null}
+     * if the implementation was {@link DenseFeature} (see SIS-178). This test 
reproduced the bug,
+     * and now aim to avoid regression.</div>
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-178";>SIS-178</a>
+     */
+    @Test
+    public void testGetProperty() {
+        final DefaultFeatureType type = new DefaultFeatureType(
+                Collections.singletonMap(DefaultFeatureType.NAME_KEY, "My 
shapefile"), false, (DefaultFeatureType[]) null,
+                DefaultAttributeTypeTest.attribute("COMMUNE"),
+                DefaultAttributeTypeTest.attribute("REF_INSEE"),
+                DefaultAttributeTypeTest.attribute("CODE_POSTAL"));
+
+        feature = createFeature(type);
+        feature.setPropertyValue("COMMUNE",     "Bagneux");
+        feature.setPropertyValue("REF_INSEE",   "92007");
+        feature.setPropertyValue("CODE_POSTAL", "92220");
+
+        assertEquals("CODE_POSTAL", "92220",   ((AbstractAttribute) 
feature.getProperty("CODE_POSTAL")).getValue());
+        assertEquals("REF_INSEE",   "92007",   ((AbstractAttribute) 
feature.getProperty("REF_INSEE"))  .getValue());
+        assertEquals("COMMUNE",     "Bagneux", ((AbstractAttribute) 
feature.getProperty("COMMUNE"))    .getValue());
+
+        assertEquals("CODE_POSTAL", "92220",   
feature.getPropertyValue("CODE_POSTAL"));
+        assertEquals("REF_INSEE",   "92007",   
feature.getPropertyValue("REF_INSEE"));
+        assertEquals("COMMUNE",     "Bagneux", 
feature.getPropertyValue("COMMUNE"));
+    }
+
+    /**
      * Tests the {@link AbstractFeature#getPropertyValue(String)} method on a 
simple feature without super-types.
      * This method also tests that attempts to set a value of the wrong type 
throw an exception and leave the
      * previous value unchanged, that the feature is cloneable and that 
serialization works.
      */
     @Test
+    @DependsOnMethod("testGetProperty")
     public void testSimpleValues() {
         feature = createFeature(DefaultFeatureTypeTest.city());
         setAttributeValue("city", "Utopia", "Atlantide");

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -18,10 +18,8 @@ package org.apache.sis.internal.jaxb.met
 
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementRef;
-
 import org.opengis.metadata.Identifier;
 import org.opengis.referencing.ReferenceIdentifier;
-
 import org.apache.sis.metadata.iso.DefaultIdentifier;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.apache.sis.internal.jaxb.gco.PropertyType;
@@ -34,7 +32,7 @@ import org.apache.sis.internal.jaxb.gco.
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.5)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 public final class MD_Identifier extends PropertyType<MD_Identifier, 
Identifier> {
@@ -76,6 +74,14 @@ public final class MD_Identifier extends
     }
 
     /**
+     * Returns {@code true} if the identifier should be marshalled as a
+     * {@code RS_Identifier} instead than {@code MD_Identifier}.
+     */
+    private boolean isRS() {
+        return (metadata instanceof ReferenceIdentifier);
+    }
+
+    /**
      * Invoked by JAXB at marshalling time for getting the actual metadata to 
write
      * inside the {@code <gmd:MD_Identifier>} XML element.
      * This is the value or a copy of the value given in argument to the 
{@code wrap} method.
@@ -84,11 +90,7 @@ public final class MD_Identifier extends
      */
     @XmlElementRef
     public DefaultIdentifier getElement() {
-        final Identifier metadata = this.metadata;
-        if (metadata instanceof ReferenceIdentifier) {
-            return null;
-        }
-        return DefaultIdentifier.castOrCopy(metadata);
+        return isRS() ? null : DefaultIdentifier.castOrCopy(metadata);
     }
 
     /**
@@ -109,11 +111,7 @@ public final class MD_Identifier extends
      */
     @XmlElement(name = "RS_Identifier")
     public ImmutableIdentifier getReferenceIdentifier() {
-        final Identifier metadata = this.metadata;
-        if (metadata instanceof ReferenceIdentifier) {
-            return ImmutableIdentifier.castOrCopy((ReferenceIdentifier) 
metadata);
-        }
-        return null;
+        return isRS() ? ImmutableIdentifier.castOrCopy((ReferenceIdentifier) 
metadata) : null;
     }
 
     /**

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -26,6 +26,7 @@ import org.opengis.util.TypeName;
 import org.opengis.util.MemberName;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.referencing.ReferenceIdentifier;
@@ -341,7 +342,7 @@ public final class ServiceParameter exte
      * Null-safe string representation of the given identifier, for comparison 
purpose.
      * We ignore codespace because they can not be represented in ISO 19139 
XML documents.
      */
-    private static String toString(final ReferenceIdentifier identifier) {
+    private static String toString(final Identifier identifier) {
         return (identifier != null) ? identifier.toString() : null;
     }
 }

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -21,6 +21,7 @@ import org.opengis.util.NameSpace;
 import org.opengis.util.ScopedName;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.ReferenceIdentifier;
 import org.apache.sis.metadata.iso.citation.Citations;
@@ -33,7 +34,7 @@ import org.apache.sis.internal.jdk7.Obje
 
 
 /**
- * Does the unobvious mapping between {@link ReferenceIdentifier} properties 
and {@link GenericName} ones.
+ * Does the unobvious mapping between {@link Identifier} properties and {@link 
GenericName} ones.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
@@ -126,7 +127,7 @@ public final class NameToIdentifier impl
     }
 
     /**
-     * Names are not versioned.
+     * Returns {@code null} since names are not versioned.
      */
     @Override
     public String getVersion() {

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java 
[UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java 
[UTF-8] Mon Oct  6 01:00:52 2014
@@ -38,6 +38,7 @@ import javax.measure.unit.UnitFormat;
 import javax.measure.quantity.Quantity;
 
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.extent.VerticalExtent;
@@ -1389,7 +1390,7 @@ public class Formatter implements Locali
         ArgumentChecks.ensureNonNull("unformattable", unformattable);
         if (invalidElement == null) {
             String name;
-            final ReferenceIdentifier id = unformattable.getName();
+            final Identifier id = unformattable.getName();
             if (id == null || (name = id.getCode()) == null) {
                 name = getName(unformattable.getClass());
             }

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -27,6 +27,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.io.ObjectInputStream;
 import java.lang.reflect.Field;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.ExtendedElementInformation;
 import org.opengis.referencing.ReferenceIdentifier;
@@ -664,9 +665,9 @@ public class MetadataStandard implements
      * <ul>
      *   <li>{@link ReferenceIdentifier} with the following properties:
      *     <ul>
-     *       <li>The {@linkplain ReferenceIdentifier#getAuthority() authority} 
is this metadata standard {@linkplain #getCitation() citation}.</li>
+     *       <li>The {@linkplain Identifier#getAuthority() authority} is this 
metadata standard {@linkplain #getCitation() citation}.</li>
      *       <li>The {@linkplain ReferenceIdentifier#getCodeSpace() codespace} 
is the standard name of the interface that contain the property.</li>
-     *       <li>The {@linkplain ReferenceIdentifier#getCode() code} is the 
standard name of the property.</li>
+     *       <li>The {@linkplain Identifier#getCode() code} is the standard 
name of the property.</li>
      *     </ul>
      *   </li>
      *   <li>{@link CheckedContainer} with the following properties:

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -28,7 +28,7 @@ import org.opengis.metadata.ExtendedElem
 import org.opengis.metadata.citation.ResponsibleParty;
 import org.opengis.util.CodeList;
 import org.opengis.util.InternationalString;
-import org.apache.sis.internal.simple.SimpleReferenceIdentifier;
+import org.apache.sis.internal.simple.SimpleIdentifier;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.util.Numbers;
@@ -62,7 +62,7 @@ import org.apache.sis.util.logging.Loggi
  * @see MetadataStandard#asInformationMap(Class, KeyNamePolicy)
  * @see <a href="https://issues.apache.org/jira/browse/SIS-80";>SIS-80</a>
  */
-final class PropertyInformation<E> extends SimpleReferenceIdentifier
+final class PropertyInformation<E> extends SimpleIdentifier
         implements ExtendedElementInformation, CheckedContainer<E>
 {
     /**

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -21,6 +21,8 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
+import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.util.InternationalString;
 
 
 /**
@@ -40,8 +42,7 @@ import org.opengis.metadata.citation.Cit
  * {@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis 
coordinate system axis},
  * {@linkplain org.apache.sis.referencing.datum.DefaultGeodeticDatum geodetic 
datum},
  * {@linkplain org.apache.sis.referencing.crs.DefaultGeographicCRS geographic 
CRS} and more
- * rather use an {@code Identifier} sub-interface, namely {@link 
org.opengis.referencing.ReferenceIdentifier}.
- * The later is implemented in SIS by {@link ImmutableIdentifier}, which is a 
class unrelated to the usual
+ * rather use the {@link ImmutableIdentifier} implementation, which is a class 
unrelated to the usual
  * {@code org.apache.metadata} hierarchy because of the immutable nature of 
referencing objects.</p>
  *
  * {@section Text, URN and XML representations}
@@ -76,7 +77,7 @@ import org.opengis.metadata.citation.Cit
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  *
  * @see ImmutableIdentifier
@@ -98,6 +99,11 @@ public class DefaultIdentifier extends I
     private String code;
 
     /**
+     * Identifier or namespace in which the code is valid.
+     */
+    private String codeSpace;
+
+    /**
      * Identifier of the version of the associated code space or code, as 
specified
      * by the code space or code authority. This version is included only when 
the
      * {@linkplain #getCode code} uses versions. When appropriate, the edition 
is
@@ -106,6 +112,11 @@ public class DefaultIdentifier extends I
     private String version;
 
     /**
+     * Natural language description of the meaning of the code value.
+     */
+    private InternationalString description;
+
+    /**
      * Organization or party responsible for definition and maintenance of the
      * {@linkplain #getCode code}.
      */
@@ -152,8 +163,18 @@ public class DefaultIdentifier extends I
     public DefaultIdentifier(final Identifier object) {
         super(object);
         if (object != null) {
-            code      = object.getCode();
-            authority = object.getAuthority();
+            code        = object.getCode();
+            authority   = object.getAuthority();
+            if (object instanceof DefaultIdentifier) {
+                final DefaultIdentifier c = (DefaultIdentifier) object;
+                codeSpace   = c.getCodeSpace();
+                version     = c.getVersion();
+                description = c.getDescription();
+            } else if (object instanceof ReferenceIdentifier) {
+                final ReferenceIdentifier c = (ReferenceIdentifier) object;
+                codeSpace = c.getCodeSpace();
+                version   = c.getVersion();
+            }
         }
     }
 
@@ -183,9 +204,9 @@ public class DefaultIdentifier extends I
     }
 
     /**
-     * Alphanumeric value identifying an instance in the namespace.
+     * Returns the alphanumeric value identifying an instance in the namespace.
      *
-     * @return Value identifying an instance in the namespace, or {@code null}.
+     * @return Value identifying an instance in the namespace.
      */
     @Override
     @XmlElement(name = "code", required = true)
@@ -204,6 +225,29 @@ public class DefaultIdentifier extends I
     }
 
     /**
+     * Returns the identifier or namespace in which the code is valid.
+     *
+     * @return The identifier code space, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    public String getCodeSpace() {
+        return codeSpace;
+    }
+
+    /**
+     * Sets the identifier or namespace in which the code is valid.
+     *
+     * @param newValue The new code space, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    public void setCodeSpace(final String newValue) {
+        checkWritePermission();
+        codeSpace = newValue;
+    }
+
+    /**
      * Identifier of the version of the associated code, as specified by the 
code space or
      * code authority. This version is included only when the {@linkplain 
#getCode() code}
      * uses versions. When appropriate, the edition is identified by the 
effective date,
@@ -226,6 +270,29 @@ public class DefaultIdentifier extends I
     }
 
     /**
+     * Returns the natural language description of the meaning of the code 
value.
+     *
+     * @return The natural language description, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    public InternationalString getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the natural language description of the meaning of the code value.
+     *
+     * @param newValue The new natural language description, or {@code null} 
if none.
+     *
+     * @since 0.5
+     */
+    public void setDescription(final InternationalString newValue) {
+        checkWritePermission();
+        description = newValue;
+    }
+
+    /**
      * Organization or party responsible for definition and maintenance of the
      * {@linkplain #getCode() code}.
      *

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -123,7 +123,7 @@ import org.apache.sis.internal.jdk7.Obje
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.03)
- * @version 0.4
+ * @version 0.5
  * @module
  *
  * @see DefaultIdentifier
@@ -136,6 +136,12 @@ public class ImmutableIdentifier extends
     private static final long serialVersionUID = -7681717592582493409L;
 
     /**
+     * Key for the {@value} property in the map to be given to the constructor.
+     * This can be used for setting the value to be returned by {@link 
#getDescription()}.
+     */
+    public static final String DESCRIPTION_KEY = "description";
+
+    /**
      * Identifier code or name, optionally from a controlled list or pattern 
defined by a code space.
      *
      * @see #getCode()
@@ -174,6 +180,11 @@ public class ImmutableIdentifier extends
     private final String version;
 
     /**
+     * Natural language description of the meaning of the code value.
+     */
+    private final InternationalString description;
+
+    /**
      * Comments on or information about this identifier, or {@code null} if 
none.
      *
      * @see #getRemarks()
@@ -184,11 +195,12 @@ public class ImmutableIdentifier extends
      * Empty constructor for JAXB.
      */
     private ImmutableIdentifier() {
-        code      = null;
-        codeSpace = null;
-        authority = null;
-        version   = null;
-        remarks   = null;
+        code        = null;
+        codeSpace   = null;
+        authority   = null;
+        version     = null;
+        description = null;
+        remarks     = null;
     }
 
     /**
@@ -204,6 +216,11 @@ public class ImmutableIdentifier extends
         codeSpace = identifier.getCodeSpace();
         authority = identifier.getAuthority();
         version   = identifier.getVersion();
+        if (identifier instanceof DefaultIdentifier) {
+            description = ((DefaultIdentifier) identifier).getDescription();
+        } else {
+            description = null;
+        }
         if (identifier instanceof Deprecable) {
             remarks = ((Deprecable) identifier).getRemarks();
         } else {
@@ -251,11 +268,12 @@ public class ImmutableIdentifier extends
     public ImmutableIdentifier(final Citation authority, final String 
codeSpace,
             final String code, final String version, final InternationalString 
remarks)
     {
-        this.code      = code;
-        this.codeSpace = codeSpace;
-        this.authority = authority;
-        this.version   = version;
-        this.remarks   = remarks;
+        this.code        = code;
+        this.codeSpace   = codeSpace;
+        this.authority   = authority;
+        this.version     = version;
+        this.description = null;
+        this.remarks     = remarks;
         validate(null);
     }
 
@@ -293,6 +311,11 @@ public class ImmutableIdentifier extends
      *     <td>{@link #getVersion()}</td>
      *   </tr>
      *   <tr>
+     *     <td>"description"</td>
+     *     <td>{@link String} or {@link InternationalString}</td>
+     *     <td>{@link #getDescription()}</td>
+     *   </tr>
+     *   <tr>
      *     <td>{@value 
org.opengis.referencing.IdentifiedObject#REMARKS_KEY}</td>
      *     <td>{@link String} or {@link InternationalString}</td>
      *     <td>{@link #getRemarks()}</td>
@@ -320,9 +343,10 @@ public class ImmutableIdentifier extends
      */
     public ImmutableIdentifier(final Map<String,?> properties) throws 
IllegalArgumentException {
         ensureNonNull("properties", properties);
-        code    = trimWhitespaces(property(properties, CODE_KEY,    
String.class));
-        version = trimWhitespaces(property(properties, VERSION_KEY, 
String.class));
-        remarks = Types.toInternationalString(properties, REMARKS_KEY);
+        code        = trimWhitespaces(  property (properties, CODE_KEY,    
String.class));
+        version     = trimWhitespaces(  property (properties, VERSION_KEY, 
String.class));
+        description = Types.toInternationalString(properties, DESCRIPTION_KEY);
+        remarks     = Types.toInternationalString(properties, REMARKS_KEY);
         /*
          * Map String authority to one of the pre-defined constants (typically 
EPSG or OGC).
          */
@@ -381,8 +405,8 @@ public class ImmutableIdentifier extends
      *   <li>Otherwise if the given object is already an instance of
      *       {@code ImmutableIdentifier}, then it is returned unchanged.</li>
      *   <li>Otherwise a new {@code ImmutableIdentifier} instance is created 
using the
-     *       {@linkplain #ImmutableIdentifier(ReferenceIdentifier) copy 
constructor}
-     *       and returned. Note that this is a <cite>shallow</cite> copy 
operation, since the other
+     *       {@linkplain #ImmutableIdentifier(ReferenceIdentifier) copy 
constructor} and returned.
+     *       Note that this is a <cite>shallow</cite> copy operation, since 
the other
      *       metadata contained in the given object are not recursively 
copied.</li>
      * </ul>
      *
@@ -400,6 +424,8 @@ public class ImmutableIdentifier extends
     /**
      * Identifier code or name, optionally from a controlled list or pattern.
      *
+     * <div class="note"><b>Example:</b> {@code "4326"}.</div>
+     *
      * @return The code, never {@code null}.
      *
      * @see org.apache.sis.referencing.NamedIdentifier#tip()
@@ -412,6 +438,8 @@ public class ImmutableIdentifier extends
     /**
      * Name or identifier of the person or organization responsible for 
namespace.
      *
+     * <div class="note"><b>Example:</b> {@code "EPSG"}.</div>
+     *
      * @return The code space, or {@code null} if not available.
      *
      * @see org.apache.sis.referencing.NamedIdentifier#head()
@@ -473,6 +501,8 @@ public class ImmutableIdentifier extends
      * uses versions. When appropriate, the edition is identified by the 
effective date,
      * coded using ISO 8601 date format.
      *
+     * <div class="note"><b>Example:</b> the version of the underlying EPSG 
database.</div>
+     *
      * @return The version, or {@code null} if not available.
      */
     @Override
@@ -481,8 +511,23 @@ public class ImmutableIdentifier extends
     }
 
     /**
+     * Natural language description of the meaning of the code value.
+     *
+     * <div class="note"><b>Example:</b> "World Geodetic System 1984".</div>
+     *
+     * @return The natural language description, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    public InternationalString getDescription() {
+        return description;
+    }
+
+    /**
      * Comments on or information about this identifier, or {@code null} if 
none.
      *
+     * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
+     *
      * @return Optional comments about this identifier, or {@code null} if 
none.
      */
     @Override

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -345,11 +345,10 @@ public class DefaultSource extends ISOMe
 
     /**
      * Return the type and / or extent of the source.
+     * This information should be provided if the {@linkplain 
#getDescription() description} is not provided.
      *
      * @return Type and / or extent of the source, or {@code null} if none.
      *
-     * @condition Mandatory if the {@linkplain #getDescription() description} 
is not provided.
-     *
      * @since 0.5
      */
 /// @XmlElement(name = "scope")

Modified: 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -233,7 +233,7 @@ public class DefaultMaintenanceInformati
      *
      * @deprecated As of ISO 19115:2014, replaced by {@link 
#getMaintenanceDates()} in order to enable inclusion
      *             of a {@link DateType} to describe the type of the date. The 
associated date type is
-     *             {@link DateType.valueOf("NEXT_UPDATE")}.
+     *             {@code DateType.valueOf("NEXT_UPDATE")}.
      */
     @Override
     @Deprecated

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -18,6 +18,7 @@ package org.apache.sis.internal.jaxb.ref
 
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
 
 
 /**
@@ -36,7 +37,7 @@ import org.opengis.referencing.Reference
  *   <gml:identifier codeSpace="EPSG">4326</gml:identifier>
  * }
  *
- * If the {@code ReferenceIdentifier} to marshal contains a {@linkplain 
ReferenceIdentifier#getVersion() version},
+ * If the {@code Identifier} to marshal contains a {@linkplain 
ReferenceIdentifier#getVersion() version},
  * then this adapter concatenates the version to the codespace in a "URI-like" 
way like below:
  *
  * {@preformat xml
@@ -50,9 +51,9 @@ import org.opengis.referencing.Reference
  *   <gml:identifier 
codeSpace="OGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
  * }
  *
- * In such case this class takes the codespace as the {@linkplain 
ReferenceIdentifier#getAuthority() authority}
- * ("OGP" in above example), and the 3 last URI elements are parsed as the 
codespace, version (optional) and
- * code values respectively.
+ * In such case this class takes the codespace as the {@linkplain 
Identifier#getAuthority() authority}
+ * ("OGP" in above example), and the 3 last URI elements are parsed as the 
codespace, version (optional)
+ * and code values respectively.
  *
  * @author  Guilhem Legal (Geomatys)
  * @author  Cédric Briançon (Geomatys)

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -22,17 +22,17 @@ import org.opengis.util.InternationalStr
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.GeneralParameterDescriptor;
-import org.apache.sis.internal.jaxb.metadata.replace.ServiceParameter;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.ComparisonMode;
-import org.apache.sis.util.iso.Types;
 import org.apache.sis.util.Debug;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import org.opengis.referencing.ReferenceIdentifier;
+import org.apache.sis.metadata.iso.DefaultIdentifier;
+import org.apache.sis.metadata.iso.ImmutableIdentifier;
 
 
 /**
@@ -100,17 +100,6 @@ public abstract class AbstractParameterD
     private static final long serialVersionUID = -4346475760810353590L;
 
     /**
-     * Key for the {@value} property to be given to the constructor.
-     * This is used for setting the value to be returned by {@link 
#getDescription()}.
-     */
-    public static final String DESCRIPTION_KEY = "description";
-
-    /**
-     * A narrative explanation of the role of the parameter, or {@code null} 
if none.
-     */
-    private final InternationalString description;
-
-    /**
      * The minimum number of times that values for this parameter group are 
required, as an unsigned short.
      * We use a short because this value is usually either 0 or 1, or a very 
small number like 2 or 3.
      * A large number would be a bad idea with this parameter implementation.
@@ -154,11 +143,6 @@ public abstract class AbstractParameterD
      *     <td>{@link #getIdentifiers()}</td>
      *   </tr>
      *   <tr>
-     *     <td>{@value 
org.apache.sis.parameter.AbstractParameterDescriptor#DESCRIPTION_KEY}</td>
-     *     <td>{@link org.opengis.util.InternationalString} or {@link 
String}</td>
-     *     <td>{@link #getDescription()}</td>
-     *   </tr>
-     *   <tr>
      *     <td>{@value 
org.opengis.referencing.IdentifiedObject#REMARKS_KEY}</td>
      *     <td>{@link org.opengis.util.InternationalString} or {@link 
String}</td>
      *     <td>{@link #getRemarks()}</td>
@@ -175,7 +159,6 @@ public abstract class AbstractParameterD
             final int minimumOccurs, final int maximumOccurs)
     {
         super(properties);
-        this.description   = Types.toInternationalString(properties, 
DESCRIPTION_KEY);
         this.minimumOccurs = (short) minimumOccurs;
         this.maximumOccurs = (short) maximumOccurs;
         if (minimumOccurs < 0 || minimumOccurs > maximumOccurs || 
maximumOccurs == 0) {
@@ -201,13 +184,6 @@ public abstract class AbstractParameterD
         super(descriptor);
         minimumOccurs = crop(descriptor.getMinimumOccurs());
         maximumOccurs = crop(descriptor.getMaximumOccurs());
-        if (descriptor instanceof AbstractParameterDescriptor) {
-            description = ((AbstractParameterDescriptor) 
descriptor).getDescription();
-        } else if (descriptor instanceof ServiceParameter) {
-            description = ((ServiceParameter) descriptor).getDescription();
-        } else {
-            description = null;
-        }
     }
 
     /**
@@ -230,12 +206,21 @@ public abstract class AbstractParameterD
     }
 
     /**
-     * Returns a narrative explanation of the role of the parameter.
+     * Returns a narrative explanation of the role of the parameter. The 
default implementation returns
+     * the {@linkplain 
org.apache.sis.metadata.iso.ImmutableIdentifier#getDescription() description}
+     * provided by the parameter {@linkplain #getName() name}.
      *
      * @return A narrative explanation of the role of the parameter, or {@code 
null} if none.
      */
     public InternationalString getDescription() {
-        return description;
+        final ReferenceIdentifier name = getName();
+        if (name instanceof ImmutableIdentifier) {
+            return ((ImmutableIdentifier) name).getDescription();
+        }
+        if (name instanceof DefaultIdentifier) {
+            return ((DefaultIdentifier) name).getDescription();
+        }
+        return null;
     }
 
     /**
@@ -272,8 +257,7 @@ public abstract class AbstractParameterD
                 case STRICT: {
                     final AbstractParameterDescriptor that = 
(AbstractParameterDescriptor) object;
                     return minimumOccurs == that.minimumOccurs &&
-                           maximumOccurs == that.maximumOccurs &&
-                           Objects.equals(description, that.description);
+                           maximumOccurs == that.maximumOccurs;
                 }
                 default: {
                     final GeneralParameterDescriptor that = 
(GeneralParameterDescriptor) object;

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -101,22 +101,6 @@ public class ParameterBuilder extends Bu
     }
 
     /**
-     * Sets the parameter description as a {@code String} or {@code 
InternationalString} instance.
-     * Calls to this method overwrite any previous value.
-     *
-     * <p><b>Lifetime:</b>
-     * previous descriptions are discarded by calls to {@code 
setDescription(…)}.
-     * Descriptions are cleared after a {@code createXXX(…)} method has been 
invoked.</p>
-     *
-     * @param  description The description, or {@code null} if none.
-     * @return {@code this}, for method call chaining.
-     */
-    public ParameterBuilder setDescription(final CharSequence description) {
-        properties.put(AbstractParameterDescriptor.DESCRIPTION_KEY, 
description);
-        return this;
-    }
-
-    /**
      * Sets whether the parameter is mandatory or optional.
      * This property determines the {@linkplain 
DefaultParameterDescriptor#getMinimumOccurs() minimum number
      * of times} that values are required, which will be 0 for an optional 
parameter and 1 for a mandatory one.

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -37,6 +37,7 @@ import javax.measure.unit.Unit;
 import org.opengis.parameter.*;
 import org.opengis.util.ScopedName;
 import org.opengis.util.GenericName;
+import org.opengis.metadata.Identifier;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.ReferenceIdentifier;
 import org.opengis.referencing.operation.OperationMethod;
@@ -390,7 +391,7 @@ public class ParameterFormat extends Tab
         final boolean isSummary = contentLevel == ContentLevel.NAME_SUMMARY;
         final ParameterDescriptorGroup descriptor;
         final ParameterValueGroup      values;
-        final ReferenceIdentifier      name;
+        final Identifier               name;
         if (object instanceof ParameterValueGroup) {
             values     = (ParameterValueGroup) object;
             descriptor = values.getDescriptor();
@@ -748,7 +749,7 @@ public class ParameterFormat extends Tab
              */
             final Set<ReferenceIdentifier> identifiers = 
object.getIdentifiers();
             if (identifiers != null) { // Paranoiac check.
-                ReferenceIdentifier identifier = null;
+                Identifier identifier = null;
                 for (final ReferenceIdentifier candidate : identifiers) {
                     if (candidate != null) { // Paranoiac check.
                         if (isPreferredCodespace(candidate.getCodeSpace())) {

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -30,10 +30,11 @@ import java.io.IOException;
 import java.text.Format;
 import java.text.FieldPosition;
 import javax.measure.unit.Unit;
+import org.opengis.util.NameSpace;
 import org.opengis.util.GenericName;
+import org.opengis.metadata.Identifier;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.ReferenceIdentifier;
-import org.opengis.util.NameSpace;
 import org.apache.sis.io.wkt.Colors;
 import org.apache.sis.io.wkt.ElementKind;
 import org.apache.sis.measure.Range;
@@ -61,7 +62,7 @@ final class ParameterTableRow {
      * <p>Values can be of two kinds:</p>
      * <ul>
      *   <li>{@link String} for names or aliases.</li>
-     *   <li>{@link ReferenceIdentifier} for identifiers.</li>
+     *   <li>{@link Identifier} for identifiers.</li>
      * </ul>
      *
      * @see #addIdentifier(String, Object)
@@ -351,7 +352,7 @@ final class ParameterTableRow {
                 boolean hasIdentifiers = false;
                 while (it.hasNext()) {
                     final Object id = it.next();
-                    if (id instanceof ReferenceIdentifier) {
+                    if (id instanceof Identifier) {
                         out.append(hasIdentifiers ? ", " : " (");
                         writeColor(out, colors, ElementKind.IDENTIFIER);
                         out.append(toString(id));
@@ -376,8 +377,8 @@ final class ParameterTableRow {
      * Returns the string representation of the given parameter name.
      */
     private static String toString(Object parameter) {
-        if (parameter instanceof ReferenceIdentifier) {
-            parameter = ((ReferenceIdentifier) parameter).getCode();
+        if (parameter instanceof Identifier) {
+            parameter = ((Identifier) parameter).getCode();
         }
         return parameter.toString();
     }

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -30,7 +30,7 @@ import org.opengis.parameter.ParameterDe
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.opengis.parameter.InvalidParameterNameException;
 import org.opengis.parameter.InvalidParameterCardinalityException;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
@@ -196,7 +196,7 @@ final class ParameterValueList extends A
          * The intend is to allow users to set its own parameters by a call to 
group.values().addAll(myParam).
          * Otherwise the given parameter will be added, in which case we need 
to check the cardinality.
          */
-        final ReferenceIdentifier name = desc.getName();
+        final Identifier name = desc.getName();
         int count = 0;
         for (int i=0; i<size; i++) {
             final GeneralParameterValue value = values[i];
@@ -239,7 +239,7 @@ final class ParameterValueList extends A
              * For a more accurate error message, check if the operation 
failed because the
              * parameter name was not found, or the parameter descriptor does 
not matches.
              */
-            final ReferenceIdentifier name = desc.getName();
+            final Identifier name = desc.getName();
             for (final GeneralParameterDescriptor descriptor : descriptors) {
                 if (name.equals(descriptor.getName())) {
                     throw new IllegalArgumentException(Errors.format(
@@ -257,7 +257,7 @@ final class ParameterValueList extends A
      * then this method throws an {@link InvalidParameterCardinalityException}.
      */
     private void ensureCanAdd(final GeneralParameterDescriptor desc) {
-        final ReferenceIdentifier name = desc.getName();
+        final Identifier name = desc.getName();
         int count = 0;
         for (int i=0; i<size; i++) {
             if (name.equals(values[i].getDescriptor().getName())) {
@@ -279,7 +279,7 @@ final class ParameterValueList extends A
     private void ensureCanRemove(final GeneralParameterDescriptor desc) {
         final int min = desc.getMinimumOccurs();
         if (min != 0) { // Optimization for a common case.
-            final ReferenceIdentifier name = desc.getName();
+            final Identifier name = desc.getName();
             int count = 0;
             for (int i=0; i<size; i++) {
                 if (name.equals(values[i].getDescriptor().getName())) {

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -32,7 +32,7 @@ import org.opengis.parameter.GeneralPara
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.opengis.parameter.ParameterNotFoundException;
 import org.opengis.parameter.InvalidParameterNameException;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
 import org.opengis.referencing.operation.Matrix;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.operation.matrix.Matrices;
@@ -138,10 +138,10 @@ public class TensorParameters<E> impleme
         final Integer defaultSize = 3;
         final ParameterDescriptor<Integer> numRow, numCol;
         final Map<String,Object> properties = new HashMap<String,Object>(4);
-        properties.put(ReferenceIdentifier.AUTHORITY_KEY, Citations.OGC);
-        properties.put(ReferenceIdentifier.CODE_KEY, "num_row");
+        properties.put(Identifier.AUTHORITY_KEY, Citations.OGC);
+        properties.put(Identifier.CODE_KEY, "num_row");
         numRow = new DefaultParameterDescriptor<Integer>(properties, 1, 1, 
Integer.class, valueDomain, null, defaultSize);
-        properties.put(ReferenceIdentifier.CODE_KEY, "num_col");
+        properties.put(Identifier.CODE_KEY, "num_col");
         numCol = new DefaultParameterDescriptor<Integer>(properties, 1, 1, 
Integer.class, valueDomain, null, defaultSize);
         WKT1 = new TensorParameters<Double>(Double.class, "elt_", "_", numRow, 
numCol);
     }
@@ -376,8 +376,8 @@ public class TensorParameters<E> impleme
             }
         }
         final Map<String,Object> properties = new HashMap<String,Object>(4);
-        properties.put(ReferenceIdentifier.CODE_KEY, indicesToName(indices));
-        properties.put(ReferenceIdentifier.AUTHORITY_KEY, 
dimensions[0].getName().getAuthority());
+        properties.put(Identifier.CODE_KEY, indicesToName(indices));
+        properties.put(Identifier.AUTHORITY_KEY, 
dimensions[0].getName().getAuthority());
         return new DefaultParameterDescriptor<E>(properties, 0, 1, 
elementType, null, null, isDiagonal ? one : zero);
     }
 

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -33,6 +33,7 @@ import javax.xml.bind.annotation.adapter
 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.ObjectFactory;
 import org.opengis.referencing.AuthorityFactory;
@@ -116,7 +117,7 @@ import org.apache.sis.internal.jdk7.Obje
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4 (derived from geotk-1.2)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @XmlType(name="IdentifiedObjectType", propOrder={
@@ -251,6 +252,11 @@ public class AbstractIdentifiedObject ex
      *     <td>{@link NamedIdentifier#getVersion()} on the {@linkplain 
#getName() name}</td>
      *   </tr>
      *   <tr>
+     *     <td>"description"</td>
+     *     <td>{@link String}</td>
+     *     <td>{@link NamedIdentifier#getDescription()} on the {@linkplain 
#getName() name}</td>
+     *   </tr>
+     *   <tr>
      *     <td>{@value org.opengis.referencing.IdentifiedObject#ALIAS_KEY}</td>
      *     <td>{@link GenericName} or {@link CharSequence} (optionally as 
array)</td>
      *     <td>{@link #getAlias()}</td>
@@ -293,12 +299,12 @@ public class AbstractIdentifiedObject ex
     public AbstractIdentifiedObject(final Map<String,?> properties) throws 
IllegalArgumentException {
         ensureNonNull("properties", properties);
 
-        // -------------------------------------
-        // "name": String or ReferenceIdentifier
-        // -------------------------------------
+        // ----------------------------
+        // "name": String or Identifier
+        // ----------------------------
         Object value = properties.get(NAME_KEY);
         if (value == null || value instanceof String) {
-            if (value == null && properties.get(ReferenceIdentifier.CODE_KEY) 
== null) {
+            if (value == null && properties.get(Identifier.CODE_KEY) == null) {
                 throw new 
IllegalArgumentException(Errors.getResources(properties)
                         .getString(Errors.Keys.MissingValueForProperty_1, 
NAME_KEY));
             }
@@ -326,9 +332,9 @@ public class AbstractIdentifiedObject ex
         }
         alias = immutableSet(true, names);
 
-        // -----------------------------------------------------------
-        // "identifiers": ReferenceIdentifier or ReferenceIdentifier[]
-        // -----------------------------------------------------------
+        // -----------------------------------------
+        // "identifiers": Identifier or Identifier[]
+        // -----------------------------------------
         value = properties.get(IDENTIFIERS_KEY);
         if (value == null) {
             identifiers = null;
@@ -482,7 +488,7 @@ public class AbstractIdentifiedObject ex
     }
 
     /**
-     * Returns a single element from the {@code Set<ReferenceIdentifier>} 
collection, or {@code null} if none.
+     * Returns a single element from the {@code Set<Identifier>} collection, 
or {@code null} if none.
      * We have to define this method because ISO 19111 defines the {@code 
identifiers} property as a collection
      * while GML 3.2 defines it as a singleton.
      *
@@ -596,7 +602,7 @@ public class AbstractIdentifiedObject ex
     }
 
     /**
-     * Returns the {@link #name} and all aliases which are also instance of 
{@lik ReferenceIdentifier}.
+     * Returns the {@link #name} and all aliases which are also instance of 
{@link ReferenceIdentifier}.
      * The later happen often in SIS implementation since many aliases are 
instance of {@link NamedIdentifier}.
      *
      * <p>The returned collection is <cite>live</cite>: adding elements in 
that collection will modify this
@@ -690,7 +696,7 @@ public class AbstractIdentifiedObject ex
             }
         }
         boolean isDeprecated = false;
-        for (final ReferenceIdentifier identifier : nonNull(identifiers)) {
+        for (final Identifier identifier : nonNull(identifiers)) {
             if (identifier instanceof Deprecable) {
                 if (!((Deprecable) identifier).isDeprecated()) {
                     return false;

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -25,6 +25,7 @@ import java.lang.reflect.ParameterizedTy
 import org.opengis.util.NameSpace;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.ReferenceIdentifier;
@@ -146,7 +147,7 @@ import org.apache.sis.internal.jdk7.Obje
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public abstract class Builder<B extends Builder<B>> {
@@ -226,8 +227,8 @@ public abstract class Builder<B extends 
 
     /**
      * Sets the property value for the given key, if a change is still 
possible. The check for change permission
-     * is needed for all keys defined in the {@link ReferenceIdentifier} 
interface. This check is not needed for
-     * other keys, so callers do not need to invoke this method for other keys.
+     * is needed for all keys defined in the {@link Identifier} interface. 
This check is not needed for other keys,
+     * so callers do not need to invoke this method for other keys.
      *
      * @param  key The key of the property to set.
      * @param  value The value to set.
@@ -259,7 +260,7 @@ public abstract class Builder<B extends 
     }
 
     /**
-     * Sets the {@code ReferenceIdentifier} authority and code space. This 
method is typically invoked only once,
+     * Sets the {@code Identifier} authority and code space. This method is 
typically invoked only once,
      * since a compound object often uses the same code space for all 
individual components.
      *
      * <p><b>Condition:</b>
@@ -280,12 +281,12 @@ public abstract class Builder<B extends 
         if (!setProperty(ReferenceIdentifier.CODESPACE_KEY, codespace)) {
             namespace = null;
         }
-        setProperty(ReferenceIdentifier.AUTHORITY_KEY, authority);
+        setProperty(Identifier.AUTHORITY_KEY, authority);
         return self();
     }
 
     /**
-     * Sets the {@code ReferenceIdentifier} version of object definitions. 
This method is typically invoked only once,
+     * Sets the {@code Identifier} version of object definitions. This method 
is typically invoked only once,
      * since a compound object often uses the same version for all individual 
components.
      *
      * <p><b>Condition:</b>
@@ -309,8 +310,8 @@ public abstract class Builder<B extends 
     /**
      * Adds an {@code IdentifiedObject} name given by a {@code String} or 
{@code InternationalString}.
      * The given string will be combined with the authority, {@link 
#setCodeSpace(Citation, String) code space}
-     * and {@link #setVersion(String) version} information for creating the 
{@link ReferenceIdentifier} or
-     * {@link GenericName} object.
+     * and {@link #setVersion(String) version} information for creating the 
{@link Identifier} or {@link GenericName}
+     * object.
      *
      * {@section Name and aliases}
      * This method can be invoked many times. The first invocation sets the
@@ -434,7 +435,7 @@ public abstract class Builder<B extends 
     /**
      * Adds an {@code IdentifiedObject} identifier given by a {@code String}.
      * The given string will be combined with the authority, {@link 
#setCodeSpace(Citation, String) code space}
-     * and {@link #setVersion(String) version} information for creating the 
{@link ReferenceIdentifier} object.
+     * and {@link #setVersion(String) version} information for creating the 
{@link Identifier} object.
      *
      * <p><b>Lifetime:</b>
      * all identifiers are cleared after a {@code createXXX(…)} method has 
been invoked.</p>
@@ -444,7 +445,7 @@ public abstract class Builder<B extends 
      */
     public B addIdentifier(final String identifier) {
         ensureNonNull("identifier", identifier);
-        identifiers.add(new ImmutableIdentifier((Citation) 
properties.get(ReferenceIdentifier.AUTHORITY_KEY),
+        identifiers.add(new ImmutableIdentifier((Citation) 
properties.get(Identifier.AUTHORITY_KEY),
                 (String) properties.get(ReferenceIdentifier.CODESPACE_KEY), 
identifier));
         return self();
     }
@@ -487,6 +488,22 @@ public abstract class Builder<B extends 
     }
 
     /**
+     * Sets the parameter description as a {@code String} or {@code 
InternationalString} instance.
+     * Calls to this method overwrite any previous value.
+     *
+     * <p><b>Lifetime:</b>
+     * previous descriptions are discarded by calls to {@code 
setDescription(…)}.
+     * Descriptions are cleared after a {@code createXXX(…)} method has been 
invoked.</p>
+     *
+     * @param  description The description, or {@code null} if none.
+     * @return {@code this}, for method call chaining.
+     */
+    public B setDescription(final CharSequence description) {
+        properties.put("description", description);
+        return self();
+    }
+
+    /**
      * Sets remarks as a {@code String} or {@code InternationalString} 
instance.
      * Calls to this method overwrite any previous value.
      *

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -47,7 +47,7 @@ import static org.apache.sis.internal.ut
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Guilhem Legal (Geomatys)
  * @since   0.4 (derived from geotk-1.2)
- * @version 0.4
+ * @version 0.5
  * @module
  *
  * @see CRS
@@ -119,12 +119,12 @@ public final class IdentifiedObjects ext
      * then all {@linkplain AbstractIdentifiedObject#getAlias() aliases} in 
their iteration order.
      *
      * <ul>
-     *   <li><p>If the name or alias implements the {@link 
ReferenceIdentifier} interface,
-     *       then this method compares the {@linkplain 
ReferenceIdentifier#getAuthority()
+     *   <li><p>If the name or alias implements the {@link Identifier} 
interface,
+     *       then this method compares the {@linkplain 
Identifier#getAuthority()
      *       identifier authority} against the specified citation using the
      *       {@link Citations#identifierMatches(Citation, Citation)} method.
      *       If a matching is found, then this method returns the
-     *       {@linkplain ReferenceIdentifier#getCode() identifier code} of 
that object.</p></li>
+     *       {@linkplain Identifier#getCode() identifier code} of that 
object.</p></li>
      *
      *   <li><p>Otherwise, if the alias implements the {@link GenericName} 
interface, then this method
      *       compares the {@linkplain GenericName#scope() name scope} against 
the specified citation
@@ -133,13 +133,13 @@ public final class IdentifiedObjects ext
      *       {@linkplain GenericName#tip() name tip} of that object.</p></li>
      * </ul>
      *
-     * Note that alias may implement both the {@link ReferenceIdentifier} and 
{@link GenericName}
+     * Note that alias may implement both the {@link Identifier} and {@link 
GenericName}
      * interfaces (for example {@link NamedIdentifier}). In such cases, the 
identifier view has
      * precedence.
      *
      * @param  object The object to get the name from, or {@code null}.
      * @param  authority The authority for the name to return, or {@code null} 
for any authority.
-     * @return The object's name (either an {@linkplain 
ReferenceIdentifier#getCode() identifier code}
+     * @return The object's name (either an {@linkplain Identifier#getCode() 
identifier code}
      *         or a {@linkplain GenericName#tip() name tip}), or {@code null} 
if no name matching the
      *         specified authority has been found.
      *
@@ -157,7 +157,7 @@ public final class IdentifiedObjects ext
      * @param  object    The object to get the name from, or {@code null}.
      * @param  authority The authority for the name to return, or {@code null} 
for any authority.
      * @param  addTo     If non-null, the collection where to add all names 
found.
-     * @return The object's name (either an {@linkplain 
ReferenceIdentifier#getCode() identifier code}
+     * @return The object's name (either an {@linkplain Identifier#getCode() 
identifier code}
      *         or a {@linkplain GenericName#tip() name tip}), or {@code null} 
if no name matching the
      *         specified authority has been found.
      */
@@ -253,11 +253,11 @@ public final class IdentifiedObjects ext
      *
      * @see AbstractIdentifiedObject#getIdentifier()
      */
-    public static ReferenceIdentifier getIdentifier(final IdentifiedObject 
object, final Citation authority) {
+    public static Identifier getIdentifier(final IdentifiedObject object, 
final Citation authority) {
         if (object != null) {
-            final Iterator<ReferenceIdentifier> it = 
iterator(object.getIdentifiers());
+            final Iterator<? extends Identifier> it = 
iterator(object.getIdentifiers());
             if (it != null) while (it.hasNext()) {
-                final ReferenceIdentifier identifier = it.next();
+                final Identifier identifier = it.next();
                 if (identifier != null) { // Paranoiac check.
                     if (authority == null || identifierMatches(authority, 
identifier.getAuthority())) {
                         return identifier;
@@ -291,7 +291,7 @@ public final class IdentifiedObjects ext
      */
     public static String getIdentifierOrName(final IdentifiedObject object) {
         if (object != null) {
-            final Iterator<ReferenceIdentifier> it = 
iterator(object.getIdentifiers());
+            final Iterator<? extends Identifier> it = 
iterator(object.getIdentifiers());
             if (it != null) while (it.hasNext()) {
                 final String code = toString(it.next());
                 if (code != null) { // Paranoiac check.
@@ -322,7 +322,7 @@ public final class IdentifiedObjects ext
      */
     public static String getUnicodeIdentifier(final IdentifiedObject object) {
         if (object != null) {
-            ReferenceIdentifier identifier = object.getName();
+            Identifier identifier = object.getName();
             if (identifier != null) { // Paranoiac check.
                 final String code = identifier.getCode();
                 if (CharSequences.isUnicodeIdentifier(code)) {
@@ -339,7 +339,7 @@ public final class IdentifiedObjects ext
                     }
                 }
             }
-            final Iterator<ReferenceIdentifier> id = 
iterator(object.getIdentifiers());
+            final Iterator<? extends Identifier> id = 
iterator(object.getIdentifiers());
             if (id != null) while (id.hasNext()) {
                 identifier = id.next();
                 if (identifier != null) { // Paranoiac check.
@@ -413,7 +413,7 @@ public final class IdentifiedObjects ext
             CharSequence name)
     {
         name = CharSequences.toASCII(name);
-        final ReferenceIdentifier id = object.getName();
+        final Identifier id = object.getName();
         if (id != null) { // Paranoiac check.
             final CharSequence code = CharSequences.toASCII(id.getCode());
             if (code != null) { // Paranoiac check.
@@ -456,7 +456,7 @@ public final class IdentifiedObjects ext
      * </ul>
      *
      * This method is provided because the {@link GenericName#toString()} 
behavior is specified by its javadoc,
-     * while {@link ReferenceIdentifier} has no such contract. For example 
like most ISO 19115 objects in SIS,
+     * while {@link Identifier} has no such contract. For example like most 
ISO 19115 objects in SIS,
      * the {@link org.apache.sis.metadata.iso.DefaultIdentifier} 
implementation is formatted as a tree.
      * This static method can be used when a "name-like" representation is 
needed for any implementation.
      *
@@ -475,10 +475,11 @@ public final class IdentifiedObjects ext
             return identifier.toString();
         }
         final String code = identifier.getCode();
-        final String cs;
+        String cs = null;
         if (identifier instanceof ReferenceIdentifier) {
             cs = ((ReferenceIdentifier) identifier).getCodeSpace();
-        } else {
+        }
+        if (cs == null) {
             cs = 
org.apache.sis.internal.util.Citations.getIdentifier(identifier.getAuthority());
         }
         if (cs != null && !cs.isEmpty()) {

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -43,7 +43,7 @@ import org.apache.sis.internal.jdk7.Obje
 
 
 /**
- * An identification of a CRS object which is both a {@link 
ReferenceIdentifier} and a {@link GenericName}.
+ * An identification of a CRS object which is both a {@link Identifier} and a 
{@link GenericName}.
  * This class implements both interfaces in order to allow usage of the same 
instance either as an object
  * {@linkplain AbstractIdentifiedObject#getName() name} or {@linkplain 
AbstractIdentifiedObject#getAlias() alias}.
  * This flexibility make easier to uses object's names in two different models:
@@ -57,10 +57,10 @@ import org.apache.sis.internal.jdk7.Obje
  *
  * By using this {@code NamedIdentifier} class, users can declare supplemental 
object's names as
  * {@linkplain AbstractIdentifiedObject#getAlias() aliases} and have those 
names used in contexts
- * where {@code ReferenceIdentifier} instances are required, like GML 
marshalling time.
+ * where {@code Identifier} instances are required, like GML marshalling time.
  *
  * {@section Name ↔ Identifier mapping}
- * The {@code GenericName} attributes will be inferred from {@code 
ReferenceIdentifier} attributes as below:
+ * The {@code GenericName} attributes will be inferred from {@code Identifier} 
attributes as below:
  *
  * <ul>
  *   <li><b>{@linkplain #tip() Tip}:</b> derived from the identifier 
{@linkplain #getCode() code}.</li>

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -20,14 +20,14 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.Arrays;
 import javax.xml.bind.annotation.XmlTransient;
-import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.opengis.referencing.ReferenceIdentifier;
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.referencing.crs.GeographicCRS;
 import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
+import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.AbstractReferenceSystem;
 import org.apache.sis.io.wkt.Formatter;

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -26,9 +26,9 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
-import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.util.GenericName;
+import org.opengis.metadata.Identifier;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -169,7 +169,7 @@ public class AbstractCS extends Abstract
         for (int i=0; i<axes.length; i++) {
             final CoordinateSystemAxis axis = axes[i];
             ensureNonNullElement("axes", i, axis);
-            final ReferenceIdentifier name = axis.getName();
+            final Identifier name = axis.getName();
             ensureNonNullElement("axes[#].name", i, name);
             final AxisDirection direction = axis.getDirection();
             ensureNonNullElement("axes[#].direction", i, direction);

Modified: 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -29,7 +29,7 @@ import javax.xml.bind.annotation.XmlAttr
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
 import org.opengis.referencing.crs.GeodeticCRS;
 import org.opengis.referencing.cs.RangeMeaning;
 import org.opengis.referencing.cs.AxisDirection;
@@ -458,7 +458,7 @@ public class DefaultCoordinateSystemAxis
      */
     private void setMinimum(final Double value) {
         if (value != null && canSetProperty("minimumValue", minimumValue != 
NEGATIVE_INFINITY)) {
-            final double min = value.doubleValue();
+            final double min = value; // Apply unboxing.
             if (min < maximumValue) {
                 minimumValue = min;
             } else {
@@ -492,7 +492,7 @@ public class DefaultCoordinateSystemAxis
      */
     private void setMaximum(final Double value) {
         if (value != null && canSetProperty("maximumValue", maximumValue != 
POSITIVE_INFINITY)) {
-            final double max = value.doubleValue();
+            final double max = value; // Apply unboxing.
             if (max > minimumValue) {
                 maximumValue = max;
             } else {
@@ -664,7 +664,7 @@ public class DefaultCoordinateSystemAxis
         {
             return false;
         }
-        ReferenceIdentifier name = that.getName();
+        Identifier name = that.getName();
         if (name != UNNAMED) {
             /*
              * Checking the abbreviation is not sufficient. For example the 
polar angle and the

Modified: 
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
URL: 
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java?rev=1629558&r1=1629557&r2=1629558&view=diff
==============================================================================
--- 
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
 [UTF-8] (original)
+++ 
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
 [UTF-8] Mon Oct  6 01:00:52 2014
@@ -20,6 +20,7 @@ import org.opengis.util.NameSpace;
 import org.opengis.util.LocalName;
 import org.opengis.util.GenericName;
 import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.Identifier;
 import org.opengis.referencing.ReferenceIdentifier;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.apache.sis.test.DependsOnMethod;
@@ -75,23 +76,23 @@ public final strictfp class BuilderTest 
             fail("Setting a different codespace shall not be allowed.");
         } catch (IllegalStateException e) {
             final String message = e.getMessage();
-            assertTrue(message, 
message.contains(ReferenceIdentifier.AUTHORITY_KEY));
+            assertTrue(message, message.contains(Identifier.AUTHORITY_KEY));
         }
         /*
          * The failed attempt to set a new codespace shall not have modified 
builder state.
          */
         assertEquals("EPSG", 
builder.properties.get(ReferenceIdentifier.CODESPACE_KEY));
-        assertSame  ( OGP,   
builder.properties.get(ReferenceIdentifier.AUTHORITY_KEY));
+        assertSame  ( OGP,   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(ReferenceIdentifier.CODESPACE_KEY));
-        assertSame  ( OGP,   
builder.properties.get(ReferenceIdentifier.AUTHORITY_KEY));
+        assertSame  ( OGP,   builder.properties.get(Identifier.AUTHORITY_KEY));
         builder.setCodeSpace(EPSG, "EPSG");
         assertEquals("EPSG", 
builder.properties.get(ReferenceIdentifier.CODESPACE_KEY));
-        assertSame  ( EPSG,  
builder.properties.get(ReferenceIdentifier.AUTHORITY_KEY));
+        assertSame  ( EPSG,  builder.properties.get(Identifier.AUTHORITY_KEY));
     }
 
     /**
@@ -104,10 +105,9 @@ public final strictfp class BuilderTest 
         final LocalName alias1 = SIS_NAMES.createLocalName(null, "Mercator 
(1SP)");
         final LocalName alias2 = SIS_NAMES.createLocalName(null, 
"Mercator_1SP");
         final LocalName alias3 = SIS_NAMES.createLocalName(null, 
"CT_Mercator");
-        assertEquals("Mercator (variant A)", name  .toString());
-        assertEquals("Mercator (1SP)",       alias1.toString());
-        assertEquals("Mercator_1SP",         alias2.toString());
-        assertEquals("CT_Mercator",          alias3.toString());
+        assertEquals("Mercator (1SP)", alias1.toString());
+        assertEquals("Mercator_1SP",   alias2.toString());
+        assertEquals("CT_Mercator",    alias3.toString());
 
         // The test.
         final BuilderMock builder = new BuilderMock();
@@ -132,7 +132,7 @@ public final strictfp class BuilderTest 
         final GenericName alias1 = SIS_NAMES.createLocalName(scope("EPSG"), 
"Mercator (1SP)");
         final GenericName alias2 = new NamedIdentifier(OGC,     
"Mercator_1SP");
         final GenericName alias3 = new NamedIdentifier(GEOTIFF, "CT_Mercator");
-        assertEquals("Mercator (variant A)", name  .toString());
+        assertEquals("Mercator (variant A)", name);
         assertEquals("Mercator (1SP)",       alias1.toString());
         assertEquals("OGC:Mercator_1SP",     alias2.toString());
         assertEquals("GeoTIFF:CT_Mercator",  alias3.toString());
@@ -165,8 +165,8 @@ public final strictfp class BuilderTest 
     @Test
     public void testIdentifiers() {
         // Expected values to be used later in the test.
-        final ReferenceIdentifier id1 = new ImmutableIdentifier(OGP,     
"EPSG",    "9804");
-        final ReferenceIdentifier id2 = new ImmutableIdentifier(GEOTIFF, 
"GeoTIFF", "7");
+        final Identifier id1 = new ImmutableIdentifier(OGP,     "EPSG",    
"9804");
+        final Identifier id2 = new ImmutableIdentifier(GEOTIFF, "GeoTIFF", 
"7");
         assertEquals("EPSG:9804", IdentifiedObjects.toString(id1));
         assertEquals("GeoTIFF:7", IdentifiedObjects.toString(id2));
 
@@ -176,7 +176,6 @@ public final strictfp class BuilderTest 
         assertSame(builder, builder.addIdentifier(      "9804"));
         assertSame(builder, builder.addIdentifier(GEOTIFF, "7"));
         builder.onCreate(false);
-        assertArrayEquals(new ReferenceIdentifier[] {id1, id2},
-                (ReferenceIdentifier[]) 
builder.properties.get(IDENTIFIERS_KEY));
+        assertArrayEquals(new Identifier[] {id1, id2}, (Identifier[]) 
builder.properties.get(IDENTIFIERS_KEY));
     }
 }


Reply via email to