sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1732567 - in /sis/branches/JDK8: application/sis-console/src/main/java/org/apache/sis/console/ application/sis-console/src/main/resources/org/apache/sis/console/ application/sis-console/src/test/java/org/apache/sis/console/ core/sis-metada...
Date Fri, 26 Feb 2016 22:04:01 GMT
Author: desruisseaux
Date: Fri Feb 26 22:04:01 2016
New Revision: 1732567

URL: http://svn.apache.org/viewvc?rev=1732567&view=rev
Log:
Initial implementation of the "identifier" sub-command in the command-line tools.
This work required an improvement in GeodeticDatum.isHeuristicMatchForName(String)
in order to ignore the prime meridian name in some circumstances.

Modified:
    sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Command.java
    sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java
    sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java
    sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Option.java
    sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands.properties
    sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands_fr.properties
    sis/branches/JDK8/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IO.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties

Modified: sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Command.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Command.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Command.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Command.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -35,11 +35,12 @@ import org.apache.sis.util.logging.Monol
  * Command line interface for Apache SIS. The {@link #main(String[])} method accepts the following actions:
  *
  * <blockquote><table class="compact" summary="Supported command-line actions.">
- * <tr><td>{@code help}     </td><td>Show a help overview.</td></tr>
- * <tr><td>{@code about}    </td><td>Show information about Apache SIS and system configuration.</td></tr>
- * <tr><td>{@code mime-type}</td><td>Show MIME type for the given file.</td></tr>
- * <tr><td>{@code metadata} </td><td>Show metadata information for the given file.</td></tr>
- * <tr><td>{@code crs}      </td><td>Show Coordinate Reference System information for the given file or code.</td></tr>
+ * <tr><td>{@code help}       </td><td>Show a help overview.</td></tr>
+ * <tr><td>{@code about}      </td><td>Show information about Apache SIS and system configuration.</td></tr>
+ * <tr><td>{@code mime-type}  </td><td>Show MIME type for the given file.</td></tr>
+ * <tr><td>{@code metadata}   </td><td>Show metadata information for the given file.</td></tr>
+ * <tr><td>{@code crs}        </td><td>Show Coordinate Reference System information for the given file or code.</td></tr>
+ * <tr><td>{@code identifier} </td><td>Show identifiers for metadata and referencing systems in the given file.</td></tr>
  * </table></blockquote>
  *
  * Each command can accepts an arbitrary amount of the following options:
@@ -156,11 +157,12 @@ public final class Command {
         } else {
             commandName = commandName.toLowerCase(Locale.US);
             switch (commandName) {
-                case "help":      command = new HelpSC    (       commandIndex, args); break;
-                case "about":     command = new AboutSC   (       commandIndex, args); break;
-                case "mime-type": command = new MimeTypeSC(       commandIndex, args); break;
-                case "metadata":  command = new MetadataSC(false, commandIndex, args); break;
-                case "crs":       command = new MetadataSC(true,  commandIndex, args); break;
+                case "help":       command = new HelpSC    (commandIndex, args); break;
+                case "about":      command = new AboutSC   (commandIndex, args); break;
+                case "mime-type":  command = new MimeTypeSC(commandIndex, args); break;
+                case "identifier": command = new MetadataSC(MetadataSC.Info.IDENTIFIER, commandIndex, args); break;
+                case "metadata":   command = new MetadataSC(MetadataSC.Info.METADATA,   commandIndex, args); break;
+                case "crs":        command = new MetadataSC(MetadataSC.Info.CRS,        commandIndex, args); break;
                 default: throw new InvalidCommandException(Errors.format(
                             Errors.Keys.UnknownCommand_1, commandName), commandName);
             }

Modified: sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/HelpSC.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -29,7 +29,7 @@ import org.apache.sis.util.resources.Voc
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.7
  * @module
  */
 final class HelpSC extends SubCommand {
@@ -41,7 +41,8 @@ final class HelpSC extends SubCommand {
         "about",
         "mime-type",
         "metadata",
-        "crs"
+        "crs",
+        "identifier"
     };
 
     /**

Modified: sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -22,16 +22,24 @@ import java.io.IOException;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.JAXBException;
 import org.opengis.metadata.Metadata;
+import org.opengis.metadata.Identifier;
+import org.opengis.util.FactoryException;
+import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.ReferenceSystem;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.apache.sis.io.TableAppender;
 import org.apache.sis.io.wkt.WKTFormat;
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.Colors;
 import org.apache.sis.metadata.MetadataStandard;
 import org.apache.sis.metadata.ValueExistencePolicy;
+import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.referencing.CRS;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStores;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.util.Utilities;
 import org.apache.sis.util.collection.TableColumn;
 import org.apache.sis.util.collection.TreeTable;
 import org.apache.sis.util.collection.TreeTableFormat;
@@ -41,7 +49,7 @@ import org.apache.sis.xml.XML;
 
 
 /**
- * The "metadata" and "crs" subcommands.
+ * The "metadata", "crs" and "identifier" subcommands.
  * CRS are considered as a kind of metadata here.
  *
  * @author  Martin Desruisseaux (Geomatys)
@@ -51,6 +59,13 @@ import org.apache.sis.xml.XML;
  */
 final class MetadataSC extends SubCommand {
     /**
+     * The desired information.
+     */
+    static enum Info {
+        METADATA, CRS, IDENTIFIER
+    }
+
+    /**
      * The output format.
      */
     private static enum Format {
@@ -58,51 +73,50 @@ final class MetadataSC extends SubComman
     }
 
     /**
-     * {@code true} for the {@code "crs"} sub-command,
-     * or {@code false} for the {@code "metadata"} sub-command.
+     * The sub-command: {@code "metadata"}, {@code "crs"} or {@code "identifier"}.
      */
-    private final boolean isCRS;
+    private final Info command;
 
     /**
-     * Creates the {@code "metadata"} or {@code "crs"} sub-command.
-     *
-     * @param isCRS {@code true} for the {@code "crs"} sub-command,
-     *        or {@code false} for the {@code "metadata"} sub-command.
+     * The output format.
      */
-    MetadataSC(final boolean isCRS, final int commandIndex, final String... args) throws InvalidOptionException {
+    private Format outputFormat;
+
+    /**
+     * The WKT convention, or {@code null} if it does not apply.
+     */
+    private Convention convention;
+
+    /**
+     * Creates the {@code "metadata"}, {@code "crs"} or {@code "identifier"} sub-command.
+     */
+    MetadataSC(final Info command, final int commandIndex, final String... args) throws InvalidOptionException {
         super(commandIndex, args, EnumSet.of(Option.FORMAT, Option.LOCALE, Option.TIMEZONE, Option.ENCODING,
                 Option.COLORS, Option.HELP, Option.DEBUG));
-        this.isCRS = isCRS;
+        this.command = command;
     }
 
     /**
-     * Prints metadata or CRS information.
-     *
-     * @throws DataStoreException If an error occurred while reading the file.
-     * @throws JAXBException If an error occurred while producing the XML output.
-     * @throws IOException Should never happen, since we are appending to a print writer.
+     * Parses the command-line arguments and initializes the {@link #outputFormat} and {@link #convention} fields
+     * accordingly. This method verifies the parameter validity.
      */
-    @Override
-    @SuppressWarnings("UseOfSystemOutOrSystemErr")
-    public int run() throws InvalidOptionException, DataStoreException, JAXBException, IOException {
+    private void parseArguments() throws InvalidOptionException {
         /*
          * Output format can be either "text" (the default) or "xml".
          * In the case of "crs" sub-command, we accept also WKT variants.
          */
-        Convention convention = null;
-        final Format outputFormat;
         final String format = options.get(Option.FORMAT);
         if (format == null || format.equalsIgnoreCase("text")) {
-            if (isCRS) {
+            if (command == Info.CRS) {
                 outputFormat = Format.WKT;
                 convention = Convention.WKT2_SIMPLIFIED;
             } else {
                 outputFormat = Format.TEXT;
             }
-        } else if (isCRS && (format.equalsIgnoreCase("wkt") || format.equalsIgnoreCase("wkt2"))) {
+        } else if (format.equalsIgnoreCase("wkt") || format.equalsIgnoreCase("wkt2")) {
             outputFormat = Format.WKT;
             convention = Convention.WKT2;
-        } else if (isCRS && format.equalsIgnoreCase("wkt1")) {
+        } else if (format.equalsIgnoreCase("wkt1")) {
             outputFormat = Format.WKT;
             convention = Convention.WKT1;
         } else if (format.equalsIgnoreCase("xml")) {
@@ -111,10 +125,44 @@ final class MetadataSC extends SubComman
             throw new InvalidOptionException(Errors.format(
                     Errors.Keys.IllegalOptionValue_2, "format", format), format);
         }
+        final boolean isFormatCompatible;
+        switch (command) {
+            case CRS: {
+                isFormatCompatible = true;
+                break;
+            }
+            case IDENTIFIER: {
+                isFormatCompatible = (outputFormat == Format.TEXT);
+                break;
+            }
+            default: {
+                isFormatCompatible = (convention == null);
+                break;
+            }
+        }
+        if (!isFormatCompatible) {
+            throw new InvalidOptionException(Errors.format(Errors.Keys.IncompatibleFormat_2,
+                    command.name().toLowerCase(locale), format), format);
+        }
+    }
+
+    /**
+     * Prints metadata or CRS information.
+     *
+     * @throws DataStoreException if an error occurred while reading the file.
+     * @throws JAXBException if an error occurred while producing the XML output.
+     * @throws FactoryException if an error occurred while looking for a CRS identifier.
+     * @throws IOException should never happen, since we are appending to a print writer.
+     */
+    @Override
+    @SuppressWarnings("UseOfSystemOutOrSystemErr")
+    public int run() throws InvalidOptionException, DataStoreException, JAXBException, FactoryException, IOException {
+        parseArguments();
         /*
-         * Read metadata from the data storage.
+         * Read metadata from the data storage only aftr we verified that the arguments are valid.
+         * The input can be a file given on the command line, or the standard input stream.
          */
-        Object metadata;
+        final Metadata metadata;
         if (useStandardInput()) {
             try (DataStore store = DataStores.open(System.in)) {
                 metadata = store.getMetadata();
@@ -131,18 +179,28 @@ final class MetadataSC extends SubComman
             return 0;
         }
         /*
-         * If we are executing the "crs" sub-command, extract the first CRS.
+         * If we are executing the "identifier" sub-command, then show the metadata identifier (if any)
+         * and the identifier of all referencing systems found. Otherwise if we are executing the "crs"
+         * sub-command, extract only the first CRS. That CRS will be displayed after the switch statement.
          */
-        if (isCRS && (metadata instanceof Metadata)) {
-            boolean found = false;
-            for (final ReferenceSystem rs : ((Metadata) metadata).getReferenceSystemInfo()) {
-                if (rs instanceof CoordinateReferenceSystem) {
-                    metadata = rs;
-                    found = true;
-                    break;
+        Object object = metadata;
+choice: switch (command) {
+            case IDENTIFIER: {
+                final TableAppender table = new TableAppender(out, "    ");
+                appendIdentifier(table, metadata);
+                for (final ReferenceSystem rs : metadata.getReferenceSystemInfo()) {
+                    appendIdentifier(table, rs);
                 }
+                table.flush();
+                return 0;
             }
-            if (!found) {
+            case CRS: {
+                for (final ReferenceSystem rs : metadata.getReferenceSystemInfo()) {
+                    if (rs instanceof CoordinateReferenceSystem) {
+                        object = rs;
+                        break choice;
+                    }
+                }
                 return 0;
             }
         }
@@ -151,7 +209,7 @@ final class MetadataSC extends SubComman
          */
         switch (outputFormat) {
             case TEXT: {
-                final TreeTable tree = MetadataStandard.ISO_19115.asTreeTable(metadata, ValueExistencePolicy.NON_EMPTY);
+                final TreeTable tree = MetadataStandard.ISO_19115.asTreeTable(object, ValueExistencePolicy.NON_EMPTY);
                 final TreeTableFormat tf = new TreeTableFormat(locale, timezone);
                 tf.setColumns(TableColumn.NAME, TableColumn.VALUE);
                 tf.format(tree, out);
@@ -166,7 +224,7 @@ final class MetadataSC extends SubComman
                 if (colors) {
                     f.setColors(Colors.DEFAULT);
                 }
-                f.format(metadata, out);
+                f.format(object, out);
                 out.println();
                 break;
             }
@@ -177,11 +235,11 @@ final class MetadataSC extends SubComman
                 marshaller.setProperty(XML.LOCALE,   locale);
                 marshaller.setProperty(XML.TIMEZONE, timezone);
                 if (isConsole()) {
-                    marshaller.marshal(metadata, out);
+                    marshaller.marshal(object, out);
                 } else {
                     out.flush();
                     marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding.name());
-                    marshaller.marshal(metadata, System.out);   // Intentionally use OutputStream instead than Writer.
+                    marshaller.marshal(object, System.out);     // Intentionally use OutputStream instead than Writer.
                     System.out.flush();
                 }
                 break;
@@ -202,4 +260,77 @@ final class MetadataSC extends SubComman
         final Console console = System.console();
         return (console != null) && console.writer() == out;
     }
+
+    /**
+     * Append a row to the given table provided that the identifier is non-null.
+     * If the given identifier is {@code null}, then this method does nothing.
+     */
+    private static void appendRow(final TableAppender table, final CharSequence identifier,
+            final char separator, final CharSequence legend)
+    {
+        if (identifier != null) {
+            table.append(identifier).nextColumn();
+            if (legend != null) {
+                table.append(separator).append(' ').append(legend);
+            }
+            table.nextLine();
+        }
+    }
+
+    /**
+     * Appends the metadata identifier to the given table.
+     */
+    private void appendIdentifier(final TableAppender table, final Metadata metadata) {
+        final Identifier id = metadata.getMetadataIdentifier();
+        if (id != null) {
+            CharSequence desc = id.getDescription();
+            if (desc != null && !files.isEmpty()) desc = files.get(0);
+            appendRow(table, IdentifiedObjects.toString(id), '-', desc);
+        }
+    }
+
+    /**
+     * Append the CRS identifier to the given table.
+     * This method gives precedence to {@code "urn:ogc:def:"} identifiers if possible.
+     */
+    private static void appendIdentifier(final TableAppender table, final ReferenceSystem rs) throws FactoryException {
+        char separator;
+        String legend;
+        String identifier = IdentifiedObjects.lookupURN(rs, null);
+        if (identifier != null) {
+            separator = '-';
+            legend = rs.getName().getCode();
+        } else {
+            for (final Identifier id : rs.getIdentifiers()) {
+                final String c = IdentifiedObjects.toURN(rs.getClass(), id);
+                if (c != null) {
+                    identifier = c;
+                    break;                                          // Stop at the first "urn:ogc:def:…".
+                }
+                if (identifier == null) {
+                    identifier = IdentifiedObjects.toString(id);    // "AUTHORITY:CODE" as a fallback if no URN.
+                }
+            }
+            if (identifier == null) {
+                return;                                             // No identifier found.
+            }
+            /*
+             * The CRS provided by the user contains identifier, but the 'lookupURN' operation above failed to
+             * find it. The most likely cause is that the user-provided CRS does not use the same axis order.
+             */
+            try {
+                separator = '!';
+                final ReferenceSystem def = CRS.forCode(identifier);
+                if (Utilities.deepEquals(def, rs, ComparisonMode.ALLOW_VARIANT)) {
+                    legend = "Axis order does not match the definition.";
+                } else {
+                    legend = "Apparently wrong identifier!";
+                }
+            } catch (NoSuchAuthorityCodeException e) {
+                separator = '?';
+                legend = "Exactness of this identifier has not been verified.";
+            }
+        }
+        appendRow(table, identifier, separator, legend);
+    }
 }

Modified: sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Option.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Option.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Option.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-console/src/main/java/org/apache/sis/console/Option.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -91,7 +91,7 @@ enum Option {
     private static final String[] BOOLEAN_VALUES = {
         "false", "true",
         "off",   "on",
-        "yes",   "no"
+        "no",    "yes"
     };
 
     /**

Modified: sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands.properties?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands.properties [ISO-8859-1] Fri Feb 26 22:04:01 2016
@@ -4,6 +4,7 @@ Usage=Usage: sis <command> [options] [fi
 
 help=Show a help overview.
 about=Show information about Apache SIS and system configuration.
-crs=Show Coordinate Reference System information for the given file.
 mime-type=Show MIME type for the given file.
 metadata=Show metadata information for the given file.
+crs=Show Coordinate Reference System (CRS) information for the given file.
+identifier=Show identifiers for metadata and referencing systems in the given file.

Modified: sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands_fr.properties?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/application/sis-console/src/main/resources/org/apache/sis/console/Commands_fr.properties [ISO-8859-1] Fri Feb 26 22:04:01 2016
@@ -4,6 +4,7 @@ Usage=Usage: sis <commande> [options] [f
 
 help=Affiche un écran d\u2019aide.
 about=Affiche des informations à propos de Apache SIS et de la configuration du système.
-crs=Affiche le système de référence des coordonnées du fichier spécifié.
 mime-type=Affiche le type MIME du fichier spécifié.
 metadata=Affiche les méta-données du fichier spécifié.
+crs=Affiche le système de référence des coordonnées du fichier spécifié.
+identifier=Affiche les identifiants des méta-données et des systèmes de références du fichier spécifié.

Modified: sis/branches/JDK8/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -45,7 +45,7 @@ public final strictfp class MetadataSCTe
     public void testNetCDF() throws Exception {
         final URL url = IOTestCase.class.getResource(IOTestCase.NCEP);
         assertNotNull(IOTestCase.NCEP, url);
-        final MetadataSC test = new MetadataSC(false, 0, SubCommand.TEST, url.toString());
+        final MetadataSC test = new MetadataSC(MetadataSC.Info.METADATA, 0, SubCommand.TEST, url.toString());
         test.run();
         verifyNetCDF("Metadata", test.outputBuffer.toString());
     }
@@ -71,7 +71,8 @@ public final strictfp class MetadataSCTe
     @DependsOnMethod("testNetCDF")
     public void testFormatXML() throws Exception {
         final URL url = IOTestCase.class.getResource(IOTestCase.NCEP);
-        final MetadataSC test = new MetadataSC(false, 0, SubCommand.TEST, url.toString(), "--format", "XML");
+        final MetadataSC test = new MetadataSC(MetadataSC.Info.METADATA,
+                0, SubCommand.TEST, url.toString(), "--format", "XML");
         test.run();
         verifyNetCDF("<?xml", test.outputBuffer.toString());
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -44,7 +44,7 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public final class NameToIdentifier implements Identifier {
@@ -213,19 +213,20 @@ public final class NameToIdentifier impl
      * primary name} or one of the given aliases matches the given name. The comparison ignores case, some Latin
      * diacritical signs and any characters that are not letters or digits.
      *
-     * @param  name     The name of the {@code IdentifiedObject} to check.
-     * @param  aliases  The list of alias in the {@code IdentifiedObject} (may be {@code null}). This method will never
-     *                  modify that list. Consequently, the given list can be a direct reference to an internal list.
-     * @param  toSearch The name for which to check for equality.
+     * @param  name       The name of the {@code IdentifiedObject} to check.
+     * @param  aliases    The list of aliases in the {@code IdentifiedObject} (may be {@code null}). This method will never
+     *                    modify that list. Consequently, the given list can be a direct reference to an internal list.
+     * @param  toSearch   The name for which to check for equality.
+     * @param  simplifier A function for simplifying the names before comparison.
      * @return {@code true} if the primary name or at least one alias matches the given {@code name}.
      */
     public static boolean isHeuristicMatchForName(final Identifier name, final Collection<GenericName> aliases,
-            CharSequence toSearch)
+            CharSequence toSearch, final Simplifier simplifier)
     {
-        toSearch = CharSequences.toASCII(toSearch);
-        if (name != null) { // Paranoiac check.
-            final CharSequence code = CharSequences.toASCII(name.getCode());
-            if (code != null) { // Paranoiac check.
+        toSearch = simplifier.apply(toSearch);
+        if (name != null) {                                                                 // Paranoiac check.
+            final CharSequence code = simplifier.apply(name.getCode());
+            if (code != null) {                                                             // Paranoiac check.
                 if (CharSequences.equalsFiltered(toSearch, code, LETTERS_AND_DIGITS, true)) {
                     return true;
                 }
@@ -233,8 +234,8 @@ public final class NameToIdentifier impl
         }
         if (aliases != null) {
             for (final GenericName alias : aliases) {
-                if (alias != null) { // Paranoiac check.
-                    final CharSequence tip = CharSequences.toASCII(alias.tip().toString());
+                if (alias != null) {                                                        // Paranoiac check.
+                    final CharSequence tip = simplifier.apply(alias.tip().toString());
                     if (CharSequences.equalsFiltered(toSearch, tip, LETTERS_AND_DIGITS, true)) {
                         return true;
                     }
@@ -249,4 +250,33 @@ public final class NameToIdentifier impl
         }
         return false;
     }
+
+    /**
+     * A function for simplifying an {@link IdentifiedObject} name before comparison with
+     * {@link NameToIdentifier#isHeuristicMatchForName(Identifier, Collection, CharSequence, Simplifier)}.
+     *
+     * @since 0.7
+     */
+    public static class Simplifier {
+        /**
+         * The default instance, which replaces some non-ASCII characters by ASCII ones.
+         */
+        public static final Simplifier DEFAULT = new Simplifier();
+
+        /**
+         * For subclasses and default instance only.
+         */
+        protected Simplifier() {
+        }
+
+        /**
+         * Simplifies the given name.
+         *
+         * @param name The object name (may be {@code null}).
+         * @return The name to use for comparison purpose, or {@code null}.
+         */
+        protected CharSequence apply(final CharSequence name) {
+            return CharSequences.toASCII(name);
+        }
+    }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -595,7 +595,8 @@ public class ReferencingServices extends
      * @since 0.6
      */
     public boolean isHeuristicMatchForName(final IdentifiedObject object, final String name) {
-        return NameToIdentifier.isHeuristicMatchForName(object.getName(), object.getAlias(), name);
+        return NameToIdentifier.isHeuristicMatchForName(object.getName(), object.getAlias(), name,
+                NameToIdentifier.Simplifier.DEFAULT);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -494,7 +494,7 @@ public class AbstractIdentifiedObject ex
      */
     @Override
     public Collection<GenericName> getAlias() {
-        return nonNull(alias); // Needs to be null-safe because we may have a null value on unmarshalling.
+        return nonNull(alias);          // Needs to be null-safe because we may have a null value on unmarshalling.
     }
 
     /**
@@ -507,7 +507,7 @@ public class AbstractIdentifiedObject ex
      */
     @Override
     public Set<Identifier> getIdentifiers() {
-        return nonNull(identifiers); // Needs to be null-safe because we may have a null value on unmarshalling.
+        return nonNull(identifiers);    // Needs to be null-safe because we may have a null value on unmarshalling.
     }
 
     /**
@@ -599,9 +599,12 @@ public class AbstractIdentifiedObject ex
      *   <li>{@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#isHeuristicMatchForName(String)
      *       Comparisons of coordinate system axis names} consider {@code "Lat"}, {@code "Latitude"} and
      *       {@code "Geodetic latitude"} as synonymous, and likewise for longitude.</li>
-     *   <li>{@linkplain org.apache.sis.referencing.datum.DefaultGeodeticDatum#isHeuristicMatchForName(String)
-     *       Comparisons of geodetic datum names} ignore the {@code "D_"} prefix, if any.
+     *   <li>{@linkplain org.apache.sis.referencing.datum.AbstractDatum#isHeuristicMatchForName(String)
+     *       Comparisons of datum names} ignore the {@code "D_"} prefix, if any.
      *       This prefix appears in ESRI datum name (e.g. {@code "D_WGS_1984"}).</li>
+     *   <li>{@linkplain org.apache.sis.referencing.datum.DefaultGeodeticDatum#isHeuristicMatchForName(String)
+     *       Comparisons of geodetic datum names} may ignore the prime meridian name, if any.
+     *       Example: <cite>"(Paris)"</cite> in <cite>"Nouvelle Triangulation Française (Paris)"</cite>.</li>
      * </ul>
      *
      * <div class="section">Future evolutions</div>
@@ -612,13 +615,13 @@ public class AbstractIdentifiedObject ex
      * gained while working with more data producers.
      *
      * @param  name The name to compare with the object name or aliases.
-     * @return {@code true} if the primary name of at least one alias matches the specified {@code name}.
+     * @return {@code true} if the primary name or at least one alias matches the specified {@code name}.
      *
      * @see IdentifiedObjects#isHeuristicMatchForName(IdentifiedObject, String)
      * @see org.apache.sis.util.Characters.Filter#LETTERS_AND_DIGITS
      */
     public boolean isHeuristicMatchForName(final String name) {
-        return NameToIdentifier.isHeuristicMatchForName(this.name, alias, name);
+        return NameToIdentifier.isHeuristicMatchForName(this.name, alias, name, NameToIdentifier.Simplifier.DEFAULT);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -408,7 +408,18 @@ public final class IdentifiedObjects ext
         String urn = null;
         if (object != null) {
             for (final IdentifiedObject candidate : newFinder(null).find(object)) {
-                final String c = toURN(candidate.getClass(), getIdentifier(candidate, authority));
+                String c = toURN(candidate.getClass(), getIdentifier(candidate, authority));
+                if (c == null && authority == null) {
+                    /*
+                     * If 'authority' was null, then getIdentifier(candidate, authority) returned the identifier
+                     * for the first authority.  But not all authorities can be formatted as a URN. So try other
+                     * authorities.
+                     */
+                    for (final Identifier id : candidate.getIdentifiers()) {
+                        c = toURN(candidate.getClass(), id);
+                        if (c != null) break;
+                    }
+                }
                 if (c != null) {
                     if (urn != null && !urn.equals(c)) {
                         return null;
@@ -543,7 +554,7 @@ public final class IdentifiedObjects ext
      *
      * @param  object The object for which to check the name or alias.
      * @param  name The name to compare with the object name or aliases.
-     * @return {@code true} if the primary name of at least one alias matches the specified {@code name}.
+     * @return {@code true} if the primary name or at least one alias matches the specified {@code name}.
      *
      * @see AbstractIdentifiedObject#isHeuristicMatchForName(String)
      */
@@ -554,7 +565,8 @@ public final class IdentifiedObjects ext
             return ((AbstractIdentifiedObject) object).isHeuristicMatchForName(name);
         } else {
             ArgumentChecks.ensureNonNull("object", object);
-            return NameToIdentifier.isHeuristicMatchForName(object.getName(), object.getAlias(), name);
+            return NameToIdentifier.isHeuristicMatchForName(object.getName(), object.getAlias(), name,
+                    NameToIdentifier.Simplifier.DEFAULT);
         }
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -32,8 +32,10 @@ import org.opengis.referencing.datum.Dat
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.util.iso.Types;
+import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.internal.util.Citations;
+import org.apache.sis.internal.metadata.NameToIdentifier;
 import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.io.wkt.ElementKind;
 import org.apache.sis.io.wkt.Formatter;
@@ -334,12 +336,14 @@ public class AbstractDatum extends Abstr
      * Returns {@code true} if either the {@linkplain #getName() primary name} or at least
      * one {@linkplain #getAlias() alias} matches the given string according heuristic rules.
      * This method performs the comparison documented in the
-     * {@link AbstractIdentifiedObject#isHeuristicMatchForName(String) super-class},
+     * {@linkplain AbstractIdentifiedObject#isHeuristicMatchForName(String) super-class},
      * with the following additional flexibility:
      *
      * <ul>
      *   <li>The {@code "D_"} prefix (used in ESRI datum names), if presents in the given name or in this datum name,
      *       is ignored.</li>
+     *   <li>If this datum is an instance of {@link DefaultGeodeticDatum}, then the prime meridian name may also
+     *       be ignored.</li>
      * </ul>
      *
      * <div class="section">Future evolutions</div>
@@ -348,20 +352,33 @@ public class AbstractDatum extends Abstr
      * gained while working with more data producers.
      *
      * @param  name The name to compare.
-     * @return {@code true} if the primary name of at least one alias matches the specified {@code name}.
+     * @return {@code true} if the primary name or at least one alias matches the specified {@code name}.
      */
     @Override
     public boolean isHeuristicMatchForName(final String name) {
-        if (name.startsWith((ESRI_PREFIX))) {
-            if (super.isHeuristicMatchForName(name.substring(ESRI_PREFIX.length()))) {
-                return true;
-            }
-        } else if (getName().getCode().startsWith(ESRI_PREFIX)) {
-            if (super.isHeuristicMatchForName(ESRI_PREFIX.concat(name))) {
-                return true;
+        return NameToIdentifier.isHeuristicMatchForName(super.getName(), super.getAlias(), name, Simplifier.INSTANCE);
+    }
+
+    /**
+     * A function for simplifying a {@link Datum} name before comparison.
+     *
+     * @since 0.7
+     */
+    static class Simplifier extends NameToIdentifier.Simplifier {
+        /** The singleton simplifier for non-geodetic datum. */
+        static final Simplifier INSTANCE = new Simplifier();
+
+        /** For subclasses and default instance only. */
+        Simplifier() {}
+
+        /** Simplify the given datum name. */
+        @Override protected CharSequence apply(CharSequence name) {
+            name = super.apply(name);
+            if (CharSequences.startsWith(name, ESRI_PREFIX, false)) {
+                name = name.subSequence(ESRI_PREFIX.length(), name.length());
             }
+            return name;
         }
-        return super.isHeuristicMatchForName(name);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -35,6 +35,7 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.referencing.operation.matrix.NoninvertibleMatrixException;
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.internal.metadata.WKTKeywords;
+import org.apache.sis.internal.metadata.NameToIdentifier;
 import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.internal.metadata.ReferencingServices;
 import org.apache.sis.internal.referencing.ExtentSelector;
@@ -42,6 +43,7 @@ import org.apache.sis.internal.util.Coll
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.util.CharSequences;
 import org.apache.sis.io.wkt.Formatter;
 
 import static org.apache.sis.util.Utilities.deepEquals;
@@ -466,6 +468,57 @@ public class DefaultGeodeticDatum extend
     }
 
     /**
+     * Returns {@code true} if either the {@linkplain #getName() primary name} or at least
+     * one {@linkplain #getAlias() alias} matches the given string according heuristic rules.
+     * This method implements the flexibility documented in the
+     * {@linkplain AbstractDatum#isHeuristicMatchForName(String) super-class}. In particular,
+     * this method ignores the prime meridian name if that name is found between parenthesis in the datum name.
+     * The meridian can be safely ignored in the datum name because the {@link PrimeMeridian} object is already
+     * compared by the {@link #equals(Object)} method.
+     *
+     * <div class="note"><b>Example:</b>
+     * if the datum name is <cite>"Nouvelle Triangulation Française (Paris)"</cite> and the prime meridian name is
+     * <cite>"Paris"</cite>, then this method compares only the <cite>"Nouvelle Triangulation Française"</cite> part.
+     * </div>
+     *
+     * <div class="section">Future evolutions</div>
+     * This method implements heuristic rules learned from experience while trying to provide inter-operability
+     * with different data producers. Those rules may be adjusted in any future SIS version according experience
+     * gained while working with more data producers.
+     *
+     * @param  name The name to compare.
+     * @return {@code true} if the primary name or at least one alias matches the specified {@code name}.
+     *
+     * @since 0.7
+     */
+    @Override
+    public boolean isHeuristicMatchForName(final String name) {
+        final String meridian = primeMeridian.getName().getCode();
+        return NameToIdentifier.isHeuristicMatchForName(super.getName(), super.getAlias(), name, new Simplifier() {
+            @Override protected CharSequence apply(CharSequence name) {
+                name = super.apply(name);
+                int lower = CharSequences.indexOf(name, meridian, 0, name.length()) - 1;
+                if (lower >= 0 && name.charAt(lower) == '(') {
+                    int upper = lower + meridian.length() + 1;
+                    if (upper < name.length() && name.charAt(upper) == ')') {
+                        lower = CharSequences.skipTrailingWhitespaces(name, 0, lower);
+                        while (lower > 0) {
+                            final int c = Character.codePointBefore(name, lower);
+                            if (Character.isLetterOrDigit(c)) {
+                                // Remove the meridian name only if it is not at the beginning of the name.
+                                name = new StringBuilder(name).delete(lower, upper+1).toString();
+                                break;
+                            }
+                            lower -= Character.charCount(c);
+                        }
+                    }
+                }
+                return name;
+            }
+        });
+    }
+
+    /**
      * Compare this datum with the specified object for equality.
      *
      * @param  object The object to compare to {@code this}.

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -45,13 +45,13 @@ import static org.apache.sis.referencing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
 @DependsOn({
-  DefaultPrimeMeridianTest.class,
-  DefaultEllipsoidTest.class,
-  BursaWolfParametersTest.class
+    DefaultPrimeMeridianTest.class,
+    DefaultEllipsoidTest.class,
+    BursaWolfParametersTest.class
 })
 public final strictfp class DefaultGeodeticDatumTest extends XMLTestCase {
     /**
@@ -104,13 +104,21 @@ public final strictfp class DefaultGeode
      */
     @Test
     public void testIsHeuristicMatchForName() {
-        final DefaultGeodeticDatum datum = new DefaultGeodeticDatum(GeodeticDatumMock.WGS84);
+        DefaultGeodeticDatum datum = new DefaultGeodeticDatum(GeodeticDatumMock.WGS84);
         assertFalse(datum.isHeuristicMatchForName("WGS72"));
         assertTrue (datum.isHeuristicMatchForName("WGS84"));
         assertTrue (datum.isHeuristicMatchForName("WGS 84"));
         assertTrue (datum.isHeuristicMatchForName("WGS_84"));
         assertTrue (datum.isHeuristicMatchForName("D_WGS_84"));
         assertFalse(datum.isHeuristicMatchForName("E_WGS_84"));
+
+        datum = HardCodedDatum.NTF;
+        assertFalse(datum.isHeuristicMatchForName("WGS84"));
+        assertTrue (datum.isHeuristicMatchForName("Nouvelle Triangulation Française"));
+        assertTrue (datum.isHeuristicMatchForName("Nouvelle Triangulation Francaise"));
+        assertTrue (datum.isHeuristicMatchForName("Nouvelle Triangulation Française (Paris)"));
+        assertTrue (datum.isHeuristicMatchForName("Nouvelle Triangulation Francaise (Paris)"));
+        assertFalse(datum.isHeuristicMatchForName("Nouvelle Triangulation Francaise (Greenwich)"));
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IO.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IO.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IO.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IO.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -46,8 +46,8 @@ public final class IO extends Static {
      * of wrappers defined in this package around a flushable object, invokes the
      * {@link Flushable#flush() flush()} method on that object. Otherwise do nothing.
      *
-     * <p>Chains of wrappers are followed until a {@code Flushable}
-     * instance is found, if any. The search stops at the first occurrence found.</p>
+     * <p>Chains of wrappers are followed until a {@code Flushable} instance is found, if any.
+     * The search stops at the first occurrence found.</p>
      *
      * @param  out The stream or buffer to flush, or {@code null}.
      * @throws IOException if an error occurred while flushing the given stream.
@@ -67,10 +67,10 @@ public final class IO extends Static {
      * of wrappers defined in this package around a closeable object, invokes the
      * {@link Closeable#close() close()} method on that object. Otherwise do nothing.
      *
-     * <p>Chains of wrappers are followed until a {@code Closeable}
-     * instance is found, if any. The first {@link Flushable} instance found <em>before</em> the
-     * {@code Closeable} one, if any, is {@linkplain Flushable#flush() flushed}. The search stops
-     * at the first {@code Closeable} occurrence found.</p>
+     * <p>Chains of wrappers are followed until a {@code Closeable} instance is found, if any.
+     * The first {@link Flushable} instance found <em>before</em> the {@code Closeable} one,
+     * if any, is {@linkplain Flushable#flush() flushed}.
+     * The search stops at the first {@code Closeable} occurrence found.</p>
      *
      * @param  out The stream or buffer to close, or {@code null}.
      * @throws IOException if an error occurred while closing the given stream.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Fri Feb 26 22:04:01 2016
@@ -474,6 +474,11 @@ public final class Errors extends Indexe
         public static final short IncompatibleDatum_2 = 186;
 
         /**
+         * Can not use the “{1}” format with “{0}”.
+         */
+        public static final short IncompatibleFormat_2 = 217;
+
+        /**
          * Property “{0}” has an incompatible value.
          */
         public static final short IncompatiblePropertyValue_1 = 45;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Fri Feb 26 22:04:01 2016
@@ -104,6 +104,7 @@ IllegalUnicodeCodePoint_2         = Valu
 IllegalUnitFor_2                  = Unit of measurement \u201c{1}\u201d is not valid for \u201c{0}\u201d values.
 IncompatibleCoordinateSystemTypes = Incompatible coordinate system types.
 IncompatibleDatum_2               = Datum of \u201c{1}\u201d shall be \u201c{0}\u201d.
+IncompatibleFormat_2              = Can not use the \u201c{1}\u201d format with \u201c{0}\u201d.
 IncompatiblePropertyValue_1       = Property \u201c{0}\u201d has an incompatible value.
 IncompatibleUnit_1                = Unit \u201c{0}\u201d is incompatible with current value.
 IncompatibleUnits_2               = Units \u201c{0}\u201d and \u201c{1}\u201d are incompatible.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1732567&r1=1732566&r2=1732567&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Fri Feb 26 22:04:01 2016
@@ -101,6 +101,7 @@ IllegalUnicodeCodePoint_2         = La v
 IllegalUnitFor_2                  = L\u2019unit\u00e9 de mesure \u00ab\u202f{1}\u202f\u00bb n\u2019est pas valide pour les valeurs de \u00ab\u202f{0}\u202f\u00bb.
 IncompatibleCoordinateSystemTypes = Types de syst\u00e8mes de coordonn\u00e9es incompatibles.
 IncompatibleDatum_2               = Le r\u00e9f\u00e9rentiel de \u00ab\u202f{1}\u202f\u00bb doit \u00eatre \u00ab\u202f{0}\u202f\u00bb.
+IncompatibleFormat_2              = Le format \u00ab\u202f{1}\u202f\u00bb ne s\u2019applique pas \u00e0 \u00ab\u202f{0}\u202f\u00bb.
 IncompatiblePropertyValue_1       = La valeur de la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est pas compatible.
 IncompatibleUnit_1                = L\u2019unit\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est pas compatible avec la valeur actuelle.
 IncompatibleUnits_2               = Les unit\u00e9s \u00ab\u202f{0}\u202f\u00bb et \u00ab\u202f{1}\u202f\u00bb ne sont pas compatibles.



Mime
View raw message