sis-commits mailing list archives

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

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -43,7 +43,7 @@ import java.util.Objects;
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.3
+ * @version 0.5
  * @module
  *
  * @see org.apache.sis.referencing.AbstractIdentifiedObject
@@ -251,7 +251,7 @@ public class SimpleIdentifiedObject impl
         buffer.append(code).append('"');
         final String identifier = Citations.getIdentifier(authority, true);
         if (identifier != null) {
-            buffer.append(", ID[\"").append(identifier).append("\"]");
+            buffer.append(", Id[\"").append(identifier).append("\"]");   // "Id" should be consistent with WKTKeywords.Id.
         }
         return buffer.append(']').toString();
     }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -24,6 +24,7 @@ import org.apache.sis.internal.util.Cita
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.Debug;
+import org.apache.sis.util.Deprecable;
 
 import static org.apache.sis.util.iso.DefaultNameSpace.DEFAULT_SEPARATOR;
 
@@ -39,10 +40,10 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.6
  * @module
  */
-public class SimpleIdentifier implements Identifier, Serializable {
+public class SimpleIdentifier implements Identifier, Deprecable, Serializable {
     /**
      * For cross-version compatibility.
      */
@@ -69,14 +70,21 @@ public class SimpleIdentifier implements
     protected final String code;
 
     /**
+     * {@code true} if this identifier is deprecated.
+     */
+    protected final boolean isDeprecated;
+
+    /**
      * Creates a new reference identifier.
      *
-     * @param authority Responsible party for definition and maintenance of the code, or null.
-     * @param code Alphanumeric value identifying an instance in the namespace.
-     */
-    public SimpleIdentifier(final Citation authority, final String code) {
-        this.authority = authority;
-        this.code = code;
+     * @param authority     Responsible party for definition and maintenance of the code, or null.
+     * @param code          Alphanumeric value identifying an instance in the namespace.
+     * @param isDeprecated  {@code true} if this identifier is deprecated.
+     */
+    public SimpleIdentifier(final Citation authority, final String code, final boolean isDeprecated) {
+        this.authority    = authority;
+        this.code         = code;
+        this.isDeprecated = isDeprecated;
     }
 
     /**
@@ -150,6 +158,26 @@ public class SimpleIdentifier implements
     }
 
     /**
+     * An optional free text.
+     *
+     * @since 0.6
+     */
+    @Override
+    public InternationalString getRemarks() {
+        return null;
+    }
+
+    /**
+     * {@code true} if this identifier is deprecated.
+     *
+     * @since 0.6
+     */
+    @Override
+    public boolean isDeprecated() {
+        return isDeprecated;
+    }
+
+    /**
      * Returns {@code true} if the given object is of the same class than this
      * {@code SimpleIdentifier} and has the same values.
      *
@@ -160,7 +188,9 @@ public class SimpleIdentifier implements
     public boolean equals(final Object obj) {
         if (obj != null && obj.getClass() == getClass()) {
             final SimpleIdentifier that = (SimpleIdentifier) obj;
-            return Objects.equals(code, that.code) && Objects.equals(authority, that.authority);
+            return Objects.equals(code, that.code) &&
+                   Objects.equals(authority, that.authority) &&
+                   isDeprecated == that.isDeprecated;
         }
         return false;
     }
@@ -172,7 +202,7 @@ public class SimpleIdentifier implements
      */
     @Override
     public int hashCode() {
-        return Objects.hash(authority, code) ^ (int) serialVersionUID;
+        return Objects.hash(authority, code, isDeprecated) ^ (int) serialVersionUID;
     }
 
     /**
@@ -219,8 +249,8 @@ public class SimpleIdentifier implements
      * @return Pseudo Well Known Text for this identifier.
      */
     public String toWKT() {
-        final StringBuilder buffer = new StringBuilder(40).append("ID[");
-        append(buffer, Citations.getIdentifier(authority, true));   // Do not invoke getCodeSpace().
+        final StringBuilder buffer = new StringBuilder(40).append("Id[");   // Consistent with WKTKeywords.Id.
+        append(buffer, Citations.getIdentifier(authority, true));           // Do not invoke getCodeSpace().
         append(buffer.append(", "), code);
         return buffer.append(']').toString();
     }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -61,7 +61,19 @@ public final class DefaultFactories exte
     }
 
     /**
-     * Return the default factory implementing the given interface.
+     * Returns {@code true} if the default factory of the given type is the given instance.
+     *
+     * @param  <T>  The interface type.
+     * @param  type The interface type.
+     * @param  factory The factory implementation to test.
+     * @return {@code true} if the given factory implementation is the default instance.
+     */
+    public static synchronized <T> boolean isDefaultInstance(final Class<T> type, final T factory) {
+        return FACTORIES.get(type) == factory;
+    }
+
+    /**
+     * Returns the default factory implementing the given interface.
      * This method gives preference to Apache SIS implementation of factories if present.
      * This is a temporary mechanism while we are waiting for a real dependency injection mechanism.
      *

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

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -25,12 +25,10 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Characters;
+import org.apache.sis.util.Deprecable;
 import org.apache.sis.util.Static;
 
-import static org.apache.sis.util.CharSequences.equalsFiltered;
-import static org.apache.sis.util.CharSequences.trimWhitespaces;
-import static org.apache.sis.util.CharSequences.isUnicodeIdentifier;
-import static org.apache.sis.util.Characters.Filter.LETTERS_AND_DIGITS;
+import static org.apache.sis.util.iso.DefaultNameSpace.DEFAULT_SEPARATOR;
 
 // Branch-dependent imports
 import java.util.Objects;
@@ -54,6 +52,26 @@ public final class Citations extends Sta
     }
 
     /**
+     * Returns {@code true} if the given code is {@code "EPSG"} while the codespace is {@code "IOGP"} or {@code "OGP"}
+     * (ignoring case). This particular combination of code and codespace is handled in a special way.
+     *
+     * <p>This method can be used for identifying where in Apache SIS source code the relationship between
+     * EPSG authority and IOGP code space is hard-coded.</p>
+     *
+     * @param  codeSpace The identifier code space, or {@code null}.
+     * @param  code The identifier code, or {@code null}.
+     * @return {@code true} if the given identifier is {@code "IOGP:EPSG"}.
+     *
+     * @see org.apache.sis.metadata.iso.citation.Citations#EPSG
+     */
+    public static boolean isEPSG(final String codeSpace, final String code) {
+        return Constants.EPSG.equalsIgnoreCase(code) &&
+              (Constants.IOGP.equalsIgnoreCase(codeSpace) || "OGP".equalsIgnoreCase(codeSpace) ||
+               Constants.EPSG.equalsIgnoreCase(codeSpace));
+        // "OGP" is a legacy abbreviation that existed before "IOGP".
+    }
+
+    /**
      * Returns the collection iterator, or {@code null} if the given collection is null
      * or empty. We use this method as a paranoiac safety against broken implementations.
      *
@@ -66,12 +84,35 @@ public final class Citations extends Sta
     }
 
     /**
-     * Returns a "unlocalized" string representation of the given international string,
-     * or {@code null} if none. This method is used by {@link #getIdentifier(Citation, boolean)},
-     * which is why we don't want the localized string.
+     * Return {@code true} if the given object is deprecated.
+     */
+    private static boolean isDeprecated(final Object object) {
+        return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated();
+    }
+
+    /**
+     * Returns a "unlocalized" string representation of the given international string, or {@code null} if none
+     * or if the string is deprecated. This method is used by {@link #getIdentifier(Citation, boolean)}, which
+     * is why we don't want the localized string.
      */
     private static String toString(final InternationalString title) {
-        return (title != null) ? trimWhitespaces(title.toString(Locale.ROOT)) : null;
+        return (title != null && !isDeprecated(title))
+               ? CharSequences.trimWhitespaces(title.toString(Locale.ROOT)) : null;
+    }
+
+    /**
+     * The method to be used consistently for comparing titles or identifiers in all {@code fooMathes(…)}
+     * methods declared in this class.
+     *
+     * @param  s1 The first characters sequence to compare, or {@code null}.
+     * @param  s2 The second characters sequence to compare, or {@code null}.
+     * @return {@code true}if both arguments are {@code null} or if the two given texts are equal,
+     *         ignoring case and any characters other than digits and letters.
+     *
+     * @since 0.6
+     */
+    public static boolean equalsFiltered(final CharSequence s1, final CharSequence s2) {
+        return CharSequences.equalsFiltered(s1, s2, Characters.Filter.LETTERS_AND_DIGITS, true);
     }
 
     /**
@@ -133,12 +174,12 @@ public final class Citations extends Sta
             do {
                 if (candidate != null) {
                     final String unlocalized = candidate.toString(Locale.ROOT);
-                    if (equalsFiltered(unlocalized, title, LETTERS_AND_DIGITS, true)) {
+                    if (equalsFiltered(unlocalized, title)) {
                         return true;
                     }
                     final String localized = candidate.toString();
                     if (!Objects.equals(localized, unlocalized) // Slight optimization for a common case.
-                            && equalsFiltered(localized, title, LETTERS_AND_DIGITS, true))
+                            && equalsFiltered(localized, title))
                     {
                         return true;
                     }
@@ -196,14 +237,14 @@ public final class Citations extends Sta
 
     /**
      * Returns {@code true} if the given citation has at least one identifier equals to the given string,
-     * ignoring case and non-alphanumeric characters. If and <em>only</em> if the citations do not contain
+     * ignoring case and non-alphanumeric characters. If and <em>only</em> if the citation does not contain
      * any identifier, then this method fallback on titles comparison.
      * See {@link org.apache.sis.metadata.iso.citation.Citations#identifierMatches(Citation, String)}
      * for the public documentation of this method.
      *
      * @param  citation   The citation to check for, or {@code null}.
-     * @param  identifier The identifier to compare, or {@code null} to unknown.
-     * @param  code       The identifier code to compare, or {@code null}.
+     * @param  identifier The identifier to compare, or {@code null} if unknown.
+     * @param  code       Value of {@code identifier.getCode()}, or {@code null}.
      * @return {@code true} if both arguments are non-null, and an identifier matches the given string.
      */
     public static boolean identifierMatches(final Citation citation, final Identifier identifier, final CharSequence code) {
@@ -214,13 +255,13 @@ public final class Citations extends Sta
             }
             while (identifiers.hasNext()) {
                 final Identifier id = identifiers.next();
-                if (id != null && equalsFiltered(code, id.getCode(), LETTERS_AND_DIGITS, true)) {
+                if (id != null && equalsFiltered(code, id.getCode())) {
                     if (identifier != null) {
                         final String codeSpace = identifier.getCodeSpace();
                         if (codeSpace != null) {
                             final String cs = id.getCodeSpace();
                             if (cs != null) {
-                                return equalsFiltered(codeSpace, cs, LETTERS_AND_DIGITS, true);
+                                return equalsFiltered(codeSpace, cs);
                             }
                         }
                     }
@@ -313,59 +354,95 @@ public final class Citations extends Sta
      * @param  strict {@code true} for returning a non-null value only if the identifier is a valid Unicode identifier.
      * @return A non-empty identifier for the given citation without leading or trailing whitespaces,
      *         or {@code null} if the given citation is null or does not declare any identifier or title.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-201">SIS-201</a>
      */
     public static String getIdentifier(final Citation citation, final boolean strict) {
-        boolean isUnicode = false; // Whether 'identifier' is a Unicode identifier.
-        String identifier = null;
         if (citation != null) {
+            boolean isUnicode = false;      // Whether 'identifier' is a Unicode identifier.
+            String identifier = null;       // The best identifier found so far.
+            String codeSpace  = null;       // Code space of the identifier, or null if none.
             final Iterator<? extends Identifier> it = iterator(citation.getIdentifiers());
             if (it != null) while (it.hasNext()) {
                 final Identifier id = it.next();
-                if (id != null) {
-                    final String candidate = trimWhitespaces(id.getCode());
-                    if (candidate != null) {
-                        final int length = candidate.length();
-                        if (length != 0 && (identifier == null || length < identifier.length())) {
-                            final boolean s = isUnicodeIdentifier(candidate);
-                            if (s || !isUnicode) {
-                                identifier = candidate;
-                                isUnicode = s;
+                if (id != null && !isDeprecated(id)) {
+                    final String candidate = CharSequences.trimWhitespaces(id.getCode());
+                    if (candidate != null && !candidate.isEmpty()) {
+                        /*
+                         * For a non-empty identifier. Verify if both the code ans its codespace are valid
+                         * Unicode identifiers. If a codespace exist, the code does not need to begin with
+                         * a "Unicode identifier start" (it may be a "Unicode identifier part").
+                         */
+                        String cs = CharSequences.trimWhitespaces(id.getCodeSpace());
+                        if (cs == null || cs.isEmpty()) {
+                            cs = null;
+                            isUnicode = CharSequences.isUnicodeIdentifier(candidate);
+                        } else {
+                            isUnicode = CharSequences.isUnicodeIdentifier(cs);
+                            if (isUnicode) for (int i = 0; i < candidate.length();) {
+                                final int c = candidate.codePointAt(i);
+                                if (!Character.isUnicodeIdentifierPart(c)) {
+                                    isUnicode = false;
+                                    break;
+                                }
+                                i += Character.charCount(c);
                             }
                         }
+                        /*
+                         * If we found a Unicode identifier, we are done and we can exit the loop.
+                         * Otherwise retain the first identifier and continue the search for Unicode identifier.
+                         */
+                        if (identifier == null || isUnicode) {
+                            identifier = candidate;
+                            codeSpace  = cs;
+                            if (isUnicode) break;
+                        }
                     }
                 }
             }
             /*
-             * If no identifier has been found, fallback on the shortest title or alternate title.
-             * We search for alternate titles because ISO specification said that those titles are
-             * often used for abbreviations.
+             * If no identifier has been found, fallback on the first title or alternate title.
+             * We search for alternate titles because ISO specification said that those titles
+             * are often used for abbreviations. Again we give preference to Unicode identifiers,
+             * which are typically alternate titles.
              */
             if (identifier == null) {
-                identifier = toString(citation.getTitle()); // Whitepaces removed by toString(…).
+                identifier = toString(citation.getTitle());     // Whitepaces removed by toString(…).
                 if (identifier != null) {
                     if (identifier.isEmpty()) {
                         identifier = null;
                     } else {
-                        isUnicode = isUnicodeIdentifier(identifier);
+                        isUnicode = CharSequences.isUnicodeIdentifier(identifier);
                     }
                 }
-                final Iterator<? extends InternationalString> iterator = iterator(citation.getAlternateTitles());
-                if (iterator != null) while (iterator.hasNext()) {
-                    final String candidate = toString(iterator.next());
-                    if (candidate != null) {
-                        final int length = candidate.length();
-                        if (length != 0 && (identifier == null || length < identifier.length())) {
-                            final boolean s = isUnicodeIdentifier(candidate);
-                            if (s || !isUnicode) {
+                if (!isUnicode) {
+                    final Iterator<? extends InternationalString> iterator = iterator(citation.getAlternateTitles());
+                    if (iterator != null) while (iterator.hasNext()) {
+                        final String candidate = toString(iterator.next());
+                        if (candidate != null && !candidate.isEmpty()) {
+                            isUnicode = CharSequences.isUnicodeIdentifier(candidate);
+                            if (identifier == null || isUnicode) {
                                 identifier = candidate;
-                                isUnicode = s;
+                                if (isUnicode) break;
                             }
                         }
                     }
                 }
             }
+            /*
+             * Finished searching in the identifiers, title and alternate titles. If the identifier that
+             * we found is not a valid Unicode identifier, we will return it only if the caller did not
+             * asked for strictly valid Unicode identifier.
+             */
+            if (isUnicode || !strict) {
+                if (codeSpace != null && !isEPSG(codeSpace, identifier)) {
+                    return codeSpace + (strict ? '_' : DEFAULT_SEPARATOR) + identifier;
+                } else {
+                    return identifier;
+                }
+            }
         }
-        return (isUnicode || !strict) ? identifier : null;
+        return null;
     }
 
     /**
@@ -430,9 +507,16 @@ public final class Citations extends Sta
 
     /**
      * Infers a code space from the given citation, or returns {@code null} if none.
-     * This method is very close to {@link #getUnicodeIdentifier(Citation)}; its main difference is regarding
-     * the {@link org.apache.sis.metadata.iso.citation.Citations#EPSG} constant: this method returns "EPSG"
-     * instead than "IOGP".
+     * This method is very close to {@link #getUnicodeIdentifier(Citation)}, except that it looks for
+     * {@link IdentifierSpace#getName()} before to scan the identifiers and titles. The result should
+     * be the same in most cases, except some cases like the {@link org.apache.sis.metadata.iso.citation.Citations}
+     * constant for {@code "Proj.4"} in which case this method returns {@code "Proj4"} instead of {@code null}.
+     * As a side effect, using this method also avoid constructing {@code DefaultCitation} objects which were deferred.
+     *
+     * <p>We do not put this method in public API for now because the actions performed by this method could be
+     * revisited in any future SIS version depending on the experience gained. However we should try to keep the
+     * behavior of this method close to the behavior of {@link #getUnicodeIdentifier(Citation)}, which is the
+     * method having a public facade.</p>
      *
      * @param  citation The citation for which to infer the code space, or {@code null}.
      * @return A non-empty code space for the given citation without leading or trailing whitespaces,

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -1594,7 +1594,7 @@ cmp:    while (ia < lga) {
      * @param  s2 The second characters sequence to compare, or {@code null}.
      * @param  filter The subset of characters to compare, or {@code null} for comparing all characters.
      * @param  ignoreCase {@code true} for comparing cases, or {@code false} for requiring exact match.
-     * @return {@code true} if or if both arguments are {@code null} or if the two given texts are equal,
+     * @return {@code true} if both arguments are {@code null} or if the two given texts are equal,
      *         optionally ignoring case and filtered-out characters.
      */
     public static boolean equalsFiltered(final CharSequence s1, final CharSequence s2,

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -174,20 +174,19 @@ public final class Containers extends St
      *
      * <p>The {@link Map#put(Object,Object) Map.put(K,V)} method is supported only if the given
      * converters are {@linkplain org.apache.sis.math.FunctionProperty#INVERTIBLE invertible}.
-     * An invertible converter is not mandatory for other {@code Map} operations.
-     * However some of them are likely to be faster if the inverse converters are available.</p>
+     * An invertible converter is not mandatory for other {@code Map} operations like {@link Map#get(Object)},
+     * but some of them may be faster if the inverse converters are available.</p>
      *
-     * <p>The derived map may contain fewer entries than the original map if some keys
-     * are not convertible. Non-convertible keys are <var>K</var> values for which
-     * {@code keyConverter.apply(K)} returns {@code null}. As a consequence of this sentinel
-     * value usage, the derived map can not contain {@code null} keys.
+     * <p>The derived map may contain fewer entries than the original map if some keys are not convertible.
+     * A key <var>K</var> is non-convertible if {@code keyConverter.apply(K)} returns {@code null}.
+     * As a consequence of this sentinel key usage, the derived map can not contain {@code null} keys.
      * It may contain {@code null} values however.</p>
      *
      * <p>The returned map can be serialized if the given map and converters are serializable.
      * The returned map is <strong>not</strong> thread-safe.</p>
      *
      * <p>The returned map does not implement the {@link CheckedContainer} interface since {@code Map}
-     * is not {@code Collection} sub-type, but the derived map {@linkplain Map#keySet() key set} and
+     * is not a {@code Collection} sub-type, but the derived map {@linkplain Map#keySet() key set} and
      * {@linkplain Map#entrySet() entry set} do.</p>
      *
      * @param <SK>         The type of keys   in the storage map.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -706,7 +706,7 @@ public final class Types extends Static
 
     /**
      * Returns the given characters sequence as an international string. If the given sequence is
-     * null or an instance of {@link InternationalString}, this this method returns it unchanged.
+     * null or an instance of {@link InternationalString}, then this method returns it unchanged.
      * Otherwise, this method copies the {@link InternationalString#toString()} value in a new
      * {@link SimpleInternationalString} instance and returns it.
      *

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -110,6 +110,11 @@ public final class Messages extends Inde
         public static final short NotFormalProjectionParameter_1 = 10;
 
         /**
+         * Optional module “{0}” requested but not found.
+         */
+        public static final short OptionalModuleNotFound_1 = 12;
+
+        /**
          * Property “{0}” is hidden by “{1}”.
          */
         public static final short PropertyHiddenBy_2 = 4;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] Fri Jun  5 13:53:58 2015
@@ -21,8 +21,9 @@ ConstantProjParameterValue_1    = This p
 DiscardedExclusiveProperty_2    = Property \u201c{0}\u201d has been discarded in favor of \u201c{1}\u201d, because those two properties are mutually exclusive.
 IgnoredPropertiesAfterFirst_1   = Ignored properties after the first occurrence of \u2018{0}\u2019.
 IgnoredPropertyAssociatedTo_1   = Ignored property associated to \u2018{0}\u2019.
-PropertyHiddenBy_2              = Property \u201c{0}\u201d is hidden by \u201c{1}\u201d.
 LocalesDiscarded                = Text were discarded for some locales.
+OptionalModuleNotFound_1        = Optional module \u201c{0}\u201d requested but not found.
+PropertyHiddenBy_2              = Property \u201c{0}\u201d is hidden by \u201c{1}\u201d.
 MismatchedEllipsoidAxisLength_3 = The \u201c{1}\u201d parameter could have been omitted. But it has been given a value of {2} which does not match the definition of the \u201c{0}\u201d ellipsoid.
 NotFormalProjectionParameter_1  = This parameter borrowed from the \u201c{0}\u201d projection is not formally a parameter of this projection.
 UnparsableValueStoredAsText_2   = Can not parse \u201c{1}\u201d as an instance of \u2018{0}\u2019. The value is stored as plain text instead, but will be ignored by some processing.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] Fri Jun  5 13:53:58 2015
@@ -21,8 +21,9 @@ ConstantProjParameterValue_1    = Ce par
 DiscardedExclusiveProperty_2    = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9 \u00e9cart\u00e9e en faveur de \u00ab\u202f{1}\u202f\u00bb, parce que ces deux propri\u00e9t\u00e9s sont mutuellement exclusives.
 IgnoredPropertiesAfterFirst_1   = Des propri\u00e9t\u00e9s ont \u00e9t\u00e9 ignor\u00e9es apr\u00e8s la premi\u00e8re occurrence de \u2018{0}\u2019.
 IgnoredPropertyAssociatedTo_1   = Une propri\u00e9t\u00e9 associ\u00e9e \u00e0 \u2018{0}\u2019 a \u00e9t\u00e9 ignor\u00e9e.
-PropertyHiddenBy_2              = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb est masqu\u00e9e par \u00ab\u202f{1}\u202f\u00bb.
 LocalesDiscarded                = Des textes ont \u00e9t\u00e9 ignor\u00e9s pour certaines langues.
+OptionalModuleNotFound_1        = Le module optionnel \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9 demand\u00e9 mais n\u2019a pas \u00e9t\u00e9 trouv\u00e9.
+PropertyHiddenBy_2              = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb est masqu\u00e9e par \u00ab\u202f{1}\u202f\u00bb.
 MismatchedEllipsoidAxisLength_3 = Le param\u00e8tre \u00ab\u202f{1}\u202f\u00bb aurait pu \u00eatre omis. Mais il lui a \u00e9t\u00e9 donn\u00e9 la valeur {2} qui ne correspond pas \u00e0 la d\u00e9finition de l\u2019ellipso\u00efde \u00ab\u202f{0}\u202f\u00bb.
 NotFormalProjectionParameter_1  = Ce param\u00e8tre emprunt\u00e9 \u00e0 la projection \u00ab\u202f{0}\u202f\u00bb n\u2019est pas formellement un param\u00e8tre de cette projection.
 UnparsableValueStoredAsText_2   = La valeur \u00ab\u202f{1}\u202f\u00bb ne peut pas \u00eatre interpr\u00e9t\u00e9e comme une instance de \u2018{0}\u2019. Elle est donc m\u00e9moris\u00e9e sous sa forme textuelle, mais sera ignor\u00e9e par certains traitements.

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -39,10 +39,10 @@ public final strictfp class SimpleIdenti
     @Test
     public void testToString() {
         final SimpleCitation authority = new SimpleCitation("EPSG");
-        assertEquals("SimpleIdentifier[“EPSG:4326”]", new SimpleIdentifier(authority, "4326").toString());
-        assertEquals("SimpleIdentifier[“EPSG”]",      new SimpleIdentifier(authority,  null ).toString());
-        assertEquals("SimpleIdentifier[“4326”]",      new SimpleIdentifier(null,      "4326").toString());
-        assertEquals("SimpleIdentifier[]",            new SimpleIdentifier(null,       null ).toString());
+        assertEquals("SimpleIdentifier[“EPSG:4326”]", new SimpleIdentifier(authority, "4326", false).toString());
+        assertEquals("SimpleIdentifier[“EPSG”]",      new SimpleIdentifier(authority,  null,  false).toString());
+        assertEquals("SimpleIdentifier[“4326”]",      new SimpleIdentifier(null,      "4326", false).toString());
+        assertEquals("SimpleIdentifier[]",            new SimpleIdentifier(null,       null,  false).toString());
     }
 
     /**
@@ -51,9 +51,9 @@ public final strictfp class SimpleIdenti
     @Test
     public void testToWKT() {
         final SimpleCitation authority = new SimpleCitation("EPSG");
-        assertEquals("ID[\"EPSG\", \"4326\"]", new SimpleIdentifier(authority, "4326").toWKT());
-        assertEquals("ID[\"EPSG\", null]",     new SimpleIdentifier(authority,  null ).toWKT());
-        assertEquals("ID[null, \"4326\"]",     new SimpleIdentifier(null,      "4326").toWKT());
-        assertEquals("ID[null, null]",         new SimpleIdentifier(null,       null ).toWKT());
+        assertEquals("Id[\"EPSG\", \"4326\"]", new SimpleIdentifier(authority, "4326", false).toWKT());
+        assertEquals("Id[\"EPSG\", null]",     new SimpleIdentifier(authority,  null,  false).toWKT());
+        assertEquals("Id[null, \"4326\"]",     new SimpleIdentifier(null,      "4326", false).toWKT());
+        assertEquals("Id[null, null]",         new SimpleIdentifier(null,       null,  false).toWKT());
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -31,7 +31,7 @@ import static org.junit.Assert.*;
 
 
 /**
- * Tests the {@link Citations} class.
+ * Tests the internal {@link Citations} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
@@ -44,7 +44,7 @@ public final strictfp class CitationsTes
      */
      @SuppressWarnings("serial")
      private static Identifier identifier(final String codeSpace, final String code) {
-        return new SimpleIdentifier(null, code) {
+        return new SimpleIdentifier(null, code, false) {
             @Override public String getCodeSpace() {
                 return codeSpace;
             }
@@ -117,7 +117,7 @@ public final strictfp class CitationsTes
     }
 
     /**
-     * A citation which is also an {@link IdentifierSpace}, for {@link #testGetUnicodeIdentifier()} purpose.
+     * A citation which is also an {@link IdentifierSpace}, for {@link #testGetCodeSpace()} purpose.
      */
      @SuppressWarnings("serial")
      private static final class Proj4 extends SimpleCitation implements IdentifierSpace<Integer> {

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -151,7 +151,7 @@ public final strictfp class DefinitionUR
      */
     @Test
     public void testToURN() {
-        final Identifier identifier = new SimpleIdentifier(new SimpleCitation("EPSG"), "4326");
+        final Identifier identifier = new SimpleIdentifier(new SimpleCitation("EPSG"), "4326", false);
         assertEquals("urn:ogc:def:crs:EPSG::4326", DefinitionURI.format("crs", identifier));
     }
 }

Modified: sis/branches/JDK7/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/build.xml?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/build.xml Fri Jun  5 13:53:58 2015
@@ -112,6 +112,13 @@
       </fileset>
     </concat>
 
+    <!-- CoordinateOperationFactory implementations to be loaded by ServiceLoader. -->
+    <concat destfile="${build.classes.dir}/META-INF/services/org.opengis.referencing.operation.CoordinateOperationFactory" encoding="UTF-8" fixlastline="yes">
+      <fileset dir="${project.root}">
+        <include name="*/*/src/main/resources/META-INF/services/org.opengis.referencing.operation.CoordinateOperationFactory"/>
+      </fileset>
+    </concat>
+
 
 
     <!-- ==== Apache SIS service providers ========================================================================= -->

Modified: sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] (original)
+++ sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -58,7 +58,7 @@ public final strictfp class DirectRefere
     @SuppressWarnings("deprecation")
     private static DefaultMetadata createMetadata(final boolean legacy) {
         final DefaultMetadata metadata = new DefaultMetadata();
-        final DefaultCitation citation = new DefaultCitation("European Petroleum Survey Group");
+        final DefaultCitation citation = new DefaultCitation("EPSG Geodetic Parameter Dataset");
         Collection<Responsibility> r = HardCodedCitations.EPSG.getCitedResponsibleParties();
         if (legacy) {
             r = Collections.<Responsibility>singleton(new DefaultResponsibleParty(TestUtilities.getSingleton(r)));

Modified: sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml (original)
+++ sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml Fri Jun  5 13:53:58 2015
@@ -39,7 +39,7 @@
           <gmd:authority>
             <gmd:CI_Citation>
               <gmd:title>
-                <gco:CharacterString>European Petroleum Survey Group</gco:CharacterString>
+                <gco:CharacterString>EPSG Geodetic Parameter Dataset</gco:CharacterString>
               </gmd:title>
               <gmd:citedResponsibleParty>
                 <gmd:CI_ResponsibleParty>

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -66,7 +66,6 @@ import org.apache.sis.internal.netcdf.De
 import org.apache.sis.internal.netcdf.Variable;
 import org.apache.sis.internal.netcdf.GridGeometry;
 import org.apache.sis.internal.system.DefaultFactories;
-import org.apache.sis.internal.metadata.Standards;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.measure.Units;
 
@@ -933,7 +932,7 @@ final class MetadataReader {
      */
     public Metadata read() throws IOException {
         final DefaultMetadata metadata = new DefaultMetadata();
-        metadata.setMetadataStandards(singleton(Standards.ISO_19115_2));
+        metadata.setMetadataStandards(Citations.ISO_19115);
         final Identifier identifier = getFileIdentifier();
         metadata.setMetadataIdentifier(identifier);
         final Date creation = decoder.dateValue(METADATA_CREATION);

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -87,8 +87,8 @@ public final strictfp class ConformanceT
      * @param hasContact {@code true} for adding contact information.
      */
     private static void addCommonProperties(final Map<String,Object> expected, final boolean hasContact) {
-        assertNull(expected.put("metadataStandardName", "ISO 19115-2 Geographic Information — Metadata Part 2: Extensions for imagery and gridded data"));
-        assertNull(expected.put("metadataStandardVersion", "ISO 19115-2:2009(E)"));
+        assertNull(expected.put("metadataStandardName", "Geographic Information — Metadata Part 1: Fundamentals"));
+        assertNull(expected.put("metadataStandardVersion", "ISO 19115-1:2014(E)"));
         if (hasContact) {
             assertNull(expected.put("identificationInfo.pointOfContact.role", Role.POINT_OF_CONTACT));
             assertNull(expected.put("contact.role", Role.POINT_OF_CONTACT));

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1683756&r1=1683755&r2=1683756&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Fri Jun  5 13:53:58 2015
@@ -154,8 +154,29 @@ public final strictfp class MetadataRead
             "  │   ├─Code…………………………………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" +
             "  │   └─Authority\n" +
             "  │       └─Title……………………………………………………………………………… edu.ucar.unidata\n" +
-            "  └─Metadata standard\n" +
-            "      ├─Title………………………………………………………………………………………… ISO 19115-2 Geographic Information — Metadata Part 2: Extensions for imagery and gridded data\n" +
-            "      └─Edition…………………………………………………………………………………… ISO 19115-2:2009(E)\n", text);
+            "  ├─Metadata standard (1 of 2)\n" +
+            "  │   ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 1: Fundamentals\n" +
+            "  │   ├─Cited responsible party\n" +
+            "  │   │   ├─Party\n" +
+            "  │   │   │   └─Name……………………………………………………………………… International Organization for Standardization\n" +
+            "  │   │   └─Role………………………………………………………………………………… Principal investigator\n" +
+            "  │   ├─Edition…………………………………………………………………………………… ISO 19115-1:2014(E)\n" +
+            "  │   ├─Identifier\n" +
+            "  │   │   ├─Code………………………………………………………………………………… 19115-1\n" +
+            "  │   │   ├─Code space………………………………………………………………… ISO\n" +
+            "  │   │   └─Version………………………………………………………………………… 2014(E)\n" +
+            "  │   └─Presentation form………………………………………………………… Document digital\n" +
+            "  └─Metadata standard (2 of 2)\n" +
+            "      ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 2: Extensions for imagery and gridded data\n" +
+            "      ├─Cited responsible party\n" +
+            "      │   ├─Party\n" +
+            "      │   │   └─Name……………………………………………………………………… International Organization for Standardization\n" +
+            "      │   └─Role………………………………………………………………………………… Principal investigator\n" +
+            "      ├─Edition…………………………………………………………………………………… ISO 19115-2:2009(E)\n" +
+            "      ├─Identifier\n" +
+            "      │   ├─Code………………………………………………………………………………… 19115-2\n" +
+            "      │   ├─Code space………………………………………………………………… ISO\n" +
+            "      │   └─Version………………………………………………………………………… 2009(E)\n" +
+            "      └─Presentation form………………………………………………………… Document digital\n", text);
     }
 }



Mime
View raw message