sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1829670 [4/4] - in /sis/trunk: ./ application/sis-console/ application/sis-console/src/test/java/org/apache/sis/console/ application/sis-openoffice/ core/sis-build-helper/ core/sis-feature/ core/sis-feature/src/main/java/org/apache/sis/int...
Date Fri, 20 Apr 2018 16:18:09 GMT
Copied: sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml~ (from r1829667, sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml)
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml%7E?p2=sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml%7E&p1=sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml&r1=1829667&r2=1829670&rev=1829670&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml~ Fri Apr 20 16:18:08 2018
@@ -28,9 +28,9 @@ is divided into following sections:
         </condition>
     </fail>
     <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
-    <!-- 
+    <!--
                 ======================
-                INITIALIZATION SECTION 
+                INITIALIZATION SECTION
                 ======================
             -->
     <target name="-pre-init">

Modified: sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] Fri Apr 20 16:18:08 2018
@@ -3,6 +3,6 @@
 build.xml.data.CRC32=58e6b21c
 build.xml.script.CRC32=462eaba0
 build.xml.stylesheet.CRC32=28e38971@1.53.1.46
-nbproject/build-impl.xml.data.CRC32=c584eed6
-nbproject/build-impl.xml.script.CRC32=b935247d
-nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.88.0.48
+nbproject/build-impl.xml.data.CRC32=475f2d8e
+nbproject/build-impl.xml.script.CRC32=f9f78f49
+nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48

Modified: sis/trunk/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.properties?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Fri Apr 20 16:18:08 2018
@@ -62,6 +62,8 @@ src.netcdf.dir       = ${project.root}/s
 test.netcdf.dir      = ${project.root}/storage/sis-netcdf/src/test/java
 src.shapefile.dir    = ${project.root}/storage/sis-shapefile/src/main/java
 test.shapefile.dir   = ${project.root}/storage/sis-shapefile/src/test/java
+src.sql.dir          = ${project.root}/storage/sis-sql/src/main/java
+test.sql.dir         = ${project.root}/storage/sis-sql/src/test/java
 src.xmlstore.dir     = ${project.root}/storage/sis-xmlstore/src/main/java
 test.xmlstore.dir    = ${project.root}/storage/sis-xmlstore/src/test/java
 src.gdal.dir         = ${project.root}/storage/sis-gdal/src/main/java
@@ -94,7 +96,8 @@ test.fra-profile.dir = ${project.root}/p
 geoapi.version       = 3.0.1
 jsr363.version       = 1.0
 jama.version         = 1.0.3
-geometry.version     = 2.0.0
+esri.api.version     = 2.1.0
+jts.version          = 1.15.0
 georss.version       = 0.9.8
 rome.version         = 0.9
 jdom1.version        = 1.0
@@ -123,7 +126,8 @@ endorsed.classpath=
 javac.classpath=\
     ${maven.repository}/org/opengis/geoapi/${geoapi.version}/geoapi-${geoapi.version}.jar:\
     ${maven.repository}/javax/measure/unit-api/${jsr363.version}/unit-api-${jsr363.version}.jar:\
-    ${maven.repository}/com/esri/geometry/esri-geometry-api/${geometry.version}/esri-geometry-api-${geometry.version}.jar:\
+    ${maven.repository}/com/esri/geometry/esri-geometry-api/${esri.api.version}/esri-geometry-api-${esri.api.version}.jar:\
+    ${maven.repository}/org/locationtech/jts/jts-core/${jts.version}/jts-core-${jts.version}.jar:\
     ${maven.repository}/org/geonames/georss-rome/${georss.version}/georss-rome-${georss.version}.jar:\
     ${maven.repository}/rome/rome/${rome.version}/rome-${rome.version}.jar:\
     ${maven.repository}/jdom/jdom/${jdom1.version}/jdom-${jdom1.version}.jar:\

Modified: sis/trunk/ide-project/NetBeans/nbproject/project.xml
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.xml (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.xml Fri Apr 20 16:18:08 2018
@@ -31,6 +31,7 @@
                 <root id="src.geotiff.dir" name="GeoTIFF"/>
                 <root id="src.netcdf.dir" name="NetCDF"/>
                 <root id="src.shapefile.dir" name="Shapefile"/>
+                <root id="src.sql.dir" name="SQL"/>
                 <root id="src.xmlstore.dir" name="XMLStore"/>
                 <root id="src.storage.dir" name="Storage"/>
                 <root id="src.feature.dir" name="Feature"/>
@@ -51,6 +52,7 @@
                 <root id="test.geotiff.dir" name="Test GeoTIFF"/>
                 <root id="test.netcdf.dir" name="Test NetCDF"/>
                 <root id="test.shapefile.dir" name="Test Shapefile"/>
+                <root id="test.sql.dir" name="Test SQL"/>
                 <root id="test.xmlstore.dir" name="Test XMLStore"/>
                 <root id="test.storage.dir" name="Test Storage"/>
                 <root id="test.feature.dir" name="Test Feature"/>

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Fri Apr 20 16:18:08 2018
@@ -44,19 +44,17 @@
   <name>Apache SIS</name>
   <url>http://sis.apache.org</url>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Apache SIS is a free software, Java language library for developing geospatial applications.
- SIS provides data structures for geographic data and associated metadata along with methods
- to manipulate those data structures. The SIS metadata module forms the base of the library
- and enables the creation of metadata objects which comply with the ISO 19115 metadata model
- and which can be read from or written to ISO 19115-3 compliant XML documents.
- The SIS referencing module will enable the construction of geodetic data structures for
- geospatial referencing based on the ISO 19111 model such as axis, projection and coordinate
- reference system definitions, along with the associated operations which enable the mathematical
- conversion of coordinates between different systems of reference.
- The SIS storage modules will provide a common approach to the reading and writing of grid coverages
- applicable to simple imagery as to many dimensional data structures.
+    Apache SIS is a free software, Java language library for developing geospatial applications.
+    SIS provides data structures for geographic data and associated metadata along with methods
+    to manipulate those data structures. The SIS metadata module forms the base of the library
+    and enables the creation of metadata objects which comply with the ISO 19115 metadata model
+    and which can be read from or written to ISO 19115-3 compliant XML documents.
+    The SIS referencing module will enable the construction of geodetic data structures for
+    geospatial referencing based on the ISO 19111 model such as axis, projection and coordinate
+    reference system definitions, along with the associated operations which enable the mathematical
+    conversion of coordinates between different systems of reference.
+    The SIS storage modules will provide a common approach to the reading and writing of grid coverages
+    applicable to simple imagery as to many dimensional data structures.
   </description>
   <inceptionYear>2010</inceptionYear>
 
@@ -417,7 +415,13 @@ Apache SIS is a free software, Java lang
       <dependency>
         <groupId>com.esri.geometry</groupId>
         <artifactId>esri-geometry-api</artifactId>
-        <version>2.0.0</version>
+        <version>2.1.0</version>
+        <optional>true</optional>
+      </dependency>
+      <dependency>
+        <groupId>org.locationtech.jts</groupId>
+        <artifactId>jts-core</artifactId>
+        <version>1.15.0</version>
         <optional>true</optional>
       </dependency>
       <dependency>
@@ -628,7 +632,7 @@ Apache SIS is a free software, Java lang
            INDEX.LIST file is incomplete (which seem to happen in practice). -->
       <plugin>
         <artifactId>maven-jar-plugin</artifactId>
-        <version>3.0.2</version>        <!-- For https://issues.apache.org/jira/browse/MJAR-223 bug fix. -->
+        <version>3.1.0</version>
         <configuration>
           <archive>
             <addMavenDescriptor>false</addMavenDescriptor>
@@ -643,6 +647,7 @@ Apache SIS is a free software, Java lang
               <Specification-Title>GeoAPI</Specification-Title>
               <Specification-Version>${geoapi.version}</Specification-Version>
               <Specification-Vendor>Open Geospatial Consortium</Specification-Vendor>
+              <Implementation-URL>http://sis.apache.org/</Implementation-URL>
             </manifestEntries>
           </archive>
           <skipIfEmpty>true</skipIfEmpty>
@@ -669,20 +674,6 @@ Apache SIS is a free software, Java lang
         </executions>
       </plugin>
 
-      <!-- Package as OSGi bundle -->
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>3.5.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <excludeDependencies>true</excludeDependencies>
-          <instructions>
-            <Bundle-DocURL>${project.url}</Bundle-DocURL>
-          </instructions>
-        </configuration>
-      </plugin>
-
       <!-- Checkstype configuration
            Legal note: Checkstyle is under LGPL license, but it is okay to use it only for
            the build if it is downloaded by Maven (not included in Apache SIS distribution).

Modified: sis/trunk/profiles/sis-french-profile/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/profiles/sis-french-profile/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/profiles/sis-french-profile/pom.xml (original)
+++ sis/trunk/profiles/sis-french-profile/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.profiles</groupId>
   <artifactId>sis-french-profile</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS French profiles</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Extensions to ISO-19115 metadata mandated by the French government.
+    Extensions to ISO-19115 metadata mandated by the French government.
   </description>
 
 
@@ -92,13 +89,16 @@ Extensions to ISO-19115 metadata mandate
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.metadata.fra</Bundle-SymbolicName>
-            <Export-Package>*</Export-Package>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.metadata.fra
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
     </plugins>

Modified: sis/trunk/storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/pom.xml (original)
+++ sis/trunk/storage/pom.xml Fri Apr 20 16:18:08 2018
@@ -160,6 +160,7 @@
   <modules>
     <module>sis-storage</module>
     <module>sis-shapefile</module>
+    <module>sis-sql</module>
     <module>sis-netcdf</module>
     <module>sis-geotiff</module>
     <module>sis-xmlstore</module>

Modified: sis/trunk/storage/sis-earth-observation/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/pom.xml (original)
+++ sis/trunk/storage/sis-earth-observation/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.storage</groupId>
   <artifactId>sis-earth-observation</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS Earth Observation storage</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Landsat and MODIS metadata files to ISO 19115 metadata.
+    Landsat and MODIS metadata files to ISO 19115 metadata.
   </description>
 
 
@@ -103,12 +100,16 @@ Landsat and MODIS metadata files to ISO
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.storage.earthobservation</Bundle-SymbolicName>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.storage.earthobservation
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
     </plugins>

Modified: sis/trunk/storage/sis-gdal/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-gdal/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-gdal/pom.xml (original)
+++ sis/trunk/storage/sis-gdal/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.storage</groupId>
   <artifactId>sis-gdal</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS bindings for Proj4</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Referencing services from Proj4 through GeoAPI interfaces.
+    Referencing services from Proj4 through GeoAPI interfaces.
   </description>
 
 
@@ -79,12 +76,16 @@ Referencing services from Proj4 through
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.storage.gdal</Bundle-SymbolicName>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.storage.gdal
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
     </plugins>

Modified: sis/trunk/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java [UTF-8] (original)
+++ sis/trunk/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -60,6 +60,7 @@ import org.apache.sis.util.resources.Err
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Classes;
+import org.apache.sis.measure.Latitude;
 import org.apache.sis.measure.Units;
 
 
@@ -77,7 +78,7 @@ import org.apache.sis.measure.Units;
  * Other methods delegate to one of above-cited methods if possible, or throw a {@link FactoryException} otherwise.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -439,6 +440,15 @@ public class Proj4Factory extends Geodet
     public MathTransform createParameterizedTransform(final ParameterValueGroup parameters) throws FactoryException {
         final String proj = name(parameters.getDescriptor(), Errors.Keys.UnsupportedOperation_1);
         final StringBuilder buffer = new StringBuilder(100).append(PROJ_PARAM).append(proj).append(STANDARD_OPTIONS);
+        /*
+         * Proj.4 requires some parameters that are not defined in the EPSG geodetic dataset for some projections.
+         * Those parameters are unnecessary since their values are implied by the other parameters. However Proj.4
+         * does not seem to have any "intelligence" for such inference; we have to specify explicitely those values
+         * in the 'switch' statements below. The Objects listed below are parameters needed for those special cases.
+         */
+        Object latitudeOfOrigin  = null;
+        Object latitudeTrueScale = null;
+        Object standardParallel1 = null;
         for (final GeneralParameterValue p : parameters.values()) {
             /*
              * Unconditionally ask the parameter name in order to throw an exception
@@ -448,10 +458,44 @@ public class Proj4Factory extends Geodet
             if (p instanceof ParameterValue) {
                 final Object value = ((ParameterValue) p).getValue();
                 if (value != null) {
-                    buffer.append(" +").append(name).append('=').append(value);
+                    append(buffer, name, value);
+                    switch (name) {
+                        case "lat_0":  latitudeOfOrigin  = value; break;
+                        case "lat_1":  standardParallel1 = value; break;
+                        case "lat_ts": latitudeTrueScale = value; break;
+                    }
                 }
             }
         }
+        /*
+         * See above comment about parameter inference in Proj4. To verify if those special cases
+         * are still necessary, one can try to disable them and run TransformTest. If those tests
+         * work with a future Proj4 version, then the special cases below should be deleted.
+         */
+        switch (proj) {
+            /*
+             * In "Lambert Conic Conformal (1SP)" case, there is no standard parallel (lat_1) since a scale factor (k_0)
+             * is used instead. That scale is defined as the "Scale factor at natural origin", i.e. at lat_0. But Proj4
+             * does not seem to know that definition, so we have to explicitely tell it that lat_0 is the latitude of
+             * true scale.
+             */
+            case "lcc": {
+                if (standardParallel1 == null && latitudeOfOrigin != null) {
+                    append(buffer, "lat_1", latitudeOfOrigin);
+                }
+                break;
+            }
+            /*
+             * In "Polar Stereographic (variant B)", the latitude of natural origin is always a pole (90°N or S).
+             * Whether it is the North or South pole is determined by the sign of the latitude of true scale.
+             */
+            case "stere": {
+                if (latitudeOfOrigin == null && latitudeTrueScale instanceof Number) {
+                    append(buffer, "lat_0", ((Number) latitudeTrueScale).doubleValue() < 0 ? Latitude.MIN_VALUE : Latitude.MAX_VALUE);
+                }
+                break;
+            }
+        }
         final String definition = buffer.toString();
         try {
             final PJ pj = unique(new PJ(definition));
@@ -463,6 +507,13 @@ public class Proj4Factory extends Geodet
     }
 
     /**
+     * Appends a Proj4 parameter in the given string buffer.
+     */
+    private static void append(final StringBuilder buffer, final String param, final Object value) {
+        buffer.append(" +").append(param).append('=').append(value);
+    }
+
+    /**
      * Creates a new geodetic object from the given {@literal Proj.4} definition.
      * The default implementation delegates to {@link #createCoordinateReferenceSystem(String)}.
      *

Modified: sis/trunk/storage/sis-gdal/src/main/resources/native/darwin/libproj-binding.so
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-gdal/src/main/resources/native/darwin/libproj-binding.so?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
Binary files - no diff available.

Modified: sis/trunk/storage/sis-geotiff/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/pom.xml (original)
+++ sis/trunk/storage/sis-geotiff/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.storage</groupId>
   <artifactId>sis-geotiff</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS GeoTIFF storage</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Bridge between GeoTIFF convention and ISO 19115 metadata.
+    Bridge between GeoTIFF convention and ISO 19115 metadata.
   </description>
 
 
@@ -103,12 +100,16 @@ Bridge between GeoTIFF convention and IS
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.storage.geotiff</Bundle-SymbolicName>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.storage.geotiff
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
     </plugins>

Modified: sis/trunk/storage/sis-netcdf/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/pom.xml (original)
+++ sis/trunk/storage/sis-netcdf/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.storage</groupId>
   <artifactId>sis-netcdf</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS netCDF storage</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Bridge between netCDF Climate and Forecast (CF) convention and ISO 19115 metadata.
+    Bridge between netCDF Climate and Forecast (CF) convention and ISO 19115 metadata.
   </description>
 
 
@@ -92,13 +89,16 @@ Bridge between netCDF Climate and Foreca
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.storage.netcdf</Bundle-SymbolicName>
-            <Import-Package>!ucar.*, *</Import-Package>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.storage.netcdf
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
     </plugins>

Modified: sis/trunk/storage/sis-shapefile/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/pom.xml (original)
+++ sis/trunk/storage/sis-shapefile/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.storage</groupId>
   <artifactId>sis-shapefile</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS Shapefile storage</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Read and write files in the Shapefile format.
+    Read and write files in the Shapefile format.
   </description>
 
 
@@ -81,14 +78,18 @@ Read and write files in the Shapefile fo
         </executions>
       </plugin>
 
-      <!-- Package as OSGi bundle -->
+      <!-- Anticipation for Java 9 -->
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.storage.shapefile</Bundle-SymbolicName>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.storage.shapefile
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
 

Modified: sis/trunk/storage/sis-storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/pom.xml (original)
+++ sis/trunk/storage/sis-storage/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.storage</groupId>
   <artifactId>sis-storage</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS common storage</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Provides the interfaces and base classes to be implemented by various storage formats.
+    Provides the interfaces and base classes to be implemented by various storage formats.
   </description>
 
 
@@ -104,13 +101,16 @@ Provides the interfaces and base classes
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.storage</Bundle-SymbolicName>
-            <Export-Package>org.apache.sis.internal.storage; x-friends=org.apache.sis.storage.netcdf, *</Export-Package>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.storage
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
     </plugins>

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreFormat.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreFormat.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreFormat.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -87,7 +87,7 @@ public final class StoreFormat extends W
                 envelope.setCoordinateReferenceSystem(parseCRS(crs, additionalCRS));
                 return new GeometryWrapper(obj, envelope);
             }
-        } catch (IllegalArgumentException | UnsupportedOperationException e) {
+        } catch (Exception e) {     // Implementation-specific exception (e.g. JTS has its own exception class).
             log(e);
         }
         return null;

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/AbstractProvider.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/AbstractProvider.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/AbstractProvider.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -35,7 +35,7 @@ import org.apache.sis.internal.storage.D
  * (JAXB, StAX, <i>etc</i>).
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -58,28 +58,43 @@ public abstract class AbstractProvider e
     private static final byte[] HEADER = {'<','?','x','m','l',' '};
 
     /**
-     * The mapping from XML namespace to MIME type. This map shall be populated by subclasses
+     * The mapping from XML namespaces to MIME types. This map shall be populated by subclasses
      * at construction time, then never modified anymore since we do not synchronize it.
      *
      * <div class="note"><b>Example</b>
      * public MyDataStore() {
-     *     types.put("http://www.opengis.net/gml/3.2",        "application/gml+xml");
-     *     types.put("http://www.isotc211.org/2005/gmd",      "application/vnd.iso.19139+xml");
-     *     types.put("http://www.opengis.net/cat/csw/2.0.2",  "application/vnd.ogc.csw_xml");
+     *     mimeForNameSpaces.put("http://www.opengis.net/gml/3.2",        "application/gml+xml");
+     *     mimeForNameSpaces.put("http://www.isotc211.org/2005/gmd",      "application/vnd.iso.19139+xml");
+     *     mimeForNameSpaces.put("http://www.opengis.net/cat/csw/2.0.2",  "application/vnd.ogc.csw_xml");
      * }</div>
+     *
+     * @todo replace by {@code Map.of(…)} on JDK9 branch.
+     */
+    protected final Map<String,String> mimeForNameSpaces;
+
+    /**
+     * The mapping from root elements to MIME types. Used only if the root element is in
+     * the default namespace and contains no {@code xmlns} attributes for that namespace.
+     *
+     * <div class="note"><b>Example</b>
+     * public MyDataStore() {
+     *     mimeForRootElements.put("MD_Metadata", "application/vnd.iso.19139+xml");
+     * }</div>
+     *
+     * @todo replace by {@code Map.of(…)} on JDK9 branch.
      */
-    protected final Map<String,String> types;
+    protected final Map<String,String> mimeForRootElements;
 
     /**
-     * Creates a new provider. Subclasses shall populate the {@link #types} map with a mapping
+     * Creates a new provider. Subclasses shall populate the {@link #mimeForNameSpaces} map with a mapping
      * from their namespace to the MIME type to declare.
      *
      * @param  name  the primary key to use for searching in the {@code MD_Format} table, or {@code null} if none.
-     * @param  initialCapacity  initial capacity of the hash map to create.
      */
-    protected AbstractProvider(final String name, final int initialCapacity) {
+    protected AbstractProvider(final String name) {
         super(name);
-        types = new HashMap<>(initialCapacity);
+        mimeForNameSpaces   = new HashMap<>();
+        mimeForRootElements = new HashMap<>();
     }
 
     /**
@@ -109,7 +124,7 @@ public abstract class AbstractProvider e
             }
             // Now check for a more accurate MIME type.
             buffer.position(HEADER.length);
-            final ProbeResult result = new MimeTypeDetector(types) {
+            final ProbeResult result = new MimeTypeDetector(mimeForNameSpaces, mimeForRootElements) {
                 @Override int read() {
                     if (buffer.hasRemaining()) {
                         return buffer.get();
@@ -136,7 +151,7 @@ public abstract class AbstractProvider e
                 }
             }
             // Now check for a more accurate MIME type.
-            final ProbeResult result = new MimeTypeDetector(types) {
+            final ProbeResult result = new MimeTypeDetector(mimeForNameSpaces, mimeForRootElements) {
                 private int remaining = READ_AHEAD_LIMIT;
                 @Override int read() throws IOException {
                     return (--remaining >= 0) ? IOUtilities.readCodePoint(reader) : -1;

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -19,6 +19,7 @@ package org.apache.sis.internal.storage.
 import java.util.Map;
 import java.util.Arrays;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.ProbeResult;
 
@@ -35,16 +36,22 @@ import org.apache.sis.storage.ProbeResul
  * it would be way too heavy.</p>
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.4
  * @module
  */
 abstract class MimeTypeDetector {
     /**
-     * The mapping from XML namespace to MIME type.
+     * The mapping from XML namespaces to MIME types.
      * This map shall be read-only, since we do not synchronize it.
      */
-    private final Map<String,String> types;
+    private final Map<String,String> mimeForNameSpaces;
+
+    /**
+     * The mapping from root elements to MIME types. Used only if the root element is in
+     * the default namespace and contains no {@code xmlns} attributes for that namespace.
+     */
+    private final Map<String,String> mimeForRootElements;
 
     /**
      * The {@code "xmlns"} string as a sequence of bytes.
@@ -79,17 +86,26 @@ abstract class MimeTypeDetector {
     /**
      * Creates a new instance.
      *
-     * @param  types  the mapping from XML namespaces to MIME type.
+     * @param  mimeForNameSpaces    the mapping from XML namespaces to MIME type.
+     * @param  mimeForRootElements  the mapping from root elements to MIME types, used only as a fallback.
      */
-    MimeTypeDetector(final Map<String,String> types) {
-        this.types = types;
+    MimeTypeDetector(final Map<String,String> mimeForNameSpaces, final Map<String,String> mimeForRootElements) {
+        this.mimeForNameSpaces   = mimeForNameSpaces;
+        this.mimeForRootElements = mimeForRootElements;
+    }
+
+    /**
+     * Returns the current {@link #buffer} content as a US-ASCII string.
+     */
+    private String current() throws UnsupportedEncodingException {
+        return new String(buffer, 0, length, "US-ASCII");
     }
 
     /**
      * Adds the given byte in the {@link #buffer}, increasing its capacity if needed.
      */
     private void remember(final int c) {
-        if (length == buffer.length) {
+        if (length >= buffer.length) {
             buffer = Arrays.copyOf(buffer, length*2);
         }
         buffer[length++] = (byte) c;
@@ -100,7 +116,7 @@ abstract class MimeTypeDetector {
      * to read. We are typically not allowed to read the full stream because only a limited amount of bytes is
      * cached. This method may return a Unicode code point (i.e. the returned value may not fit in {@code char}).
      *
-     * @return the character, or -1 on EOF.
+     * @return the character, or -1 on end of stream window.
      * @throws IOException if an error occurred while reading the byte or character.
      */
     abstract int read() throws IOException;
@@ -110,7 +126,7 @@ abstract class MimeTypeDetector {
      * Characters inside quotes will be ignored.
      *
      * @param  search  the byte or character to skip.
-     * @return the byte or character after {@code search}, or -1 on EOF.
+     * @return the byte or character after {@code search}, or -1 on end of stream window.
      * @throws IOException if an error occurred while reading the bytes or characters.
      */
     private int readAfter(final int search) throws IOException {
@@ -127,14 +143,14 @@ abstract class MimeTypeDetector {
     }
 
     /**
-     * If the given character is a space, skip it and all following spaces.
+     * If the given character is a space, skips it and all following spaces.
      * Returns the first non-space character.
      *
      * <p>For the purpose of this method, a "space" is considered to be the {@code ' '} character
      * and all control characters (character below 32, which include tabulations and line feeds).
      * This is the same criterion than {@link String#trim()}, but does not include Unicode spaces.</p>
      *
-     * @return the first non-space character, or -1 on EOF.
+     * @return the first non-space character, or -1 on end of stream window.
      * @throws IOException if an error occurred while reading the bytes or characters.
      */
     private int afterSpaces(int c) throws IOException {
@@ -153,7 +169,7 @@ abstract class MimeTypeDetector {
      * @param  n          number of valid characters in {@code word}.
      * @param  c          value of {@code afterSpaces(read())}.
      * @param  separator  the {@code ':'} or {@code '='} character.
-     * @return 1 if a match is found, 0 if no match, or -1 on EOF.
+     * @return 1 if a match is found, 0 if no match, or -1 on end of stream window.
      * @throws IOException if an error occurred while reading the bytes or characters.
      */
     private int matches(final byte[] word, final int n, int c, final char separator) throws IOException {
@@ -174,6 +190,7 @@ abstract class MimeTypeDetector {
 
     /**
      * Returns the MIME type, or {@code null} if unknown.
+     * The call shall have already skipped the {@code "<?xml "} characters before to invoke this method.
      *
      * @throws IOException if an error occurred while reading the bytes or characters.
      */
@@ -221,34 +238,42 @@ abstract class MimeTypeDetector {
          * find the ':' character, then we will consider that the element is in the default namespace, in which
          * case there is no prefix (length == 0). Exemple: "<MD_Metadata xmlns = … >"
          */
+        final String rootElement;
         c = afterSpaces(c);
         if (c != ':') {
-            length = 0;         // XML element in the default namespace: it has no prefix.
+            rootElement = current();
+            length = 0;                             // XML element in the default namespace: it has no prefix.
         } else {
+            rootElement = null;                     // Current buffer content is the prefix, not the name.
             c = afterSpaces(read());
         }
         /*
          * Search for "xmlns" keyword, ignoring anything before it. If we find a prefix in the previous step,
          * we will require that "xmlns" is followed by ":prefix" where "prefix" is the prefix that we found.
          */
-        while (true) {
+        for (;;) {
             int m = matches(XMLNS, XMLNS.length, c, (length == 0) ? '=' : ':');
             if (m != 0) {
                 if (m < 0) {
-                    return null;                            // End of file.
+                    return null;                                        // End of stream window.
                 }
-                if (length == 0) break;                     // Found match for default namespace.
+                if (length == 0) break;                                 // Found match for default namespace.
                 m = matches(buffer, length, afterSpaces(read()), '=');
                 if (m != 0) {
                     if (m < 0) {
-                        return null;                        // End of file.
+                        return null;                                    // End of stream window.
                     }
-                    break;                                  // Found match for prefix.
+                    break;                                              // Found match for prefix.
                 }
             }
             // Skip everything up to the next space, and check again.
             c = afterSpaces(read());
-            if (c < 0) return null;
+            if (c < 0 || c == '>') {
+                if (c >= 0 && rootElement != null) {
+                    return mimeForRootElements.get(rootElement);
+                }
+                return null;                                // End of stream window or end of start element.
+            }
         }
         /*
          * At this point, we found the "xmlns" attribute for the prefix of the root element.
@@ -270,7 +295,7 @@ abstract class MimeTypeDetector {
         /*
          * Done reading the "xmlns" attribute value.
          */
-        return types.get(new String(buffer, 0, length, "US-ASCII"));
+        return mimeForNameSpaces.get(current());
     }
 
     /**

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -20,6 +20,7 @@ import org.apache.sis.xml.Namespaces;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.storage.StoreMetadata;
 import org.apache.sis.internal.storage.Capability;
 
@@ -45,11 +46,12 @@ public final class StoreProvider extends
      * Creates a new provider.
      */
     public StoreProvider() {
-        super(null, 8);
-        types.put(Namespaces.GML, "application/gml+xml");
-        types.put(Namespaces.GMD, "application/vnd.iso.19139+xml");
-        types.put(Namespaces.CSW, "application/vnd.ogc.csw_xml");
+        super(null);
+        mimeForNameSpaces.put(Namespaces.GML, "application/gml+xml");
+        mimeForNameSpaces.put(Namespaces.CSW, "application/vnd.ogc.csw_xml");
+        mimeForNameSpaces.put(LegacyNamespaces.GMD, "application/vnd.iso.19139+xml");
         // More types to be added in future versions.
+        mimeForRootElements.put("MD_Metadata", "application/vnd.iso.19139+xml");
     }
 
     /**

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -26,7 +26,7 @@
  * the {@code sis-xmlstore} module extends this package with classes designed for use with StAX cursor API.</p>
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.4
  * @module
  */

Modified: sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java [UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -16,28 +16,30 @@
  */
 package org.apache.sis.internal.storage.xml;
 
+import java.util.Map;
+import java.util.Collections;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
 import org.apache.sis.xml.Namespaces;
-import org.apache.sis.metadata.iso.extent.DefaultExtentTest;
+import org.apache.sis.metadata.xml.TestUsingFile;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.test.DependsOnMethod;
-import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static java.util.Collections.singletonMap;
 import static org.junit.Assert.*;
+import static org.apache.sis.metadata.iso.extent.DefaultExtentTest.FILENAME;
 
 
 /**
  * Tests {@link MimeTypeDetector}.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.4
  * @module
  */
-public final strictfp class MimeTypeDetectorTest extends TestCase {
+public final strictfp class MimeTypeDetectorTest extends TestUsingFile {
     /**
      * Tests a pseudo-XML file in the default namespace, read from a hard-coded string.
      *
@@ -47,7 +49,7 @@ public final strictfp class MimeTypeDete
     public void testInDefaultNamespace() throws IOException {
         testFromString("<?xml version=\"1.0\" standalone=\"yes\"?>\n" +
                        "<MD_Metadata xmlns:xsi=\"" + Namespaces.XSI + "\""  +
-                                       " xmlns=\"" + Namespaces.GMD + "\"/>\n");
+                                       " xmlns=\"" + LegacyNamespaces.GMD + "\"/>\n");
     }
 
     /**
@@ -65,16 +67,25 @@ public final strictfp class MimeTypeDete
      * Implementation of test methods using a hard-coded XML string as a source.
      */
     private static void testFromString(final String xml) throws IOException {
+        assertEquals("application/vnd.iso.19139+xml", getMimeType(xml, Collections.emptyMap()));
+    }
+
+    /**
+     * Returns the MIME type of the given XML, as detected by {@link MimeTypeDetector}.
+     */
+    private static String getMimeType(final String xml, final Map<String,String> mimeForRootElements) throws IOException {
         final StringReader in = new StringReader(xml);
         assertEquals('<', in.read());
         assertEquals('?', in.read());
-        final MimeTypeDetector detector = new MimeTypeDetector(singletonMap(Namespaces.GMD, "application/vnd.iso.19139+xml")) {
+        final MimeTypeDetector detector = new MimeTypeDetector(
+                Collections.singletonMap(LegacyNamespaces.GMD, "application/vnd.iso.19139+xml"),
+                mimeForRootElements)
+        {
             @Override int read() throws IOException {
                 return in.read();
             }
         };
-        final String type = detector.getMimeType();
-        assertEquals("application/vnd.iso.19139+xml", type);
+        return detector.getMimeType();
     }
 
     /**
@@ -87,10 +98,13 @@ public final strictfp class MimeTypeDete
     @DependsOnMethod("testGMDFromString")
     public void testGMDFromInputStream() throws IOException {
         final String type;
-        try (InputStream in = DefaultExtentTest.getTestFile(true).openStream()) {
+        try (InputStream in = TestUsingFile.class.getResourceAsStream(XML2007+FILENAME)) {
             assertEquals('<', in.read());
             assertEquals('?', in.read());
-            final MimeTypeDetector detector = new MimeTypeDetector(singletonMap(Namespaces.GMD, "application/vnd.iso.19139+xml")) {
+            final MimeTypeDetector detector = new MimeTypeDetector(
+                    Collections.singletonMap(LegacyNamespaces.GMD, "application/vnd.iso.19139+xml"),
+                    Collections.emptyMap())
+            {
                 @Override int read() throws IOException {
                     return in.read();
                 }
@@ -99,4 +113,18 @@ public final strictfp class MimeTypeDete
         }
         assertEquals("application/vnd.iso.19139+xml", type);
     }
+
+    /**
+     * Tests detection for a XML without namespace.
+     *
+     * @throws IOException if an error occurred while reading the bytes or characters.
+     */
+    @Test
+    public void testWithoutNamespace() throws IOException {
+        final String type = getMimeType(
+                "<?xml version=\"1.0\" standalone=\"yes\"?>\n" +
+                "<MD_Metadata xmlns:xsi=\"" + Namespaces.XSI + "\">\n",
+                Collections.singletonMap("MD_Metadata", "application/vnd.iso.19115+xml"));
+        assertEquals("application/vnd.iso.19115+xml", type);
+    }
 }

Modified: sis/trunk/storage/sis-xmlstore/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-xmlstore/pom.xml?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-xmlstore/pom.xml (original)
+++ sis/trunk/storage/sis-xmlstore/pom.xml Fri Apr 20 16:18:08 2018
@@ -37,12 +37,9 @@
        =========================================================== -->
   <groupId>org.apache.sis.storage</groupId>
   <artifactId>sis-xmlstore</artifactId>
-  <packaging>bundle</packaging>
   <name>Apache SIS XML storage</name>
   <description>
-  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
-       The leading space after the first line is necessary for proper formatting. -->
-Read and write files in the GPX format.
+    Read and write files in the GPX format.
   </description>
 
 
@@ -84,14 +81,18 @@ Read and write files in the GPX format.
         </executions>
       </plugin>
 
-      <!-- Package as OSGi bundle -->
+      <!-- Anticipation for Java 9 -->
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
         <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.apache.sis.storage.xmlstore</Bundle-SymbolicName>
-          </instructions>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>
+                org.apache.sis.storage.xml
+              </Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
     </plugins>

Modified: sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java [UTF-8] (original)
+++ sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -61,9 +61,10 @@ public final class StoreProvider extends
      * Creates a new GPX store provider.
      */
     public StoreProvider() {
-        super("GPX", 4);
-        types.put(Tags.NAMESPACE_V10, "application/gpx+xml");
-        types.put(Tags.NAMESPACE_V11, "application/gpx+xml");
+        super("GPX");
+        mimeForNameSpaces.put(Tags.NAMESPACE_V10, "application/gpx+xml");
+        mimeForNameSpaces.put(Tags.NAMESPACE_V11, "application/gpx+xml");
+        mimeForRootElements.put("gpx", "application/gpx+xml");
     }
 
     /**

Modified: sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStoreProvider.java?rev=1829670&r1=1829669&r2=1829670&view=diff
==============================================================================
--- sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStoreProvider.java [UTF-8] (original)
+++ sis/trunk/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStoreProvider.java [UTF-8] Fri Apr 20 16:18:08 2018
@@ -40,14 +40,13 @@ public abstract class StaxDataStoreProvi
     private volatile MarshallerPool jaxb;
 
     /**
-     * Creates a new provider. Subclasses shall populate the {@link #types} map with a mapping
-     * from their namespace to the MIME type to declare.
+     * Creates a new provider. Subclasses shall populate the {@link #mimeForNameSpaces}
+     * map with a mapping from their namespace to the MIME type to declare.
      *
      * @param  name  the primary key to use for searching in the {@code MD_Format} table, or {@code null} if none.
-     * @param  initialCapacity  initial capacity of the hash map to create.
      */
-    protected StaxDataStoreProvider(final String name, final int initialCapacity) {
-        super(name, initialCapacity);
+    protected StaxDataStoreProvider(final String name) {
+        super(name);
     }
 
     /**



Mime
View raw message