sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1832311 [1/2] - in /sis/trunk: ./ application/sis-console/ application/sis-console/src/main/artifact/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/ core/sis-...
Date Sat, 26 May 2018 13:28:52 GMT
Author: desruisseaux
Date: Sat May 26 13:28:52 2018
New Revision: 1832311

URL: http://svn.apache.org/viewvc?rev=1832311&view=rev
Log:
Merge from JDK8 branch.

Added:
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java
      - copied, changed from r1832303, sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java
    sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreResource.java
      - copied unchanged from r1832303, sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreResource.java
Modified:
    sis/trunk/   (props changed)
    sis/trunk/README
    sis/trunk/application/sis-console/pom.xml
    sis/trunk/application/sis-console/src/main/artifact/README
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Record.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/RecordSchemaSIS.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
    sis/trunk/core/sis-referencing-by-identifiers/pom.xml
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/epsg/DataScriptFormatter.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
    sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml
    sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties
    sis/trunk/src/main/javadoc/overview.html
    sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/URIDataStore.java
    sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
    sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java

Propchange: sis/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat May 26 13:28:52 2018
@@ -2,5 +2,5 @@
 /sis/branches/ISO-19115-3:1804459-1825252
 /sis/branches/JDK6:1394364-1758914
 /sis/branches/JDK7:1394913-1822221
-/sis/branches/JDK8:1584960-1831967
+/sis/branches/JDK8:1584960-1832303
 /sis/branches/JDK9:1773327-1803064

Modified: sis/trunk/README
URL: http://svn.apache.org/viewvc/sis/trunk/README?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/README (original)
+++ sis/trunk/README Sat May 26 13:28:52 2018
@@ -23,7 +23,7 @@ project logo are trademarks of The Apach
 Getting Started
 ===============
 
-SIS requires Java 7 and uses the Maven 3 <http://maven.apache.org/>
+SIS requires Java 8 and uses the Maven 3 <http://maven.apache.org/>
 build system. To build SIS, use the following command in this directory:
 
     mvn install

Modified: sis/trunk/application/sis-console/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/application/sis-console/pom.xml?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/application/sis-console/pom.xml (original)
+++ sis/trunk/application/sis-console/pom.xml Sat May 26 13:28:52 2018
@@ -161,6 +161,11 @@
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>

Modified: sis/trunk/application/sis-console/src/main/artifact/README
URL: http://svn.apache.org/viewvc/sis/trunk/application/sis-console/src/main/artifact/README?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/application/sis-console/src/main/artifact/README [UTF-8] (original)
+++ sis/trunk/application/sis-console/src/main/artifact/README [UTF-8] Sat May 26 13:28:52 2018
@@ -13,7 +13,7 @@ project logo are trademarks of The Apach
 Installation
 ============
 
-SIS is based on Java 7 and provided as a unique standalone JAR file.
+SIS is based on Java 8 and provided as a unique standalone JAR file.
 
 Unix
 ----

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java [UTF-8] Sat May 26 13:28:52 2018
@@ -98,7 +98,7 @@ public class IdentifierMapAdapter extend
     /**
      * An immutable empty instance.
      */
-    public static final IdentifierMap EMPTY = new IdentifierMapAdapter(Collections.<Identifier>emptySet());
+    public static final IdentifierMap EMPTY = new IdentifierMapAdapter(Collections.emptySet());
 
     /**
      * The identifiers to wrap in a map view.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java [UTF-8] Sat May 26 13:28:52 2018
@@ -66,6 +66,12 @@ public final class LegacyNamespaces {
     public static final String GMD = "http://www.isotc211.org/2005/gmd";
 
     /**
+     * The <code>{@value}</code> URL as an alias for {@link #GMI}.
+     * Was used in some XML files before a more official URL was set.
+     */
+    public static final String GMI_ALIAS = "http://www.isotc211.org/2005/gmi";
+
+    /**
      * The <code>{@value}</code> URL.
      * The usual prefix for this namespace is {@code "gmi"}.
      */

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Record.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Record.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Record.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Record.java [UTF-8] Sat May 26 13:28:52 2018
@@ -86,7 +86,9 @@ public class GO_Record extends PropertyT
      * @param  metadata  the unmarshalled metadata.
      */
     public final void setElement(final DefaultRecord metadata) {
-        this.metadata = metadata;
+        if (!metadata.getAttributes().isEmpty()) {
+            this.metadata = metadata;
+        }
     }
 
     /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java [UTF-8] Sat May 26 13:28:52 2018
@@ -86,7 +86,9 @@ public class GO_RecordType extends Prope
      * @param  metadata  the unmarshalled metadata.
      */
     public final void setElement(final DefaultRecordType metadata) {
-        this.metadata = metadata;
+        if (!metadata.getMembers().isEmpty()) {
+            this.metadata = metadata;
+        }
     }
 
     /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/RecordSchemaSIS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/RecordSchemaSIS.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/RecordSchemaSIS.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/RecordSchemaSIS.java [UTF-8] Sat May 26 13:28:52 2018
@@ -18,24 +18,43 @@ package org.apache.sis.internal.metadata
 
 import java.io.Serializable;
 import java.io.ObjectStreamException;
+import java.util.Collections;
+import org.opengis.util.InternationalString;
 import org.apache.sis.internal.util.Constants;
+import org.apache.sis.util.iso.DefaultRecordType;
 import org.apache.sis.util.iso.DefaultRecordSchema;
+import org.apache.sis.util.resources.Vocabulary;
 
 
 /**
  * The system-wide schema in the "SIS" namespace.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.7
+ * @version 1.0
  * @since   0.7
  * @module
  */
 @SuppressWarnings("serial")  // serialVersionUID not needed because of writeReplace().
-final class RecordSchemaSIS extends DefaultRecordSchema implements Serializable {
+public final class RecordSchemaSIS extends DefaultRecordSchema implements Serializable {
     /**
      * The schema used in SIS for creating records.
      */
-    static final DefaultRecordSchema INSTANCE = new RecordSchemaSIS();
+    public static final DefaultRecordSchema INSTANCE = new RecordSchemaSIS();
+
+    /**
+     * The type of record instances for holding a {@link String} value.
+     */
+    public static final DefaultRecordType STRING;
+
+    /**
+     * The type of record instances for holding a {@link Double} value.
+     */
+    public static final DefaultRecordType REAL;
+    static {
+        final InternationalString label = Vocabulary.formatInternational(Vocabulary.Keys.Value);
+        STRING = (DefaultRecordType) INSTANCE.createRecordType("CharacterSequence", Collections.singletonMap(label, String.class));
+        REAL   = (DefaultRecordType) INSTANCE.createRecordType("Real",              Collections.singletonMap(label, Double.class));
+    }
 
     /**
      * Creates the unique instance.
@@ -46,6 +65,9 @@ final class RecordSchemaSIS extends Defa
 
     /**
      * On serialization, returns a proxy which will be resolved as {@link #INSTANCE} on deserialization.
+     *
+     * @return the object to use after deserialization.
+     * @throws ObjectStreamException if the serialized object defines an unknown data type.
      */
     protected Object writeReplace() throws ObjectStreamException {
         return new Proxy();

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java [UTF-8] Sat May 26 13:28:52 2018
@@ -34,7 +34,7 @@ import org.apache.sis.util.Static;
  * Creates a record reporting coordinate transformation accuracy.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.7
  * @module
  */
@@ -46,13 +46,6 @@ public final class TransformationAccurac
             Vocabulary.formatInternational(Vocabulary.Keys.TransformationAccuracy);
 
     /**
-     * The type of record instances which will hold coordinate transformation accuracy values.
-     */
-    private static final RecordType TYPE = RecordSchemaSIS.INSTANCE.createRecordType("Real",
-            Collections.<CharSequence,Class<?>>singletonMap(
-                    Vocabulary.formatInternational(Vocabulary.Keys.Value), Double.class));
-
-    /**
      * Cache the positional accuracies. Most coordinate operation use a small set of accuracy values.
      */
     private static final WeakValueHashMap<Double,PositionalAccuracy> CACHE = new WeakValueHashMap<>(Double.class);
@@ -73,13 +66,14 @@ public final class TransformationAccurac
     public static PositionalAccuracy create(final Double accuracy) {
         PositionalAccuracy p = CACHE.get(accuracy);
         if (p == null) {
-            final DefaultRecord record = new DefaultRecord(TYPE);
+            final RecordType type = RecordSchemaSIS.REAL;
+            final DefaultRecord record = new DefaultRecord(type);
             record.setAll(accuracy);
 
             final DefaultQuantitativeResult result = new DefaultQuantitativeResult();
             result.setValues(Collections.singletonList(record));
             result.setValueUnit(Units.METRE);              // In metres by definition in the EPSG database.
-            result.setValueType(TYPE);
+            result.setValueType(type);
 
             final DefaultAbsoluteExternalPositionalAccuracy element =
                     new DefaultAbsoluteExternalPositionalAccuracy(result);

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] Sat May 26 13:28:52 2018
@@ -70,7 +70,7 @@ import org.apache.sis.util.logging.Loggi
  * All other methods are related to getting the {@code DataSource} instance, through JNDI or otherwise.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.7
  * @module
  */
@@ -422,9 +422,10 @@ public abstract class Initializer {
      * This message can be used for constructing an exception when {@link #getDataSource()} returned {@code null}.
      *
      * @param  locale  the locale for the message to produce, or {@code null} for the default one.
+     * @param  asLog   {@code true} for returning the message as a {@link LogRecord}, {@code false} for a {@link String}.
      * @return message for unspecified data source.
      */
-    public static String unspecified(final Locale locale) {
+    public static Object unspecified(final Locale locale, final boolean asLog) {
         final short key;
         final String value;
         if (hasJNDI()) {
@@ -434,7 +435,8 @@ public abstract class Initializer {
             key = Messages.Keys.DataDirectoryNotSpecified_1;
             value = DataDirectory.ENV;
         }
-        return Messages.getResources(locale).getString(key, value);
+        final Messages resources = Messages.getResources(locale);
+        return asLog ? resources.getLogRecord(Level.WARNING, key, value) : resources.getString(key, value);
     }
 
     /**
@@ -486,7 +488,7 @@ public abstract class Initializer {
      */
     private static DataSource forJavaDB(final String path, final ClassLoader loader) throws Exception {
         final Class<?> c = Class.forName("org.apache.derby.jdbc.EmbeddedDataSource", true, loader);
-        final DataSource ds = (DataSource) c.newInstance();
+        final DataSource ds = (DataSource) c.getConstructor().newInstance();
         final Class<?>[] args = {String.class};
         c.getMethod("setDatabaseName", args).invoke(ds, path);
         c.getMethod("setDataSourceName", args).invoke(ds, "Apache SIS spatial metadata");

Copied: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java (from r1832303, sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java?p2=sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java&p1=sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java&r1=1832303&r2=1832311&rev=1832311&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java [UTF-8] Sat May 26 13:28:52 2018
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.metadata.sql;
 
-import org.opengis.util.ControlledVocabulary;
+import org.opengis.util.CodeList;
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.internal.metadata.ServicesForUtility;
 import org.apache.sis.util.ArgumentChecks;
@@ -71,7 +71,7 @@ final class MetadataFallback extends Met
         ArgumentChecks.ensureNonNull("type", type);
         ArgumentChecks.ensureNonEmpty("identifier", identifier);
         Object value;
-        if (ControlledVocabulary.class.isAssignableFrom(type)) {
+        if (CodeList.class.isAssignableFrom(type)) {
             value = getCodeList(type, identifier);
         } else {
             value = null;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java [UTF-8] Sat May 26 13:28:52 2018
@@ -41,6 +41,7 @@ import java.sql.Connection;
 import java.sql.Statement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.sql.SQLTransientException;
 import java.sql.SQLNonTransientException;
 import java.sql.PreparedStatement;
 import org.opengis.annotation.UML;
@@ -108,7 +109,7 @@ import org.apache.sis.internal.geoapi.ev
  *
  * @author  Touraïvane (IRD)
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -287,12 +288,16 @@ public class MetadataSource implements A
     /**
      * The instance connected to the {@code "jdbc/SpatialMetadata"} database,
      * created when first needed and cleared when the classpath change.
+     * May be {@link MetadataFallback#INSTANCE} if we failed to establish
+     * a connection to the database for a non-transient reason.
      */
-    private static volatile MetadataSource instance;
+    private static MetadataSource instance;
     static {
         SystemListener.add(new SystemListener(Modules.METADATA) {
             @Override protected void classpathChanged() {
-                instance = null;
+                synchronized (MetadataSource.class) {
+                    instance = null;
+                }
             }
         });
     }
@@ -304,28 +309,51 @@ public class MetadataSource implements A
      * citations} and {@linkplain org.apache.sis.metadata.iso.distribution.DefaultFormat formats}
      * among others.
      *
+     * <p>If connection to the metadata database can not be established, then this method returns
+     * a fallback with a few hard-coded values.</p>
+     *
      * @return source of pre-defined metadata records from the {@code "jdbc/SpatialMetadata"} database.
-     * @throws MetadataStoreException if this method can not connect to the database.
      */
-    public static MetadataSource getProvided() throws MetadataStoreException {
+    public static synchronized MetadataSource getProvided() {
         MetadataSource ms = instance;
         if (ms == null) {
-            final DataSource dataSource;
+            LogRecord warning = null;
+            boolean isTransient = false;
             try {
-                dataSource = Initializer.getDataSource();
-            } catch (Exception e) {
-                throw new MetadataStoreException(Errors.format(Errors.Keys.CanNotConnectTo_1, Initializer.JNDI), e);
-            }
-            if (dataSource == null) {
-                throw new MetadataStoreException(Initializer.unspecified(null));
-            }
-            synchronized (MetadataSource.class) {
-                ms = instance;
-                if (ms == null) {
+                final DataSource dataSource = Initializer.getDataSource();
+                if (dataSource != null) {
                     ms = new MetadataSource(MetadataStandard.ISO_19115, dataSource, "metadata", null);
                     ms.install();
-                    instance = ms;
+                } else {
+                    warning = (LogRecord) Initializer.unspecified(null, true);
+                    ms = MetadataFallback.INSTANCE;
                 }
+            } catch (Exception e) {
+                ms = MetadataFallback.INSTANCE;
+                /*
+                 * Derby sometime wraps SQLException into another SQLException.  For making the stack strace a
+                 * little bit simpler, keep only the root cause provided that the exception type is compatible.
+                 */
+                warning = Errors.getResources((Locale) null).getLogRecord(Level.WARNING, Errors.Keys.CanNotConnectTo_1, Initializer.JNDI);
+                warning.setThrown(Exceptions.unwrap(e));
+                /*
+                 * If the error is transient or has a transient cause, we will not save MetadataFallback.INSTANCE
+                 * in the 'instance' field. The intent is to try again next time this method will be invoked, in
+                 * case the transient error has disappeared.
+                 */
+                for (Throwable cause = e; cause != null; cause = cause.getCause()) {
+                    if (cause instanceof SQLTransientException) {
+                        isTransient = true;
+                        break;
+                    }
+                }
+            }
+            if (warning != null) {
+                warning.setLoggerName(Loggers.SYSTEM);
+                Logging.log(MetadataSource.class, "getProvided", warning);
+            }
+            if (!isTransient) {
+                instance = ms;
             }
         }
         return ms;
@@ -401,6 +429,21 @@ public class MetadataSource implements A
     }
 
     /**
+     * For {@link MetadataFallback} constructor only.
+     */
+    MetadataSource() {
+        standard     = MetadataStandard.ISO_19115;
+        dataSource   = null;
+        catalog      = null;
+        statements   = null;
+        tableColumns = null;
+        classloader  = getClass().getClassLoader();
+        pool         = null;
+        lastUsed     = null;
+        listeners    = null;
+    }
+
+    /**
      * If the metadata schema does not exist in the database, creates it and inserts the pre-defined metadata values.
      * The current implementation has the following restrictions:
      *
@@ -412,32 +455,24 @@ public class MetadataSource implements A
      * Maintenance note: this method is invoked by reflection in {@code non-free:sis-embedded-data} module.
      * If we make this method public in a future Apache SIS version, then we can remove the reflection code.
      *
-     * @throws MetadataStoreException if an error occurred while inserting the metadata.
+     * @throws SQLException if an error occurred while inserting the metadata.
      */
-    final synchronized void install() throws MetadataStoreException {
-        try {
-            final Connection connection = connection();
-            final DatabaseMetaData md = connection.getMetaData();
-            if (md.storesUpperCaseIdentifiers()) {
-                schema = schema.toUpperCase(Locale.US);
-            } else if (md.storesLowerCaseIdentifiers()) {
-                schema = schema.toLowerCase(Locale.US);
-            }
-            quoteSchema = false;
-            try (ResultSet result = md.getTables(catalog, schema, "CI_Citation", null)) {
-                if (result.next()) {
-                    return;
-                }
-            }
-            final Installer installer = new Installer(connection);
-            installer.run();
-        } catch (IOException | SQLException e) {
-            /*
-             * Derby sometime wraps SQLException into another SQLException.  For making the stack strace a
-             * little bit simpler, keep only the root cause provided that the exception type is compatible.
-             */
-            throw new MetadataStoreException(e.getLocalizedMessage(), Exceptions.unwrap(e));
+    final synchronized void install() throws IOException, SQLException {
+        final Connection connection = connection();
+        final DatabaseMetaData md = connection.getMetaData();
+        if (md.storesUpperCaseIdentifiers()) {
+            schema = schema.toUpperCase(Locale.US);
+        } else if (md.storesLowerCaseIdentifiers()) {
+            schema = schema.toLowerCase(Locale.US);
+        }
+        quoteSchema = false;
+        try (ResultSet result = md.getTables(catalog, schema, "CI_Citation", null)) {
+            if (result.next()) {
+                return;
+            }
         }
+        final Installer installer = new Installer(connection);
+        installer.run();
     }
 
     /**
@@ -841,7 +876,7 @@ public class MetadataSource implements A
                 final Class<?> subType = subType(type, identifier);
                 final Dispatcher toSearch = new Dispatcher(identifier, this);
                 try {
-                    value = subType.newInstance();
+                    value = subType.getConstructor().newInstance();
                     final LookupInfo info            = getLookupInfo(subType);
                     final Map<String,Object> map     = asValueMap(value);
                     final Map<String,String> methods = standard.asNameMap(subType, NAME_POLICY, KeyNamePolicy.METHOD_NAME);
@@ -986,7 +1021,7 @@ public class MetadataSource implements A
      * message when the actual class is unknown (it must have been checked dynamically by the caller however).
      */
     @SuppressWarnings("unchecked")
-    private static CodeList<?> getCodeList(final Class<?> type, final String name) {
+    static CodeList<?> getCodeList(final Class<?> type, final String name) {
         return Types.forCodeName(type.asSubclass(CodeList.class), name, true);
     }
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] Sat May 26 13:28:52 2018
@@ -22,9 +22,11 @@ import java.util.AbstractMap;
 import java.util.AbstractSet;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+import java.util.Collections;
 import java.util.Objects;
 import java.io.Serializable;
 import java.lang.reflect.Array;
+import javax.xml.bind.annotation.XmlValue;
 import org.opengis.util.MemberName;
 import org.opengis.util.Record;
 import org.opengis.util.RecordType;
@@ -33,6 +35,7 @@ import org.apache.sis.util.Utilities;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.AbstractMapEntry;
+import org.apache.sis.internal.metadata.RecordSchemaSIS;
 
 
 /**
@@ -69,23 +72,16 @@ public class DefaultRecord implements Re
     private static final long serialVersionUID = -5293250754663538325L;
 
     /**
-     * The type definition of this record.
+     * The type definition of this record. Can not be {@code null}.
      */
     final RecordDefinition definition;
 
     /**
      * The record values in an array. May be an array of primitive type for compactness,
-     * which is why the type is not {@code Object[]}.
+     * which is why the type is not {@code Object[]}. Should never be {@code null}, except
+     * temporarily during XML unmarshalling.
      */
-    private final Object values;
-
-    /**
-     * Constructs an initially empty record. Used by JAXB.
-     */
-    private DefaultRecord() {
-        definition = null;
-        values = null;
-    }
+    private Object values;
 
     /**
      * Creates a new record for the given record type.
@@ -170,8 +166,7 @@ public class DefaultRecord implements Re
      */
     @Override
     public RecordType getRecordType() {
-        // Should never be null, unless temporarily during unmarshalling.
-        return (definition != null) ? definition.getRecordType() : null;
+        return definition.getRecordType();
     }
 
     /**
@@ -185,6 +180,9 @@ public class DefaultRecord implements Re
      */
     @Override
     public Map<MemberName, Object> getAttributes() {
+        if (values == null) {                         // Should never be null, except temporarily at XML unmarshalling time.
+            return Collections.emptyMap();
+        }
         return new AbstractMap<MemberName, Object>() {
             /** Returns the number of members in the record. */
             @Override
@@ -397,4 +395,63 @@ public class DefaultRecord implements Re
     public String toString() {
         return definition.toString("Record", values);
     }
+
+
+
+
+    //////////////////////////////////////////////////////////////////////////////////////////////////
+    ////////                                                                                  ////////
+    ////////                               XML support with JAXB                              ////////
+    ////////                                                                                  ////////
+    ////////        The following methods are invoked by JAXB using reflection (even if       ////////
+    ////////        they are private) or are helpers for other methods invoked by JAXB.       ////////
+    ////////        Those methods can be safely removed if Geographic Markup Language         ////////
+    ////////        (GML) support is not needed.                                              ////////
+    ////////                                                                                  ////////
+    //////////////////////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Constructs an initially empty record expecting exactly one value as a string.
+     * See {@link #setValue(String)} for a description of the supported XML content.
+     */
+    private DefaultRecord() {
+        definition = RecordSchemaSIS.STRING;
+    }
+
+    /**
+     * Returns the record value as a string.
+     */
+    @XmlValue
+    private String getValue() {
+        if (values != null) {
+            switch (Array.getLength(values)) {
+                case 0:  break;
+                case 1:  return String.valueOf(Array.get(values, 0));
+                default: return definition.toString(null, values);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Sets the record value as a string. This method is invoked at unmarshalling time.
+     * A record can be anything, but usages that we have seen so far write a character
+     * sequence or a code list. Examples:
+     *
+     * {@preformat xml
+     *    <gco:Record>Alphanumeric values: Product is alphanumeric.</gco:Record>
+     *    <gco:Record>Alphanumeric Text: Message contains alphanumeric text.</gco:Record>
+     *    <gco:Record>Part A: Reflectivity presented as a tabular listing of alphanumerics.</gco:Record>
+     *    <gco:Record>
+     *      <gmd:CodeListValue codelist="someURL#DataQualityAssessment" codeListValue="intermediate">intermediate</gmd:CodeListValue>
+     *    </gco:Record>
+     * }
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-419">SIS-419</a>
+     */
+    private void setValue(String value) {
+        if (value != null && !(value = value.trim()).isEmpty()) {
+            values = new String[] {value};
+        }
+    }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java [UTF-8] Sat May 26 13:28:52 2018
@@ -27,6 +27,7 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.InvalidObjectException;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
 import org.opengis.util.Type;
 import org.opengis.util.TypeName;
 import org.opengis.util.LocalName;
@@ -36,11 +37,13 @@ import org.opengis.util.NameSpace;
 import org.opengis.util.Record;
 import org.opengis.util.RecordType;
 import org.opengis.util.RecordSchema;
+import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.collection.Containers;
 import org.apache.sis.util.ObjectConverters;
 import org.apache.sis.internal.converter.SurjectiveConverter;
+import org.apache.sis.internal.metadata.RecordSchemaSIS;
 
 
 /**
@@ -85,7 +88,7 @@ import org.apache.sis.internal.converter
  * so users wanting serialization may need to provide their own schema.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.5
+ * @version 1.0
  *
  * @see DefaultRecord
  * @see DefaultRecordSchema
@@ -443,11 +446,56 @@ public class DefaultRecordType extends R
     //////////////////////////////////////////////////////////////////////////////////////////////////
 
     /**
-     * Empty constructor only used by JAXB.
+     * Constructs an initially empty type describing exactly one value as a string.
+     * See {@link #setValue(String)} for a description of the supported XML content.
      */
     @SuppressWarnings("unused")
     private DefaultRecordType() {
-        typeName  = null;
-        container = null;
+        final DefaultRecordType type = RecordSchemaSIS.STRING;
+        typeName  = type.typeName;
+        container = type.container;
+    }
+
+    /**
+     * Returns the record type value as a string. Current implementation returns the members with
+     * one member per line, but it may change in any future version for adapting to common practice.
+     */
+    @XmlValue
+    private String getValue() {
+        switch (size()) {
+            case 0:  return null;
+            case 1:  return String.valueOf(memberTypes[0]);
+            default: return toString(null, null);
+        }
+    }
+
+    /**
+     * Sets the record type value as a string. Current implementation expect one member per line.
+     * A record can be anything, but usages that we have seen so far write a character sequence
+     * of what seems <var>key</var>-<var>description</var> pairs. Examples:
+     *
+     * {@preformat xml
+     *   <gco:RecordType>
+     *     General Meteorological Products: General products include the baseline reflectivity and velocity,
+     *     and also algorithmic graphic products spectrum width, vertical integrated liquid, and VAD wind profile.
+     *   </gco:RecordType>
+     * }
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-419">SIS-419</a>
+     */
+    private void setValue(final String value) {
+        if (value != null) {
+            final Map<MemberName,Type> members = new LinkedHashMap<>();
+            for (CharSequence element : CharSequences.splitOnEOL(value)) {
+                final int s = ((String) element).indexOf(':');
+                if (s >= 0) {
+                    element = element.subSequence(0, CharSequences.skipTrailingWhitespaces(element, 0, s));
+                    // TODO: the part after ":" is the description. For now, we have no room for storing it.
+                }
+                final MemberName m = Names.createMemberName(null, null, element, String.class);
+                members.put(m, RecordSchemaSIS.INSTANCE.toAttributeType(String.class));
+            }
+            memberTypes = computeTransientFields(members);
+        }
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java [UTF-8] Sat May 26 13:28:52 2018
@@ -48,7 +48,7 @@ import org.apache.sis.internal.simple.Si
  * {@link #computeTransientFields(Map)}.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @version 1.0
  * @since   0.5
  * @module
  */
@@ -233,7 +233,7 @@ abstract class RecordDefinition {
     /**
      * Returns a string representation of a {@code Record} or {@code RecordType}.
      *
-     * @param  head    either {@code "Record"} or {@code "RecordType"}.
+     * @param  head    either {@code "Record"} or {@code "RecordType"} or {@code null}.
      * @param  values  the values as an array, or {@code null} for writing the types instead.
      * @return the string representation.
      */
@@ -241,20 +241,30 @@ abstract class RecordDefinition {
         final StringBuilder buffer = new StringBuilder(250);
         final String lineSeparator = System.lineSeparator();
         final String[] names = new String[size()];
+        final String margin;
         int width = 0;
-        buffer.append(head).append("[“").append(getRecordType().getTypeName()).append("”] {").append(lineSeparator);
         for (int i=0; i<names.length; i++) {
             width = Math.max(width, (names[i] = members[i].toString()).length());
         }
+        if (head == null) {
+            width  = 0;         // Ignore the width computation, but we still need the names in the array.
+            margin = "";
+        } else {
+            buffer.append(head).append("[“").append(getRecordType().getTypeName()).append("”] {").append(lineSeparator);
+            margin = "    ";
+        }
         for (int i=0; i<names.length; i++) {
             final String name = names[i];
-            buffer.append("    ").append(name);
+            buffer.append(margin).append(name);
             final Object value = (values != null) ? Array.get(values, i) : members[i].getAttributeType();
             if (value != null) {
                 buffer.append(CharSequences.spaces(width - name.length())).append(" : ").append(value);
             }
             buffer.append(lineSeparator);
         }
-        return buffer.append('}').append(lineSeparator).toString();
+        if (head != null) {
+            buffer.append('}').append(lineSeparator);
+        }
+        return buffer.toString();
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java [UTF-8] Sat May 26 13:28:52 2018
@@ -77,9 +77,10 @@ final class TransformVersion {
          * this rule is the "gco" namespace, because our reader renames only element namespaces while we need to
          * rename also attributes in "gco" namespace (e.g. "gco:nilReason").
          */
-        ISO19139.addSurjective(Namespaces.SRV, LegacyNamespaces.SRV);
-        ISO19139.addSurjective(Namespaces.GCX, LegacyNamespaces.GMX);
-        ISO19139.addBijective (Namespaces.GCO, LegacyNamespaces.GCO);
+        ISO19139.addSurjective (Namespaces.SRV, LegacyNamespaces.SRV);
+        ISO19139.addSurjective (Namespaces.GCX, LegacyNamespaces.GMX);
+        ISO19139.addBijective  (Namespaces.GCO, LegacyNamespaces.GCO);
+        ISO19139.addAlias(LegacyNamespaces.GMI, LegacyNamespaces.GMI_ALIAS);
     }
 
     /**
@@ -141,6 +142,14 @@ final class TransformVersion {
     }
 
     /**
+     * Adds a namespace to be considered as an alias of another namespace.
+     * The aliases are usually non-official URL and should not be used in exports.
+     */
+    private void addAlias(final String standard, final String alias) {
+        imports.put(alias, standard);
+    }
+
+    /**
      * Adds a two-directional association between a namespace used in JAXB annotation and a namespace
      * used in XML document. A bijective association means that the renaming is reversible.
      */

Modified: sis/trunk/core/sis-referencing-by-identifiers/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing-by-identifiers/pom.xml?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing-by-identifiers/pom.xml (original)
+++ sis/trunk/core/sis-referencing-by-identifiers/pom.xml Sat May 26 13:28:52 2018
@@ -135,6 +135,11 @@
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] Sat May 26 13:28:52 2018
@@ -268,7 +268,7 @@ public class EPSGFactory extends Concurr
         if (ds == null) try {
             ds = Initializer.getDataSource();
             if (ds == null) {
-                throw new UnavailableFactoryException(Initializer.unspecified(locale));
+                throw new UnavailableFactoryException(String.valueOf(Initializer.unspecified(locale, false)));
             }
         } catch (Exception e) {
             throw new UnavailableFactoryException(canNotUse(e), e);

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java [UTF-8] Sat May 26 13:28:52 2018
@@ -134,7 +134,7 @@ public final strictfp class AbstractIden
      */
     @Test
     public void testWithoutIdentifier() {
-        final Set<ReferenceIdentifier> identifiers = Collections.<ReferenceIdentifier>emptySet();
+        final Set<ReferenceIdentifier> identifiers = Collections.emptySet();
         final AbstractIdentifiedObject object      = new AbstractIdentifiedObject(properties(identifiers));
         final ReferenceIdentifier      gmlId       = validate(object, identifiers, "GRS1980");
         assertNull("gmlId", gmlId);

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/epsg/DataScriptFormatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/epsg/DataScriptFormatter.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/epsg/DataScriptFormatter.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/epsg/DataScriptFormatter.java [UTF-8] Sat May 26 13:28:52 2018
@@ -38,6 +38,8 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.internal.metadata.sql.ScriptRunner;
 import org.apache.sis.internal.metadata.sql.TestDatabase;
 
+import static org.junit.Assert.assertEquals;
+
 
 /**
  * Rewrites the {@code INSERT TO ...} statements in a SQL script in a more compact form.
@@ -46,7 +48,7 @@ import org.apache.sis.internal.metadata.
  * The steps to follow are documented in the {@code package.html} file.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.7
  * @module
  */
@@ -189,13 +191,42 @@ public final class DataScriptFormatter e
 
     /**
      * EPSG scripts version 8.9 seems to have 2 errors where the {@code OBJECT_TABLE_NAME} column contains
-     * {@code "AxisName"} instead of {@code "Coordinate Axis Name"}.
+     * {@code "AxisName"} instead of {@code "Coordinate Axis Name"}. Furthermore the version number noted
+     * in the history table is a copy-and-paste error.
      */
     @Override
     @Workaround(library="EPSG", version="8.9")
-    protected void editText(final StringBuilder sql, int lower, final int upper) {
-        if (upper - lower == 10 && CharSequences.regionMatches(sql, ++lower, "AxisName")) {
-            sql.replace(lower, upper-1, "Coordinate Axis Name");
+    protected void editText(final StringBuilder sql, int lower, int upper) {
+        final String table;         // Name of the table where to replace a value.
+        final String before;        // String that must exist before the value to replace, or null if none.
+        final String oldValue;      // The old value to replace.
+        final String newValue;      // The new value.
+        switch (upper - lower) {    // Optimization for reducing the amount of comparison.
+            default: return;
+            case 10: {
+                table    = "epsg_deprecation";
+                before   = null;
+                oldValue = "AxisName";
+                newValue = "Coordinate Axis Name";
+                break;
+            }
+            case 38: {
+                table    = "epsg_versionhistory";
+                before   = "'8.9'";
+                oldValue = "Version 8.8 full release of Dataset.";
+                newValue = "Version 8.9 full release of Dataset.";
+                break;
+            }
+        }
+        if (CharSequences.regionMatches(sql, ++lower, oldValue) &&
+            CharSequences.regionMatches(sql, 0, "INSERT INTO " + table + " VALUES"))
+        {
+            assertEquals("oldValue.length", oldValue.length(), --upper - lower);
+            if (before != null) {
+                final int i = sql.indexOf(before);
+                if (i < 0 || i >= lower) return;
+            }
+            sql.replace(lower, upper, newValue);
         }
     }
 

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] Sat May 26 13:28:52 2018
@@ -217,7 +217,7 @@ public final class CollectionsExt extend
      * @return the given collection, or an empty set if the given collection was null.
      */
     public static <E> Collection<E> nonNull(final Collection<E> c) {
-        return (c != null) ? c : Collections.<E>emptySet();
+        return (c != null) ? c : Collections.emptySet();
     }
 
     /**
@@ -228,7 +228,7 @@ public final class CollectionsExt extend
      * @return the given collection, or an empty set if the given collection was null.
      */
     public static <E> Set<E> nonNull(final Set<E> c) {
-        return (c != null) ? c : Collections.<E>emptySet();
+        return (c != null) ? c : Collections.emptySet();
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] Sat May 26 13:28:52 2018
@@ -38,7 +38,7 @@ import static java.lang.Math.abs;
  */
 public final class Numerics extends Static {
     /**
-     * Some frequently used {@link Double} values. As of Java 7, those values do not
+     * Some frequently used {@link Double} values. As of Java 8, those values do not
      * seem to be cached by {@link Double#valueOf(double)} like JDK does for integers.
      */
     private static final Map<Object,Object> CACHE = new HashMap<>(32);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java [UTF-8] Sat May 26 13:28:52 2018
@@ -166,7 +166,7 @@ public class DefaultTreeTable implements
             ArgumentChecks.ensureNonNullElement("columns", i, column);
             final Integer pos = i;
             if (map == null) {
-                map = Collections.<TableColumn<?>,Integer>singletonMap(column, pos);
+                map = Collections.singletonMap(column, pos);
             } else if (map.put(column, pos) != null) {
                 throw new IllegalArgumentException(Errors.format(Errors.Keys.DuplicatedIdentifier_1, column));
             }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java?rev=1832311&r1=1832310&r2=1832311&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] Sat May 26 13:28:52 2018
@@ -164,8 +164,7 @@ public class TableColumn<V> implements C
      * A map containing only the {@link #NAME} column.
      * This is the default set of columns when parsing a tree table.
      */
-    static final Map<TableColumn<?>,Integer> NAME_MAP =
-            Collections.<TableColumn<?>,Integer>singletonMap(NAME, 0);
+    static final Map<TableColumn<?>,Integer> NAME_MAP = Collections.singletonMap(NAME, 0);
 
     /**
      * Base type of all values in the column identified by this {@code ColumnTable} instance.



Mime
View raw message