sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1768737 - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/ core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/ core/sis-referencing/src/main/java/org/apache/sis/...
Date Tue, 08 Nov 2016 16:57:23 GMT
Author: desruisseaux
Date: Tue Nov  8 16:57:22 2016
New Revision: 1768737

URL: http://svn.apache.org/viewvc?rev=1768737&view=rev
Log:
Merge SIS-333 fix from JDK8 branch.

Added:
    sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Sphere.xml
      - copied unchanged from r1768733, sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/referencing/datum/Sphere.xml
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java
      - copied, changed from r1768733, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:57:22 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1768094
+/sis/branches/JDK8:1584960-1768733
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -91,8 +91,8 @@ public class DefaultKeywords extends ISO
     /**
      * Creates keywords initialized to the given key word.
      *
-     * @param keywords Commonly used words or formalised words or phrases used to describe
-     *                 the subject, or {@code null} if none.
+     * @param keywords  commonly used words or formalised words or phrases used to describe the subject,
+     *                  or {@code null} if none.
      */
     public DefaultKeywords(final CharSequence... keywords) {
         if (keywords != null) {
@@ -112,7 +112,7 @@ public class DefaultKeywords extends ISO
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from, or {@code null} if none.
+     * @param object  the metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Keywords)
      */
@@ -139,8 +139,8 @@ public class DefaultKeywords extends ISO
      *       metadata contained in the given object are not recursively copied.</li>
      * </ul>
      *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
+     * @param  object  the object to get as a SIS implementation, or {@code null} if none.
+     * @return a SIS implementation containing the values of the given object (may be the
      *         given object itself), or {@code null} if the argument was null.
      */
     public static DefaultKeywords castOrCopy(final Keywords object) {
@@ -153,7 +153,7 @@ public class DefaultKeywords extends ISO
     /**
      * Returns commonly used word(s) or formalised word(s) or phrase(s) used to describe the subject.
      *
-     * @return Word(s) or phrase(s) used to describe the subject.
+     * @return word(s) or phrase(s) used to describe the subject.
      */
     @Override
     @XmlElement(name = "keyword", required = true)
@@ -164,7 +164,7 @@ public class DefaultKeywords extends ISO
     /**
      * Sets commonly used word(s) or formalised word(s) or phrase(s) used to describe the subject.
      *
-     * @param newValues The new keywords.
+     * @param newValues  the new keywords.
      */
     public void setKeywords(final Collection<? extends InternationalString> newValues) {
         keywords = writeCollection(newValues, keywords, InternationalString.class);
@@ -173,7 +173,7 @@ public class DefaultKeywords extends ISO
     /**
      * Returns the subject matter used to group similar keywords.
      *
-     * @return Subject matter used to group similar keywords, or {@code null}.
+     * @return subject matter used to group similar keywords, or {@code null}.
      */
     @Override
     @XmlElement(name = "type")
@@ -184,7 +184,7 @@ public class DefaultKeywords extends ISO
     /**
      * Sets the subject matter used to group similar keywords.
      *
-     * @param newValue The new keyword type.
+     * @param newValue  the new keyword type.
      */
     public void setType(final KeywordType newValue) {
         checkWritePermission();
@@ -194,7 +194,7 @@ public class DefaultKeywords extends ISO
     /**
      * Returns the name of the formally registered thesaurus or a similar authoritative source of keywords.
      *
-     * @return Name of registered thesaurus or similar authoritative source of keywords, or {@code null}.
+     * @return name of registered thesaurus or similar authoritative source of keywords, or {@code null}.
      */
     @Override
     @XmlElement(name = "thesaurusName")
@@ -205,7 +205,7 @@ public class DefaultKeywords extends ISO
     /**
      * Sets the name of the formally registered thesaurus or a similar authoritative source of keywords.
      *
-     * @param newValue The new thesaurus name.
+     * @param newValue  the new thesaurus name.
      */
     public void setThesaurusName(final Citation newValue) {
         checkWritePermission();
@@ -216,7 +216,7 @@ public class DefaultKeywords extends ISO
      * Returns the user-defined categorization of groups of keywords that extend or
      * are orthogonal to the standardized {@linkplain #getType() keyword type} codes.
      *
-     * @return User-defined categorization of groups of keywords, or {@code null} if none.
+     * @return user-defined categorization of groups of keywords, or {@code null} if none.
      *
      * @since 0.5
      */
@@ -228,7 +228,7 @@ public class DefaultKeywords extends ISO
     /**
      * Sets the user-defined categorization of groups of keywords.
      *
-     * @param newValue New user-defined categorization of groups of keywords.
+     * @param newValue  new user-defined categorization of groups of keywords.
      *
      * @since 0.5
      */

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -18,7 +18,6 @@ package org.apache.sis.internal.jaxb.ref
 
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.measure.Unit;
 import org.opengis.referencing.datum.Ellipsoid;
 import org.apache.sis.measure.Units;
 import org.apache.sis.xml.Namespaces;
@@ -42,15 +41,43 @@ import org.apache.sis.util.resources.Err
 public final class SecondDefiningParameter {
     /**
      * Nested parameter, for JAXB purpose.
+     * This is used for marshalling XML like below:
+     *
+     * {@preformat xml
+     *   <gml:secondDefiningParameter>
+     *     <gml:SecondDefiningParameter>
+     *       <gml:semiMinorAxis uom="urn:ogc:def:uom:EPSG::9001">6371007</gml:semiMinorAxis>
+     *     </gml:SecondDefiningParameter>
+     *   </gml:secondDefiningParameter>
+     * }
      */
     @XmlElement(name = "SecondDefiningParameter")
     public SecondDefiningParameter secondDefiningParameter;
 
     /**
+     * Whether the ellipsoid is a sphere, or {@code null} if unspecified.
+     * If this value is {@code true}, then the XML shall be marshalled like below:
+     *
+     * {@preformat xml
+     *   <gml:secondDefiningParameter>
+     *     <gml:SecondDefiningParameter>
+     *       <gml:isSphere>true</gml:isSphere>
+     *     </gml:SecondDefiningParameter>
+     *   </gml:secondDefiningParameter>
+     * }
+     *
+     * @since 0.8
+     */
+    @XmlElement
+    public Boolean isSphere;
+
+    /**
      * The measure, which is either the polar radius or the inverse of the flattening value.
      * We distinguish those two cases by the unit: if the measure is the inverse flattening,
      * then the unit must be {@link Units#UNITY}.
      *
+     * <p>This value should be {@code null} if {@link #isSphere} is {@code true}.</p>
+     *
      * @see Ellipsoid#getSemiMinorAxis()
      * @see Ellipsoid#getInverseFlattening()
      */
@@ -65,14 +92,16 @@ public final class SecondDefiningParamet
     /**
      * Stores the semi-minor axis or the inverse of the flattening value.
      *
-     * @param ellipsoid The ellipsoid from which to get the semi-minor or inverse flattening value.
-     * @param nested {@code true} if the element should be nested in an other XML type.
+     * @param  ellipsoid  the ellipsoid from which to get the semi-minor or inverse flattening value.
+     * @param  nested     {@code true} if the element should be nested in an other XML type.
      */
     public SecondDefiningParameter(final Ellipsoid ellipsoid, final boolean nested) {
         if (nested) {
             secondDefiningParameter = new SecondDefiningParameter(ellipsoid, false);
         } else {
-            if (ellipsoid.isIvfDefinitive()) {
+            if (ellipsoid.isSphere()) {
+                isSphere = Boolean.TRUE;
+            } else if (ellipsoid.isIvfDefinitive()) {
                 measure = new Measure(ellipsoid.getInverseFlattening(), Units.UNITY);
             } else {
                 measure = new Measure(ellipsoid.getSemiMinorAxis(), ellipsoid.getAxisUnit());
@@ -92,7 +121,7 @@ public final class SecondDefiningParamet
     /**
      * Returns the semi-minor axis value as a measurement.
      *
-     * @return The measure of the semi-minor axis.
+     * @return the measure of the semi-minor axis.
      */
     @XmlElement(name = "semiMinorAxis")
     public Measure getSemiMinorAxis() {
@@ -104,7 +133,7 @@ public final class SecondDefiningParamet
      * The unit of measurement (if any) shall be linear, but we do not verify that now.
      * This will be verified by {@code DefaultEllipsoid.setSecondDefiningParameter(…)}.
      *
-     * @param measure The semi-minor axis value.
+     * @param  measure  the semi-minor axis value.
      */
     public void setSemiMinorAxis(final Measure measure) {
         this.measure = measure;
@@ -114,7 +143,7 @@ public final class SecondDefiningParamet
      * Returns the inverse of the flattening value as a measurement.
      * Note: The unit of this measurement is dimensionless.
      *
-     * @return The inverse of the flattening value as a measurement.
+     * @return the inverse of the flattening value as a measurement.
      */
     @XmlElement(name = "inverseFlattening")
     public Measure getInverseFlattening() {
@@ -128,7 +157,7 @@ public final class SecondDefiningParamet
      * This method overwrite the unit with a dimensionless one. This is required anyway
      * in order to distinguish between the two cases.</p>
      *
-     * @param measure The inverse flattening value.
+     * @param  measure  the inverse flattening value.
      */
     public void setInverseFlattening(final Measure measure) {
         if (measure.setUnit(Units.UNITY)) {

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -219,12 +219,12 @@ public class DefaultEllipsoid extends Ab
      *   </tr>
      * </table>
      *
-     * @param properties        The properties to be given to the identified object.
-     * @param semiMajorAxis     The equatorial radius.
-     * @param semiMinorAxis     The polar radius.
-     * @param inverseFlattening The inverse of the flattening value.
-     * @param ivfDefinitive     {@code true} if the inverse flattening is definitive.
-     * @param unit              The units of the semi-major and semi-minor axis values.
+     * @param  properties         the properties to be given to the identified object.
+     * @param  semiMajorAxis      the equatorial radius.
+     * @param  semiMinorAxis      the polar radius.
+     * @param  inverseFlattening  the inverse of the flattening value.
+     * @param  ivfDefinitive      {@code true} if the inverse flattening is definitive.
+     * @param  unit               the units of the semi-major and semi-minor axis values.
      *
      * @see #createEllipsoid(Map, double, double, Unit)
      * @see #createFlattenedSphere(Map, double, double, Unit)
@@ -255,7 +255,7 @@ public class DefaultEllipsoid extends Ab
      *
      * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p>
      *
-     * @param ellipsoid The ellipsoid to copy.
+     * @param  ellipsoid  the ellipsoid to copy.
      *
      * @see #castOrCopy(Ellipsoid)
      */
@@ -273,11 +273,11 @@ public class DefaultEllipsoid extends Ab
      * The properties map is given unchanged to the
      * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
      *
-     * @param properties    The properties to be given to the identified object.
-     * @param semiMajorAxis The equatorial radius in the given unit.
-     * @param semiMinorAxis The polar radius in the given unit.
-     * @param unit          The units of the semi-major and semi-minor axis values.
-     * @return An ellipsoid with the given axis length.
+     * @param  properties     the properties to be given to the identified object.
+     * @param  semiMajorAxis  the equatorial radius in the given unit.
+     * @param  semiMinorAxis  the polar radius in the given unit.
+     * @param  unit           the units of the semi-major and semi-minor axis values.
+     * @return an ellipsoid with the given axis length.
      *
      * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createEllipsoid(Map, double, double, Unit)
      */
@@ -299,11 +299,11 @@ public class DefaultEllipsoid extends Ab
      * The properties map is given unchanged to the
      * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
      *
-     * @param  properties       The properties to be given to the identified object.
-     * @param semiMajorAxis     The equatorial radius in the given unit.
-     * @param inverseFlattening The inverse flattening value.
-     * @param unit              The units of the semi-major and semi-minor axis values.
-     * @return An ellipsoid with the given axis length.
+     * @param  properties         the properties to be given to the identified object.
+     * @param  semiMajorAxis      the equatorial radius in the given unit.
+     * @param  inverseFlattening  the inverse flattening value.
+     * @param  unit               the units of the semi-major and semi-minor axis values.
+     * @return an ellipsoid with the given axis length.
      *
      * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createFlattenedSphere(Map, double, double, Unit)
      */
@@ -327,8 +327,8 @@ public class DefaultEllipsoid extends Ab
      * Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
      * Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.
      *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
+     * @param  object  the object to get as a SIS implementation, or {@code null} if none.
+     * @return a SIS implementation containing the values of the given object (may be the
      *         given object itself), or {@code null} if the argument was null.
      */
     public static DefaultEllipsoid castOrCopy(final Ellipsoid object) {
@@ -363,7 +363,7 @@ public class DefaultEllipsoid extends Ab
      * Returns the linear unit of the {@linkplain #getSemiMajorAxis() semi-major}
      * and {@linkplain #getSemiMinorAxis() semi-minor} axis values.
      *
-     * @return The axis linear unit.
+     * @return the axis linear unit.
      */
     @Override
     public Unit<Length> getAxisUnit() {
@@ -374,7 +374,7 @@ public class DefaultEllipsoid extends Ab
      * Length of the semi-major axis of the ellipsoid.
      * This is the equatorial radius in {@linkplain #getAxisUnit() axis linear unit}.
      *
-     * @return Length of semi-major axis.
+     * @return length of semi-major axis.
      */
     @Override
     public double getSemiMajorAxis() {
@@ -385,7 +385,7 @@ public class DefaultEllipsoid extends Ab
      * Length of the semi-minor axis of the ellipsoid. This is the
      * polar radius in {@linkplain #getAxisUnit() axis linear unit}.
      *
-     * @return Length of semi-minor axis.
+     * @return length of semi-minor axis.
      */
     @Override
     public double getSemiMinorAxis() {
@@ -396,7 +396,7 @@ public class DefaultEllipsoid extends Ab
      * Returns the radius of a hypothetical sphere having the same surface than this ellipsoid.
      * The radius is expressed in {@linkplain #getAxisUnit() axis linear unit}.
      *
-     * @return The radius of a sphere having the same surface than this ellipsoid.
+     * @return the radius of a sphere having the same surface than this ellipsoid.
      *
      * @see org.apache.sis.referencing.CommonCRS#SPHERE
      */
@@ -489,7 +489,7 @@ public class DefaultEllipsoid extends Ab
      * For perfect spheres (i.e. if {@link #isSphere()} returns {@code true}),
      * the {@link Double#POSITIVE_INFINITY} value is used.
      *
-     * @return The inverse flattening value.
+     * @return the inverse flattening value.
      */
     @Override
     public double getInverseFlattening() {
@@ -531,11 +531,11 @@ public class DefaultEllipsoid extends Ab
      * Orthodromic distances are different than the <cite>loxodromic distance</cite>.
      * The later is a longer distance on a path with a constant direction on the compass.</div>
      *
-     * @param  λ1 Longitude of first  point (in decimal degrees).
-     * @param  φ1 Latitude  of first  point (in decimal degrees).
-     * @param  λ2 Longitude of second point (in decimal degrees).
-     * @param  φ2 Latitude  of second point (in decimal degrees).
-     * @return The orthodromic distance (in the units of this ellipsoid's axis).
+     * @param  λ1  longitude of first  point (in decimal degrees).
+     * @param  φ1  latitude  of first  point (in decimal degrees).
+     * @param  λ2  longitude of second point (in decimal degrees).
+     * @param  φ2  latitude  of second point (in decimal degrees).
+     * @return the orthodromic distance (in the units of this ellipsoid's axis).
      */
     public double orthodromicDistance(double λ1, double φ1, double λ2, double φ2) {
         λ1 = toRadians(λ1);
@@ -628,14 +628,14 @@ public class DefaultEllipsoid extends Ab
      * {@code WGS84.semiMajorAxisDifference(ED50)} returns 251 metres. This information is a parameter of
      * {@linkplain org.apache.sis.referencing.operation.transform.MolodenskyTransform Molodensky transformations}.</div>
      *
-     * @param  other The other ellipsoid from which to get semi-major axis length difference.
+     * @param  other  the other ellipsoid from which to get semi-major axis length difference.
      * @return (<var>other</var> ellipsoid semi-major axis) - (<var>this</var> ellipsoid semi-major axis).
      *
      * @since 0.7
      */
     public double semiMajorAxisDifference(final Ellipsoid other) {
         double semiMajor = other.getSemiMajorAxis();
-        semiMajor = other.getAxisUnit().getConverterTo(getAxisUnit()).convert(semiMajor);   // Often a no-op.
+        semiMajor = other.getAxisUnit().getConverterTo(getAxisUnit()).convert(semiMajor);            // Often a no-op.
         final DoubleDouble a = new DoubleDouble(semiMajor);     // Presumed accurate in base 10 if no unit conversion.
         a.subtract(getSemiMajorAxis());                         // Presumed accurate in base 10 (not 2) by definition.
         return a.value;
@@ -649,7 +649,7 @@ public class DefaultEllipsoid extends Ab
      * {@code WGS84.flatteningDifference(ED50)} returns approximatively 1.41927E-05. This information is a parameter of
      * {@linkplain org.apache.sis.referencing.operation.transform.MolodenskyTransform Molodensky transformations}.</div>
      *
-     * @param  other The other ellipsoid from which to get flattening difference.
+     * @param  other  the other ellipsoid from which to get flattening difference.
      * @return (<var>other</var> ellipsoid flattening) - (<var>this</var> ellipsoid flattening).
      *
      * @since 0.7
@@ -663,10 +663,10 @@ public class DefaultEllipsoid extends Ab
     /**
      * Compares this ellipsoid with the specified object for equality.
      *
-     * @param  object The object to compare to {@code this}.
-     * @param  mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or
-     *         {@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only properties
-     *         relevant to coordinate transformations.
+     * @param  object  the object to compare to {@code this}.
+     * @param  mode    {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or
+     *                 {@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only
+     *                 properties relevant to coordinate transformations.
      * @return {@code true} if both objects are equal.
      */
     @Override
@@ -748,7 +748,7 @@ public class DefaultEllipsoid extends Ab
      * See {@link org.apache.sis.referencing.AbstractIdentifiedObject#computeHashCode()}
      * for more information.
      *
-     * @return The hash code value. This value may change in any future Apache SIS version.
+     * @return the hash code value. This value may change in any future Apache SIS version.
      */
     @Override
     protected long computeHashCode() {
@@ -831,6 +831,8 @@ public class DefaultEllipsoid extends Ab
         } else {
             if (inverseFlattening == 0) {
                 inverseFlattening = Formulas.getInverseFlattening(semiMajorAxis, semiMinorAxis);
+            } else if (inverseFlattening == Double.POSITIVE_INFINITY && semiMinorAxis == 0) {
+                semiMinorAxis = semiMajorAxis;
             }
         }
         if (unit == null) {
@@ -885,36 +887,50 @@ public class DefaultEllipsoid extends Ab
      * @see #afterUnmarshal(Unmarshaller, Object)
      */
     private void setSecondDefiningParameter(SecondDefiningParameter second) {
-        while (second.secondDefiningParameter != null) {
+        if (second.secondDefiningParameter != null) {
             second = second.secondDefiningParameter;
         }
+        boolean duplicate = false;
+        if (Boolean.TRUE.equals(second.isSphere)) {
+            duplicate = (inverseFlattening != 0);
+            if (!duplicate) {
+                inverseFlattening = Double.POSITIVE_INFINITY;
+            }
+        }
         final Measure measure = second.measure;
         if (measure != null) {
             final boolean isIvfDefinitive = second.isIvfDefinitive();
-            if ((isIvfDefinitive ? inverseFlattening : semiMinorAxis) == 0) {
+            duplicate |= (isIvfDefinitive ? inverseFlattening : semiMinorAxis) != 0;
+            if (!duplicate) {
                 ivfDefinitive = isIvfDefinitive;
                 double value = measure.value;
                 if (isIvfDefinitive) {
+                    /*
+                     * Interpreting an inverse flattening factor of 0 as synonymous of infinity
+                     * is a Well-Known Text (WKT) convention, not part of GML standard. However
+                     * in practice some software do that.
+                     */
                     if (value == 0) {
                         value = Double.POSITIVE_INFINITY;
                     }
                     ensureStrictlyPositive("inverseFlattening", inverseFlattening = value);
-                } else if (semiMinorAxis == 0) {
+                } else {
                     ensureStrictlyPositive("semiMinorAxis", semiMinorAxis = value);
                     harmonizeAxisUnits(measure.getUnit(Length.class));
                 }
-            } else {
-                MetadataUtilities.propertyAlreadySet(DefaultEllipsoid.class,
-                        "setSecondDefiningParameter", "secondDefiningParameter");
             }
         }
+        if (duplicate) {
+            MetadataUtilities.propertyAlreadySet(DefaultEllipsoid.class,
+                    "setSecondDefiningParameter", "secondDefiningParameter");
+        }
     }
 
     /**
      * Ensures that the semi-minor axis uses the same unit than the semi-major one.
      * The {@link #unit} field shall be set to the semi-major axis unit before this method call.
      *
-     * @param uom The semi-minor axis unit.
+     * @param  uom  the semi-minor axis unit.
      */
     private void harmonizeAxisUnits(final Unit<Length> uom) {
         if (unit == null) {

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -157,6 +157,8 @@ public class CoordinateOperationFinder e
      * @param  factory   the factory to use for creating operations not found in the registry.
      * @param  context   the area of interest and desired accuracy, or {@code null} if none.
      * @throws FactoryException if an error occurred while initializing this {@code CoordinateOperationFinder}.
+     *
+     * @see DefaultCoordinateOperationFactory#createOperationFinder(CoordinateOperationAuthorityFactory, CoordinateOperationContext)
      */
     public CoordinateOperationFinder(final CoordinateOperationAuthorityFactory registry,
                                      final CoordinateOperationFactory          factory,

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -78,8 +78,8 @@ import org.apache.sis.util.Utilities;
  * The second approach is the most frequently used.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @version 0.8
  * @since   0.6
- * @version 0.7
  * @module
  */
 public class DefaultCoordinateOperationFactory extends AbstractFactory implements CoordinateOperationFactory {
@@ -686,16 +686,21 @@ next:   for (int i=components.size(); --
      * widest intersection between its {@linkplain AbstractCoordinateOperation#getDomainOfValidity() domain of
      * validity} and the {@linkplain CoordinateOperationContext#getAreaOfInterest() area of interest} is returned.
      *
-     * <p>The default implementation is equivalent to the following code
-     * (omitting the {@code registry} type check and cast for brevity):</p>
+     * <p>The default implementation performs the following steps:</p>
+     * <ul>
+     *   <li>If a coordinate operation has been previously cached for the given CRS and context, return it.</li>
+     *   <li>Otherwise:
+     *     <ol>
+     *       <li>Invoke {@link #createOperationFinder(CoordinateOperationAuthorityFactory, CoordinateOperationContext)}.</li>
+     *       <li>Invoke {@link CoordinateOperationFinder#createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem)}
+     *           on the object returned by the previous step.</li>
+     *       <li>Cache the result, then return it.</li>
+     *     </ol>
+     *   </li>
+     * </ul>
      *
-     * {@preformat java
-     *   CoordinateOperationAuthorityFactory registry = CRS.getAuthorityFactory("EPSG");    // Actually needs cast
-     *   return new CoordinateOperationFinder(registry, this, context).createOperation(sourceCRS, targetCRS);
-     * }
-     *
-     * Subclasses can override this method if they need, for example, to use a custom
-     * {@link CoordinateOperationFinder} implementation.
+     * Subclasses can override {@link #createOperationFinder createOperationFinder(…)} if they need more control on
+     * the way coordinate operations are inferred.
      *
      * @param  sourceCRS  input coordinate reference system.
      * @param  targetCRS  output coordinate reference system.
@@ -730,8 +735,8 @@ next:   for (int i=components.size(); --
         try {
             if (handler == null || (op = handler.peek()) == null) {
                 final AuthorityFactory registry = USE_EPSG_FACTORY ? CRS.getAuthorityFactory(Constants.EPSG) : null;
-                op = new CoordinateOperationFinder((registry instanceof CoordinateOperationAuthorityFactory) ?
-                        (CoordinateOperationAuthorityFactory) registry : null, this, context).createOperation(sourceCRS, targetCRS);
+                op = createOperationFinder((registry instanceof CoordinateOperationAuthorityFactory) ?
+                        (CoordinateOperationAuthorityFactory) registry : null, context).createOperation(sourceCRS, targetCRS);
             }
         } finally {
             if (handler != null) {
@@ -742,6 +747,32 @@ next:   for (int i=components.size(); --
     }
 
     /**
+     * Creates the object which will perform the actual task of finding a coordinate operation path between two CRS.
+     * This method is invoked by {@link #createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem,
+     * CoordinateOperationContext) createOperation(…)} when no operation was found in the cache.
+     * The default implementation is straightforward:
+     *
+     * {@preformat java
+     *   return new CoordinateOperationFinder(registry, this, context);
+     * }
+     *
+     * Subclasses can override this method is they want to modify the way coordinate operations are inferred.
+     *
+     * @param  registry  the factory to use for creating operations as defined by authority, or {@code null} if none.
+     * @param  context   the area of interest and desired accuracy, or {@code null} if none.
+     * @return a finder of conversion or transformation path from a source CRS to a target CRS.
+     * @throws FactoryException if an error occurred while initializing the {@code CoordinateOperationFinder}.
+     *
+     * @since 0.8
+     */
+    protected CoordinateOperationFinder createOperationFinder(
+            final CoordinateOperationAuthorityFactory registry,
+            final CoordinateOperationContext context) throws FactoryException
+    {
+        return new CoordinateOperationFinder(registry, this, context);
+    }
+
+    /**
      * Returns an operation using a particular method for conversion or transformation between
      * two coordinate reference systems. If an operation exists using the given method, then it
      * is returned. If no operation using the given method is found, then the implementation has

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -91,7 +91,7 @@
  * for example by specifying the area of interest.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.7
+ * @version 0.8
  * @since   0.6
  * @module
  */

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -36,41 +36,74 @@ import static org.apache.sis.test.Assert
  */
 public final strictfp class SecondDefiningParameterTest extends XMLTestCase {
     /**
-     * The XML to be used for testing purpose.
+     * XML of an ellipsoid defined by semi-major and semi-minor axes.
+     * The numerical values used for this test is the ones of Clarke 1866 (EPSG:7008).
      */
-    private static final String XML =
+    private static final String ELLIPSOID =
             "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
             "<gml:SecondDefiningParameter xmlns:gml=\"http://www.opengis.net/gml/3.2\">\n" +
-            "  <gml:semiMinorAxis uom=\"urn:ogc:def:uom:EPSG::9001\">6371000.0</gml:semiMinorAxis>\n" +
+            "  <gml:semiMinorAxis uom=\"urn:ogc:def:uom:EPSG::9001\">6356583.8</gml:semiMinorAxis>\n" +
             "</gml:SecondDefiningParameter>";
 
     /**
-     * Generates a XML tree using the annotations on the {@link SecondDefiningParameter} class.
+     * XML of a sphere.
      *
-     * @throws JAXBException If an error occurred during the marshalling process.
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-333">SIS-333</a>
+     */
+    private static final String SPHERE =
+            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
+            "<gml:SecondDefiningParameter xmlns:gml=\"http://www.opengis.net/gml/3.2\">\n" +
+            "  <gml:isSphere>true</gml:isSphere>\n" +
+            "</gml:SecondDefiningParameter>";
+
+    /**
+     * Tests marshalling of an ellipsoid.
+     *
+     * @throws JAXBException if an error occurred during the marshalling process.
      */
     @Test
     public void testMarshalling() throws JAXBException {
         final DefaultEllipsoid ellipsoid = DefaultEllipsoid.createEllipsoid(Collections.singletonMap(
-                DefaultEllipsoid.NAME_KEY, "Sphere"), 6371000, 6371000, Units.METRE);
+                DefaultEllipsoid.NAME_KEY, "Clarke 1866"), 6378206.4, 6356583.8, Units.METRE);
         final SecondDefiningParameter sdp = new SecondDefiningParameter(ellipsoid, false);
-        assertXmlEquals(
-                "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
-                "<gml:SecondDefiningParameter xmlns:gml=\"http://www.opengis.net/gml/3.2\">\n" +
-                "  <gml:semiMinorAxis uom=\"urn:ogc:def:uom:EPSG::9001\">6371000.0</gml:semiMinorAxis>\n" +
-                "</gml:SecondDefiningParameter>",
-                marshal(sdp), "xmlns:*", "xsi:schemaLocation");
+        assertXmlEquals(ELLIPSOID, marshal(sdp), "xmlns:*", "xsi:schemaLocation");
     }
 
     /**
-     * Creates a {@link SecondDefiningParameter} from a XML tree.
+     * Tests unmarshalling of an ellipsoid.
      *
-     * @throws JAXBException If an error occurred during the unmarshalling process.
+     * @throws JAXBException if an error occurred during the unmarshalling process.
      */
     @Test
     public void testUnmarshalling() throws JAXBException {
-        final SecondDefiningParameter sdp = unmarshal(SecondDefiningParameter.class, XML);
-        assertEquals(6371000.0, sdp.measure.value, 0);
-        assertEquals(Units.METRE,  sdp.measure.unit);
+        final SecondDefiningParameter sdp = unmarshal(SecondDefiningParameter.class, ELLIPSOID);
+        assertNull("isSphere", sdp.isSphere);
+        assertEquals("measure", 6356583.8, sdp.measure.value, STRICT);
+        assertEquals("measure", Units.METRE,  sdp.measure.unit);
+    }
+
+    /**
+     * Tests marshalling of a sphere.
+     *
+     * @throws JAXBException if an error occurred during the marshalling process.
+     */
+    @Test
+    public void testMarshallingSphere() throws JAXBException {
+        final DefaultEllipsoid ellipsoid = DefaultEllipsoid.createEllipsoid(Collections.singletonMap(
+                DefaultEllipsoid.NAME_KEY, "Sphere"), 6371000, 6371000, Units.METRE);
+        final SecondDefiningParameter sdp = new SecondDefiningParameter(ellipsoid, false);
+        assertXmlEquals(SPHERE, marshal(sdp), "xmlns:*", "xsi:schemaLocation");
+    }
+
+    /**
+     * Tests unmarshalling of a sphere.
+     *
+     * @throws JAXBException if an error occurred during the unmarshalling process.
+     */
+    @Test
+    public void testUnmarshallingSphere() throws JAXBException {
+        final SecondDefiningParameter sdp = unmarshal(SecondDefiningParameter.class, SPHERE);
+        assertEquals("isSphere", Boolean.TRUE, sdp.isSphere);
+        assertNull("measure", sdp.measure);
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -48,7 +48,12 @@ public final strictfp class DefaultEllip
     /**
      * An XML file in this package containing an ellipsoid definition.
      */
-    private static final String XML_FILE = "Ellipsoid.xml";
+    private static final String ELLIPSOID_FILE = "Ellipsoid.xml";
+
+    /**
+     * An XML file in this package containing a sphere definition.
+     */
+    private static final String SPHERE_FILE = "Sphere.xml";
 
     /**
      * Half of a minute of angle, in degrees.
@@ -209,23 +214,50 @@ public final strictfp class DefaultEllip
     }
 
     /**
-     * Tests unmarshalling and marshalling.
+     * Tests unmarshalling and marshalling of an ellipsoid.
      *
-     * @throws JAXBException If an error occurred during (un)marshalling.
+     * @throws JAXBException if an error occurred during (un)marshalling.
      */
     @Test
-    public void testXML() throws JAXBException {
-        final DefaultEllipsoid ellipsoid = unmarshalFile(DefaultEllipsoid.class, XML_FILE);
+    public void testEllipsoidXML() throws JAXBException {
+        final DefaultEllipsoid ellipsoid = unmarshalFile(DefaultEllipsoid.class, ELLIPSOID_FILE);
         assertEquals("name", "Clarke 1880 (international foot)", ellipsoid.getName().getCode());
         assertEquals("remarks", "Definition in feet assumed to be international foot.", ellipsoid.getRemarks().toString());
+        assertFalse ("isSphere",                              ellipsoid.isSphere());
         assertFalse ("isIvfDefinitive",                       ellipsoid.isIvfDefinitive());
-        assertEquals("semiMajorAxis",     20926202,           ellipsoid.getSemiMajorAxis(), 0);
-        assertEquals("semiMinorAxis",     20854895,           ellipsoid.getSemiMinorAxis(), 0);
+        assertEquals("semiMajorAxis",     20926202,           ellipsoid.getSemiMajorAxis(), STRICT);
+        assertEquals("semiMinorAxis",     20854895,           ellipsoid.getSemiMinorAxis(), STRICT);
         assertEquals("inverseFlattening", 293.46630765562986, ellipsoid.getInverseFlattening(), 1E-12);
         assertEquals("axisUnit",          Units.FOOT,         ellipsoid.getAxisUnit());
         /*
          * Marshall and compare to the original file.
          */
-        assertMarshalEqualsFile(XML_FILE, ellipsoid, "xlmns:*", "xsi:schemaLocation");
+        assertMarshalEqualsFile(ELLIPSOID_FILE, ellipsoid, "xlmns:*", "xsi:schemaLocation");
+    }
+
+    /**
+     * Tests unmarshalling and marshalling of a sphere.
+     *
+     * @throws JAXBException if an error occurred during (un)marshalling.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-333">SIS-333</a>
+     *
+     * @since 0.8
+     */
+    @Test
+    public void testSphereXML() throws JAXBException {
+        final DefaultEllipsoid ellipsoid = unmarshalFile(DefaultEllipsoid.class, SPHERE_FILE);
+        assertEquals("name", "GRS 1980 Authalic Sphere", ellipsoid.getName().getCode());
+        assertEquals("remarks", "Authalic sphere derived from GRS 1980 ellipsoid (code 7019).", ellipsoid.getRemarks().toString());
+        assertTrue  ("isSphere",                                    ellipsoid.isSphere());
+        assertFalse ("isIvfDefinitive",                             ellipsoid.isIvfDefinitive());
+        assertEquals("semiMajorAxis",     6371007,                  ellipsoid.getSemiMajorAxis(), STRICT);
+        assertEquals("semiMinorAxis",     6371007,                  ellipsoid.getSemiMinorAxis(), STRICT);
+        assertEquals("inverseFlattening", Double.POSITIVE_INFINITY, ellipsoid.getInverseFlattening(), STRICT);
+        assertEquals("axisUnit",          Units.METRE,              ellipsoid.getAxisUnit());
+        /*
+         * Marshall and compare to the original file.
+         */
+        assertMarshalEqualsFile(SPHERE_FILE, ellipsoid, "xlmns:*", "xsi:schemaLocation");
     }
 }

Copied: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java (from r1768733, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java?p2=sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java&p1=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java&r1=1768733&r2=1768737&rev=1768737&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java Tue Nov  8 16:57:22 2016
@@ -179,7 +179,7 @@ public class SimpleMetadata implements M
      */
     @Override
     public Collection<MetadataScope> getMetadataScopes() {
-        return Collections.singleton(this);
+        return Collections.<MetadataScope>singleton(this);
     }
 
     /**
@@ -350,7 +350,7 @@ public class SimpleMetadata implements M
      */
     @Override
     public Collection<DataIdentification> getIdentificationInfo() {
-        return Collections.singleton(this);
+        return Collections.<DataIdentification>singleton(this);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -24,8 +24,9 @@
  * may change in incompatible ways in any future version without notice.
  *
  * @author  Martin Desruisseaux (Geomatys)
+ * @author  Johann Sorel (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 package org.apache.sis.internal.simple;

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java?rev=1768737&r1=1768736&r2=1768737&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java [UTF-8] Tue Nov  8 16:57:22 2016
@@ -16,37 +16,15 @@
  */
 package org.apache.sis.test.mock;
 
-import java.util.Date;
 import java.util.Locale;
 import java.util.Collection;
 import java.util.Collections;
-import java.nio.charset.Charset;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.opengis.metadata.Identifier;
 import org.opengis.metadata.Metadata;
-import org.opengis.metadata.MetadataScope;
-import org.opengis.metadata.MetadataExtensionInformation;
-import org.opengis.metadata.ApplicationSchemaInformation;
-import org.opengis.metadata.PortrayalCatalogueReference;
-import org.opengis.metadata.acquisition.AcquisitionInformation;
-import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.citation.CitationDate;
-import org.opengis.metadata.citation.OnlineResource;
-import org.opengis.metadata.citation.Responsibility;
-import org.opengis.metadata.constraint.Constraints;
-import org.opengis.metadata.content.ContentInformation;
-import org.opengis.metadata.distribution.Distribution;
-import org.opengis.metadata.identification.CharacterSet;
-import org.opengis.metadata.identification.Identification;
-import org.opengis.metadata.maintenance.MaintenanceInformation;
-import org.opengis.metadata.maintenance.ScopeCode;
-import org.opengis.metadata.quality.DataQuality;
-import org.opengis.metadata.lineage.Lineage;
-import org.opengis.metadata.spatial.SpatialRepresentation;
-import org.opengis.referencing.ReferenceSystem;
 import org.apache.sis.internal.jaxb.gmd.LocaleAdapter;
+import org.apache.sis.internal.simple.SimpleMetadata;
 import org.apache.sis.xml.Namespaces;
 
 
@@ -59,7 +37,7 @@ import org.apache.sis.xml.Namespaces;
  * @module
  */
 @XmlRootElement(name = "MD_Metadata", namespace = Namespaces.GMD)
-public final strictfp class MetadataMock implements Metadata {
+public final strictfp class MetadataMock extends SimpleMetadata {
     /**
      * The language used for documenting metadata.
      */
@@ -85,25 +63,6 @@ public final strictfp class MetadataMock
     }
 
     /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Identifier getMetadataIdentifier() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getFileIdentifier() {
-        return null;
-    }
-
-    /**
      * Returns {@link #language} in a singleton set or an empty set.
      *
      * @return {@link #language}
@@ -123,292 +82,4 @@ public final strictfp class MetadataMock
     public Locale getLanguage() {
         return language;
     }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Collection<Locale> getLocales() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<Charset> getCharacterSets() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public CharacterSet getCharacterSet() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Citation getParentMetadata() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getParentIdentifier() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends MetadataScope> getMetadataScopes() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Collection<ScopeCode> getHierarchyLevels() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Collection<String> getHierarchyLevelNames() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Responsibility> getContacts() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends CitationDate> getDateInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public Date getDateStamp() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Citation> getMetadataStandards() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getMetadataStandardName() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getMetadataStandardVersion() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Citation> getMetadataProfiles() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Citation> getAlternativeMetadataReferences() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends OnlineResource> getMetadataLinkages() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    @Deprecated
-    public String getDataSetUri() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends SpatialRepresentation> getSpatialRepresentationInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends ReferenceSystem> getReferenceSystemInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends MetadataExtensionInformation> getMetadataExtensionInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Identification> getIdentificationInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends ContentInformation> getContentInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Distribution> getDistributionInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends DataQuality> getDataQualityInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends PortrayalCatalogueReference> getPortrayalCatalogueInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Constraints> getMetadataConstraints() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends ApplicationSchemaInformation> getApplicationSchemaInfo() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public MaintenanceInformation getMetadataMaintenance() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends AcquisitionInformation> getAcquisitionInformation() {
-        return null;
-    }
-
-    /**
-     * Undefined property.
-     * @return {@code null}.
-     */
-    @Override
-    public Collection<? extends Lineage> getResourceLineages() {
-        return null;
-    }
 }



Mime
View raw message