sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1734399 [2/2] - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-referencing/src/main/java/org/apache/sis/geometry/ core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ core/sis...
Date Thu, 10 Mar 2016 12:42:30 GMT
Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/GridGeometryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/GridGeometryTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/GridGeometryTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/GridGeometryTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -17,6 +17,7 @@
 package org.apache.sis.internal.netcdf;
 
 import java.io.IOException;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.netcdf.AttributeNames;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.DependsOnMethod;
@@ -55,10 +56,11 @@ public strictfp class GridGeometryTest e
     /**
      * Tests {@link GridGeometry#getSourceDimensions()} and {@link GridGeometry#getTargetDimensions()}.
      *
-     * @throws IOException If an error occurred while reading the NetCDF file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Test
-    public void testDimensions() throws IOException {
+    public void testDimensions() throws IOException, DataStoreException {
         final GridGeometry geometry = getSingleton(filter(selectDataset(NCEP).getGridGeometries()));
         assertEquals("getSourceDimensions()", 3, geometry.getSourceDimensions());
         assertEquals("getTargetDimensions()", 3, geometry.getTargetDimensions());
@@ -67,11 +69,12 @@ public strictfp class GridGeometryTest e
     /**
      * Tests {@link GridGeometry#getAxes()}.
      *
-     * @throws IOException If an error occurred while reading the NetCDF file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Test
     @DependsOnMethod("testDimensions")
-    public void testAxes() throws IOException {
+    public void testAxes() throws IOException, DataStoreException {
         final Axis[] axes = getSingleton(filter(selectDataset(NCEP).getGridGeometries())).getAxes();
         assertEquals(3, axes.length);
         final Axis x = axes[2];

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.io.IOException;
 import java.lang.reflect.UndeclaredThrowableException;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.util.logging.EmptyWarningListeners;
 import org.apache.sis.internal.netcdf.ucar.DecoderWrapper;
 import org.apache.sis.internal.system.Modules;
@@ -102,9 +103,10 @@ public abstract strictfp class TestCase
      *
      * @param  name The file name as one of the above-cited constants.
      * @return The decoder for the given name.
-     * @throws IOException If an error occurred while opening the file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
-    protected Decoder createDecoder(final String name) throws IOException {
+    protected Decoder createDecoder(final String name) throws IOException, DataStoreException {
         return new DecoderWrapper(LISTENERS, new NetcdfDataset(open(name)));
     }
 
@@ -118,9 +120,10 @@ public abstract strictfp class TestCase
      *
      * @param  name The file name as one of the constants enumerated in the {@link #createDecoder(String)} method.
      * @return The decoder for the given name.
-     * @throws IOException If an error occurred while opening the file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
-    protected final Decoder selectDataset(final String name) throws IOException {
+    protected final Decoder selectDataset(final String name) throws IOException, DataStoreException {
         synchronized (DECODERS) { // Paranoiac safety, but should not be used in multi-threads environment.
             decoder = DECODERS.get(name);
             if (decoder == null) {
@@ -137,7 +140,7 @@ public abstract strictfp class TestCase
      * Invoked after all tests in a class have been executed.
      * This method closes all NetCDF files.
      *
-     * @throws IOException If an error occurred while closing a file.
+     * @throws IOException if an error occurred while closing a file.
      */
     @AfterClass
     public static void closeAllDecoders() throws IOException {
@@ -183,7 +186,7 @@ public abstract strictfp class TestCase
      *
      * @param  expected      The expected attribute value.
      * @param  attributeName The name of the attribute to test.
-     * @throws IOException   If an error occurred while reading the NetCDF file.
+     * @throws IOException   if an error occurred while reading the NetCDF file.
      */
     protected final void assertAttributeEquals(final String expected, final String attributeName) throws IOException {
         assertEquals(attributeName, expected, decoder.stringValue(attributeName));

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -57,10 +57,11 @@ public strictfp class VariableTest exten
      *   <li>{@link Variable#isUnsigned()}</li>
      * </ul>
      *
-     * @throws IOException If an error occurred while reading the NetCDF file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Test
-    public void testBasicProperties() throws IOException {
+    public void testBasicProperties() throws IOException, DataStoreException {
         assertBasicPropertiesEqual(new Object[] {
         // __name______________description_________________________________datatype____dim__axis?__raster?
             "reftime",        "reference time",                            double.class, 1, false, false,
@@ -122,10 +123,11 @@ public strictfp class VariableTest exten
      * Tests {@link Variable#getGridDimensionNames()} and {@link Variable#getGridEnvelope()}.
      * Current implementation tests on the {@code "SST"} variable.
      *
-     * @throws IOException If an error occurred while reading the NetCDF file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Test
-    public void testGridDimensions() throws IOException {
+    public void testGridDimensions() throws IOException, DataStoreException {
         final Variable variable = selectDataset(NCEP).getVariables()[21];
         assertEquals("SST", variable.getName());
 
@@ -141,10 +143,11 @@ public strictfp class VariableTest exten
     /**
      * Tests {@link Variable#getAttributeValues(String, boolean)}.
      *
-     * @throws IOException If an error occurred while reading the NetCDF file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Test
-    public void testGetAttributes() throws IOException {
+    public void testGetAttributes() throws IOException, DataStoreException {
         final Variable[] variables = selectDataset(NCEP).getVariables();
         Variable variable = variables[9];
         assertEquals("grid_number", variable.getName());

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -46,10 +46,11 @@ public final strictfp class ChannelDecod
      * Creates a new decoder for dataset of the given name.
      *
      * @return The decoder for the given name.
-     * @throws IOException If an error occurred while opening the file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Override
-    protected Decoder createDecoder(final String name) throws IOException {
+    protected Decoder createDecoder(final String name) throws IOException, DataStoreException {
         return createChannelDecoder(name);
     }
 
@@ -66,18 +67,15 @@ public final strictfp class ChannelDecod
      *
      * @param  name The file name as one of the above-cited constants.
      * @return The decoder for the given name.
-     * @throws IOException If an error occurred while opening the file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
-    public static Decoder createChannelDecoder(final String name) throws IOException {
+    public static Decoder createChannelDecoder(final String name) throws IOException, DataStoreException {
         final InputStream in = IOTestCase.class.getResourceAsStream(name);
         assertNotNull(name, in);
         final ChannelDataInput input = new ChannelDataInput(name,
                 Channels.newChannel(in), ByteBuffer.allocate(4096), false);
-        try {
-            return new ChannelDecoder(LISTENERS, input);
-        } catch (DataStoreException e) {
-            throw new AssertionError(e);
-        }
+        return new ChannelDecoder(LISTENERS, input);
     }
 
     /**

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -20,6 +20,7 @@ import java.io.IOException;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.internal.netcdf.GridGeometry;
 import org.apache.sis.internal.netcdf.GridGeometryTest;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.test.DependsOn;
 
@@ -40,10 +41,11 @@ public final strictfp class GridGeometry
      * Creates a new decoder for dataset of the given name.
      *
      * @return The decoder for the given name.
-     * @throws IOException If an error occurred while opening the file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Override
-    protected Decoder createDecoder(final String name) throws IOException {
+    protected Decoder createDecoder(final String name) throws IOException, DataStoreException {
         return ChannelDecoderTest.createChannelDecoder(name);
     }
 

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -19,6 +19,7 @@ package org.apache.sis.internal.netcdf.i
 import java.io.IOException;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.internal.netcdf.VariableTest;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.test.DependsOn;
 
 
@@ -38,10 +39,11 @@ public final strictfp class VariableInfo
      * Creates a new decoder for dataset of the given name.
      *
      * @return The decoder for the given dataset.
-     * @throws IOException If an error occurred while opening the file.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Override
-    protected Decoder createDecoder(final String name) throws IOException {
+    protected Decoder createDecoder(final String name) throws IOException, DataStoreException {
         return ChannelDecoderTest.createChannelDecoder(name);
     }
 

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -25,6 +25,7 @@ import org.apache.sis.internal.netcdf.De
 import org.apache.sis.internal.netcdf.ucar.DecoderWrapper;
 import org.apache.sis.internal.netcdf.impl.ChannelDecoderTest;
 import org.apache.sis.metadata.iso.DefaultMetadata;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
@@ -50,10 +51,11 @@ public final strictfp class MetadataRead
      * Reads the metadata using the NetCDF decoder embedded with SIS,
      * and compares its string representation with the expected one.
      *
-     * @throws IOException Should never happen.
+     * @throws IOException if an I/O error occurred while opening the file.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Test
-    public void testEmbedded() throws IOException {
+    public void testEmbedded() throws IOException, DataStoreException {
         final Metadata metadata;
         try (Decoder input = ChannelDecoderTest.createChannelDecoder(NCEP)) {
             metadata = new MetadataReader(input).read();

Modified: sis/branches/JDK7/storage/sis-storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/pom.xml?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/pom.xml (original)
+++ sis/branches/JDK7/storage/sis-storage/pom.xml Thu Mar 10 12:42:29 2016
@@ -121,6 +121,12 @@ Provides the interfaces and base classes
            Dependencies
        =========================================================== -->
   <dependencies>
+    <dependency>
+      <groupId>org.apache.sis.core</groupId>
+      <artifactId>sis-feature</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
     <!-- Test dependencies -->
     <dependency>
       <groupId>org.apache.sis.core</groupId>

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -60,7 +60,7 @@ import java.nio.channels.SeekableByteCha
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.7
  * @module
  */
 public class ChannelDataInput extends ChannelData {
@@ -265,7 +265,7 @@ public class ChannelDataInput extends Ch
      * The implementation is as below:
      *
      * {@preformat java
-     *     return readByte() & 0xFF;
+     *     return Byte.toUnsignedInt(readByte());
      * }
      *
      * @return The value of the next unsigned byte from the stream.
@@ -293,7 +293,7 @@ public class ChannelDataInput extends Ch
      * The implementation is as below:
      *
      * {@preformat java
-     *     return readShort() & 0xFFFF;
+     *     return Short.toUnsignedInt(readShort());
      * }
      *
      * @return The value of the next unsigned short from the stream.
@@ -334,7 +334,7 @@ public class ChannelDataInput extends Ch
      * The implementation is as below:
      *
      * {@preformat java
-     *     return readInt() & 0xFFFFFFFFL;
+     *     return Integer.toUnsignedLong(readInt());
      * }
      *
      * @return The value of the next unsigned integer from the stream.
@@ -519,7 +519,35 @@ public class ChannelDataInput extends Ch
      * Helper class for the {@code readFully(…)} methods,
      * in order to avoid duplicating almost identical code many times.
      */
-    private abstract class ArrayReader {
+    abstract class ArrayReader {
+        /**
+         * Returns the size of the Java primitive type which is the element of the array.
+         * The size is expressed as the number of bits to shift.
+         */
+        abstract int dataSizeShift();
+
+        /**
+         * Returns the data as a {@code char[]}, {@code short[]}, {@code int[]}, {@code long[]},
+         * {@code float[]} or {@code double[]} array. This is either the array given in argument
+         * to the subclass constructor, or the array created by {@link #createArray(int)}.
+         */
+        abstract Object dataArray();
+
+        /**
+         * Creates a destination array of the given length.
+         */
+        abstract void createDataArray(int length);
+
+        /**
+         * Sets the destination to the given data array, which may be {@code null}.
+         */
+        abstract void setDest(Object array) throws ClassCastException;
+
+        /**
+         * Returns the view created by the last call to {@link #createView()}, or {@code null} if none.
+         */
+        abstract Buffer view();
+
         /**
          * Creates a new buffer of the type required by the array to fill.
          * This method is guaranteed to be invoked exactly once, after the
@@ -535,6 +563,19 @@ public class ChannelDataInput extends Ch
         abstract void transfer(int offset, int n);
 
         /**
+         * For subclass constructors only.
+         */
+        ArrayReader() {
+        }
+
+        /**
+         * Returns the enclosing data input.
+         */
+        final ChannelDataInput input() {
+            return ChannelDataInput.this;
+        }
+
+        /**
          * Skips the given amount of bytes in the buffer. It is caller responsibility to ensure
          * that there is enough bytes remaining in the buffer.
          */
@@ -546,28 +587,175 @@ public class ChannelDataInput extends Ch
          * Reads {@code length} characters from the stream, and stores them into the array
          * known to subclass, starting at index {@code offset}.
          *
-         * @param  dataSize The size of the Java primitive type which is the element of the array.
+         * <p>If a non-null {@code Buffer} is given in argument to this method, then it must be a view over
+         * the full content of {@link ChannelDataInput#buffer} (i.e. the view element at index 0 shall be
+         * defined by the buffer elements starting at index 0).</p>
+         *
+         * @param  view     Existing buffer to use as a view over {@link ChannelDataInput#buffer}, or {@code null}.
          * @param  offset   The starting position within {@code dest} to write.
          * @param  length   The number of characters to read.
-         * @throws IOException If an error (including EOF) occurred while reading the stream.
+         * @throws IOException if an error (including EOF) occurred while reading the stream.
          */
-        final void readFully(final int dataSize, int offset, int length) throws IOException {
-            ensureBufferContains(Math.min(length * dataSize, buffer.capacity()));
-            final Buffer view = createView(); // Must be after ensureBufferContains
+        void readFully(Buffer view, int offset, int length) throws IOException {
+            final int dataSizeShift = dataSizeShift();
+            ensureBufferContains(Math.min(length << dataSizeShift, buffer.capacity()));
+            if (view == null) {
+                view = createView();                                    // Must be after ensureBufferContains(int).
+            } else {
+                // Buffer position must be a multiple of the data size.
+                // If not, fix that by shifting the content to index 0.
+                if ((buffer.position() & ((1 << dataSizeShift) - 1)) != 0) {
+                    bufferOffset += buffer.position();
+                    buffer.compact().flip();
+                }
+                view.limit   (buffer.limit()    >> dataSizeShift)
+                    .position(buffer.position() >> dataSizeShift);      // See assumption documented in Javadoc.
+            }
             int n = Math.min(view.remaining(), length);
             transfer(offset, n);
-            skipInBuffer(n * dataSize);
+            skipInBuffer(n << dataSizeShift);
             while ((length -= n) != 0) {
                 offset += n;
-                ensureBufferContains(dataSize); // Actually read as much data as possible.
-                view.rewind().limit(buffer.remaining() / dataSize);
+                ensureBufferContains(1 << dataSizeShift);               // Actually read as much data as possible.
+                view.rewind().limit(buffer.remaining() >> dataSizeShift);
                 transfer(offset, n = Math.min(view.remaining(), length));
-                skipInBuffer(n * dataSize);
+                skipInBuffer(n << dataSizeShift);
             }
         }
     }
 
     /**
+     * Reads bytes from the enclosing stream and stores them into the given destination array. This implementation
+     * actually redirects the reading process to {@link ChannelDataInput#readFully(byte[], int, int)} because this
+     * specialization does not need a view. This implementation is useless for {@code ChannelDataInput}, but avoid
+     * the need to implement special cases in other classes like {@link HyperRectangleReader}.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final class BytesReader extends ArrayReader {
+        /** The array where to store the values. */ private byte[] dest;
+        BytesReader(final byte[] dest) {this.dest = dest;}
+
+        @Override int    dataSizeShift()        {return 0;}
+        @Override Object dataArray()            {return dest;}
+        @Override Buffer view()                 {return buffer;}
+        @Override Buffer createView()           {return buffer;}
+        @Override void   createDataArray(int n) {dest = new byte[n];}
+        @Override void   transfer(int p, int n) {buffer.get(dest, p, n);}
+        @Override void   setDest(Object array)  {dest = (byte[]) array;};
+        @Override void   readFully(Buffer view, int offset, int length) throws IOException {
+            ChannelDataInput.this.readFully(dest, offset, length);
+        }
+    };
+
+    /**
+     * Reads characters from the enclosing stream and stores them into the given destination array.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final class CharsReader extends ArrayReader {
+        /** A view over the enclosing byte buffer. */ private CharBuffer view;
+        /** The array where to store the values.   */ private char[] dest;
+        CharsReader(final char[] dest) {this.dest = dest;}
+
+        @Override int    dataSizeShift()        {return 1;}
+        @Override Object dataArray()            {return dest;}
+        @Override Buffer view()                 {return view;}
+        @Override Buffer createView()           {return view = buffer.asCharBuffer();}
+        @Override void   createDataArray(int n) {dest = new char[n];}
+        @Override void   transfer(int p, int n) {view.get(dest, p, n);}
+        @Override void   setDest(Object array)  {dest = (char[]) array;};
+    };
+
+    /**
+     * Reads short integers from the enclosing stream and stores them into the given destination array.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final class ShortsReader extends ArrayReader {
+        /** A view over the enclosing byte buffer. */ private ShortBuffer view;
+        /** The array where to store the values.   */ private short[] dest;
+        ShortsReader(final short[] dest) {this.dest = dest;}
+
+        @Override int    dataSizeShift()        {return 1;}
+        @Override Object dataArray()            {return dest;}
+        @Override Buffer view()                 {return view;}
+        @Override Buffer createView()           {return view = buffer.asShortBuffer();}
+        @Override void   createDataArray(int n) {dest = new short[n];}
+        @Override void   transfer(int p, int n) {view.get(dest, p, n);}
+        @Override void   setDest(Object array)  {dest = (short[]) array;};
+    };
+
+    /**
+     * Reads integers from the enclosing stream and stores them into the given destination array.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final class IntsReader extends ArrayReader {
+        /** A view over the enclosing byte buffer. */ private IntBuffer view;
+        /** The array where to store the values.   */ private int[] dest;
+        IntsReader(final int[] dest) {this.dest = dest;}
+
+        @Override int    dataSizeShift()        {return 2;}
+        @Override Object dataArray()            {return dest;}
+        @Override Buffer view()                 {return view;}
+        @Override Buffer createView()           {return view = buffer.asIntBuffer();}
+        @Override void   createDataArray(int n) {dest = new int[n];}
+        @Override void   transfer(int p, int n) {view.get(dest, p, n);}
+        @Override void   setDest(Object array)  {dest = (int[]) array;};
+    };
+
+    /**
+     * Reads long integers from the enclosing stream and stores them into the given destination array.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final class LongsReader extends ArrayReader {
+        /** A view over the enclosing byte buffer. */ private LongBuffer view;
+        /** The array where to store the values.   */ private long[] dest;
+        LongsReader(final long[] dest) {this.dest = dest;}
+
+        @Override int    dataSizeShift()        {return 3;}
+        @Override Object dataArray()            {return dest;}
+        @Override Buffer view()                 {return view;}
+        @Override Buffer createView()           {return view = buffer.asLongBuffer();}
+        @Override void   createDataArray(int n) {dest = new long[n];}
+        @Override void   transfer(int p, int n) {view.get(dest, p, n);}
+        @Override void   setDest(Object array)  {dest = (long[]) array;};
+    };
+
+    /**
+     * Reads float values from the enclosing stream and stores them into the given destination array.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final class FloatsReader extends ArrayReader {
+        /** A view over the enclosing byte buffer. */ private FloatBuffer view;
+        /** The array where to store the values.   */ private float[] dest;
+        FloatsReader(final float[] dest) {this.dest = dest;}
+
+        @Override int    dataSizeShift()        {return 2;}
+        @Override Object dataArray()            {return dest;}
+        @Override Buffer view()                 {return view;}
+        @Override Buffer createView()           {return view = buffer.asFloatBuffer();}
+        @Override void   createDataArray(int n) {dest = new float[n];}
+        @Override void   transfer(int p, int n) {view.get(dest, p, n);}
+        @Override void   setDest(Object array)  {dest = (float[]) array;};
+    };
+
+    /**
+     * Reads double values from the enclosing stream and stores them into the given destination array.
+     */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
+    final class DoublesReader extends ArrayReader {
+        /** A view over the enclosing byte buffer. */ private DoubleBuffer view;
+        /** The array where to store the values.   */ private double[] dest;
+        DoublesReader(final double[] dest) {this.dest = dest;}
+
+        @Override int    dataSizeShift()        {return 3;}
+        @Override Object dataArray()            {return dest;}
+        @Override Buffer view()                 {return view;}
+        @Override Buffer createView()           {return view = buffer.asDoubleBuffer();}
+        @Override void   createDataArray(int n) {dest = new double[n];}
+        @Override void   transfer(int p, int n) {view.get(dest, p, n);}
+        @Override void   setDest(Object array)  {dest = (double[]) array;};
+    };
+
+    /**
      * Reads {@code length} characters from the stream, and stores them into
      * {@code dest} starting at index {@code offset}.
      *
@@ -577,11 +765,7 @@ public class ChannelDataInput extends Ch
      * @throws IOException If an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final char[] dest, final int offset, final int length) throws IOException {
-        new ArrayReader() {
-            private CharBuffer view;
-            @Override Buffer createView() {return view = buffer.asCharBuffer();}
-            @Override void transfer(int offset, int n) {view.get(dest, offset, n);}
-        }.readFully(Character.SIZE / Byte.SIZE, offset, length);
+        new CharsReader(dest).readFully(null, offset, length);
     }
 
     /**
@@ -594,11 +778,7 @@ public class ChannelDataInput extends Ch
      * @throws IOException If an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final short[] dest, final int offset, final int length) throws IOException {
-        new ArrayReader() {
-            private ShortBuffer view;
-            @Override Buffer createView() {return view = buffer.asShortBuffer();}
-            @Override void transfer(int offset, int n) {view.get(dest, offset, n);}
-        }.readFully(Short.SIZE / Byte.SIZE, offset, length);
+        new ShortsReader(dest).readFully(null, offset, length);
     }
 
     /**
@@ -611,11 +791,7 @@ public class ChannelDataInput extends Ch
      * @throws IOException If an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final int[] dest, final int offset, final int length) throws IOException {
-        new ArrayReader() {
-            private IntBuffer view;
-            @Override Buffer createView() {return view = buffer.asIntBuffer();}
-            @Override void transfer(int offset, int n) {view.get(dest, offset, n);}
-        }.readFully(Integer.SIZE / Byte.SIZE, offset, length);
+        new IntsReader(dest).readFully(null, offset, length);
     }
 
     /**
@@ -628,11 +804,7 @@ public class ChannelDataInput extends Ch
      * @throws IOException If an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final long[] dest, final int offset, final int length) throws IOException {
-        new ArrayReader() {
-            private LongBuffer view;
-            @Override Buffer createView() {return view = buffer.asLongBuffer();}
-            @Override void transfer(int offset, int n) {view.get(dest, offset, n);}
-        }.readFully(Long.SIZE / Byte.SIZE, offset, length);
+        new LongsReader(dest).readFully(null, offset, length);
     }
 
     /**
@@ -645,11 +817,7 @@ public class ChannelDataInput extends Ch
      * @throws IOException If an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final float[] dest, final int offset, final int length) throws IOException {
-        new ArrayReader() {
-            private FloatBuffer view;
-            @Override Buffer createView() {return view = buffer.asFloatBuffer();}
-            @Override void transfer(int offset, int n) {view.get(dest, offset, n);}
-        }.readFully(Float.SIZE / Byte.SIZE, offset, length);
+        new FloatsReader(dest).readFully(null, offset, length);
     }
 
     /**
@@ -662,11 +830,7 @@ public class ChannelDataInput extends Ch
      * @throws IOException If an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final double[] dest, final int offset, final int length) throws IOException {
-        new ArrayReader() {
-            private DoubleBuffer view;
-            @Override Buffer createView() {return view = buffer.asDoubleBuffer();}
-            @Override void transfer(int offset, int n) {view.get(dest, offset, n);}
-        }.readFully(Double.SIZE / Byte.SIZE, offset, length);
+        new DoublesReader(dest).readFully(null, offset, length);
     }
 
     /**

Copied: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java (from r1734383, sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java?p2=sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java&p1=sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java&r1=1734383&r2=1734399&rev=1734399&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -16,6 +16,9 @@
  */
 package org.apache.sis.internal.storage;
 
+// Branch-dependent imports
+import org.apache.sis.internal.jdk8.JDK8;
+
 
 /**
  * A sub-area in a <var>n</var>-dimensional hyper-rectangle, optionally with sub-sampling.
@@ -102,7 +105,7 @@ public final class Region {
             final long upper = lower + ((count-1) * step + 1);
             final long span  = size[i];
             assert (count > 0) && (lower >= 0) && (upper > lower) && (upper <= span) : i;
-            targetSize[i] = Math.toIntExact(count);
+            targetSize[i] = JDK8.toIntExact(count);
 
             position += stride * lower;
             skip     += stride * (span - (upper - lower));
@@ -137,6 +140,6 @@ public final class Region {
         for (int i=0; i<dimension; i++) {
             length *= targetSize[i];
         }
-        return Math.toIntExact(length);
+        return JDK8.toIntExact(length);
     }
 }

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1734399&r1=1734383&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -21,7 +21,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.Date;
 import java.util.Locale;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
@@ -30,8 +29,6 @@ import java.io.BufferedReader;
 import java.io.LineNumberReader;
 import java.io.IOException;
 import java.net.URI;
-import java.time.Instant;
-import java.time.DateTimeException;
 import javax.measure.unit.Unit;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
@@ -63,6 +60,10 @@ import org.apache.sis.util.ObjectConvert
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.IndexedResourceBundle;
 
+// Branch-dependent imports
+import org.apache.sis.internal.jdk8.Instant;
+import org.apache.sis.internal.jdk8.DateTimeException;
+
 
 /**
  * A data store which creates feature instances from a CSV file using the OGC Moving Features specification.
@@ -320,7 +321,7 @@ public final class Store extends DataSto
                     temporal = TimeEncoding.DEFAULT.crs();
                     timeEncoding = TimeEncoding.ABSOLUTE;
                 } else {
-                    temporal = builder.createTemporalCRS(Date.from(startTime), timeUnit);
+                    temporal = builder.createTemporalCRS(startTime.toDate(), timeUnit);
                     timeEncoding = new TimeEncoding(temporal.getDatum(), timeUnit);
                 }
                 components[count++] = temporal;

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -142,14 +142,14 @@ final class Store extends DataStore {
     public Metadata getMetadata() throws DataStoreException {
         if (metadata == null) {
             parse();
-            DefaultMetadata d = null;
+            DefaultMetadata md = null;
             for (final Object object : objects) {
                 if (object instanceof ReferenceSystem) {
-                    if (d == null) d = new DefaultMetadata();
-                    d.getReferenceSystemInfo().add((ReferenceSystem) object);
+                    if (md == null) md = new DefaultMetadata();
+                    md.getReferenceSystemInfo().add((ReferenceSystem) object);
                 }
             }
-            metadata = d;
+            metadata = md;
         }
         return metadata;
     }

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -178,9 +178,9 @@ final class Store extends DataStore {
             if (object instanceof Metadata) {
                 metadata = (Metadata) object;
             } else if (object instanceof ReferenceSystem) {
-                final DefaultMetadata d = new DefaultMetadata();
-                d.setReferenceSystemInfo(singleton((ReferenceSystem) object));
-                metadata = d;
+                final DefaultMetadata md = new DefaultMetadata();
+                md.setReferenceSystemInfo(singleton((ReferenceSystem) object));
+                metadata = md;
             }
         }
         return metadata;

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -39,6 +39,7 @@ import javax.sql.DataSource;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.ArgumentChecks;
+import org.apache.sis.util.ObjectConverters;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.storage.IOUtilities;
 import org.apache.sis.internal.storage.ChannelDataInput;
@@ -358,8 +359,8 @@ public class StorageConnector implements
      * @param  type The desired type as one of {@code ByteBuffer}, {@code DataInput}, {@code Connection}
      *         class or other type supported by {@code StorageConnector} subclasses.
      * @return The storage as a view of the given type, or {@code null} if no view can be created for the given type.
-     * @throws IllegalArgumentException If the given {@code type} argument is not a known type.
-     * @throws DataStoreException If an error occurred while opening a stream or database connection.
+     * @throws IllegalArgumentException if the given {@code type} argument is not a supported type.
+     * @throws DataStoreException if an error occurred while opening a stream or database connection.
      *
      * @see #getStorage()
      * @see #closeAllExcept(Object)
@@ -438,7 +439,7 @@ public class StorageConnector implements
      * If the view can not be created, remember that fact in order to avoid new attempts.
      *
      * @param  asImageInputStream If the {@code ChannelDataInput} needs to be {@link ChannelImageInputStream} subclass.
-     * @throws IOException If an error occurred while opening a channel for the input.
+     * @throws IOException if an error occurred while opening a channel for the input.
      */
     private void createChannelDataInput(final boolean asImageInputStream) throws IOException {
         /*
@@ -483,7 +484,7 @@ public class StorageConnector implements
      * data input may imply creating a {@link ByteBuffer}, in which case the buffer will be stored under
      * the {@code ByteBuffer.class} key together with the {@code DataInput.class} case.
      *
-     * @throws IOException If an error occurred while opening a stream for the input.
+     * @throws IOException if an error occurred while opening a stream for the input.
      */
     private void createDataInput() throws IOException {
         final DataInput asDataInput;
@@ -522,7 +523,7 @@ public class StorageConnector implements
      * of bytes read from the input. This amount is not sufficient, it can be increased by a call
      * to {@link #prefetch()}.
      *
-     * @throws IOException If an error occurred while opening a stream for the input.
+     * @throws IOException if an error occurred while opening a stream for the input.
      */
     private void createByteBuffer() throws IOException, DataStoreException {
         /*
@@ -568,7 +569,7 @@ public class StorageConnector implements
      * for {@link DataStoreProvider#probeContent(StorageConnector)} purpose.</p>
      *
      * @return {@code true} on success.
-     * @throws DataStoreException If an error occurred while reading more bytes.
+     * @throws DataStoreException if an error occurred while reading more bytes.
      */
     final boolean prefetch() throws DataStoreException {
         try {
@@ -605,8 +606,8 @@ public class StorageConnector implements
      *
      * @param  type The type of the view to create.
      * @return The storage as a view of the given type, or {@code null} if no view can be created for the given type.
-     * @throws IllegalArgumentException If the given {@code type} argument is not a known type.
-     * @throws Exception If an error occurred while opening a stream or database connection.
+     * @throws IllegalArgumentException if the given {@code type} argument is not a supported type.
+     * @throws Exception if an error occurred while opening a stream or database connection.
      */
     private Object createView(final Class<?> type) throws IllegalArgumentException, Exception {
         if (type == String.class) {
@@ -673,7 +674,7 @@ public class StorageConnector implements
             }
             return null;
         }
-        throw new IllegalArgumentException(Errors.format(Errors.Keys.UnknownType_1, type));
+        return ObjectConverters.convert(storage, type);
     }
 
     /**
@@ -731,7 +732,7 @@ public class StorageConnector implements
      * <p>This {@code StorageConnector} instance shall not be used anymore after invocation of this method.</p>
      *
      * @param  view The view to leave open, or {@code null} if none.
-     * @throws DataStoreException If an error occurred while closing the stream or database connection.
+     * @throws DataStoreException if an error occurred while closing the stream or database connection.
      *
      * @see #getStorageAs(Class)
      * @see DataStoreProvider#open(StorageConnector)

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ByteArrayChannel.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ByteArrayChannel.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ByteArrayChannel.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ByteArrayChannel.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -32,7 +32,7 @@ import java.nio.channels.SeekableByteCha
  * @author  Rémi Maréchal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.7
  * @module
  *
  * @see ChannelDataOutputTest
@@ -64,9 +64,14 @@ final strictfp class ByteArrayChannel im
      * Creates a channel which will store all written data in the given array.
      *
      * @param data Bytes array where to write the data. The length of this array is the capacity.
+     * @param isContentValid {@code true} if the channel should be initialized with all the {@code data} elements,
+     *        or {@code false} if the channel should be considered initially empty.
      */
-    ByteArrayChannel(final byte[] data) {
+    ByteArrayChannel(final byte[] data, final boolean isDataValid) {
         this.data = data;
+        if (isDataValid) {
+            limit = data.length;
+        }
     }
 
     /**
@@ -80,6 +85,7 @@ final strictfp class ByteArrayChannel im
         }
         final int length = StrictMath.min(dst.remaining(), limit - position);
         dst.put(data, position, length);
+        position += length;
         return length;
     }
 

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelDataOutputTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelDataOutputTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelDataOutputTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelDataOutputTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -82,7 +82,7 @@ public strictfp class ChannelDataOutputT
         referenceStream          = new DataOutputStream(expectedData);
         testedStreamBackingArray = new byte[streamLength];
         testedStream             = new ChannelDataOutput(testName,
-                new ByteArrayChannel(testedStreamBackingArray), ByteBuffer.allocate(bufferLength));
+                new ByteArrayChannel(testedStreamBackingArray, false), ByteBuffer.allocate(bufferLength));
     }
 
     /**

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelImageOutputStreamTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelImageOutputStreamTest.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelImageOutputStreamTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelImageOutputStreamTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -48,7 +48,7 @@ public final strictfp class ChannelImage
         referenceStream          = new MemoryCacheImageOutputStream(expectedData);
         testedStreamBackingArray = new byte[streamLength];
         testedStream             = new ChannelImageOutputStream(fileName,
-                new ByteArrayChannel(testedStreamBackingArray), ByteBuffer.allocate(bufferLength));
+                new ByteArrayChannel(testedStreamBackingArray, false), ByteBuffer.allocate(bufferLength));
     }
 
     /**

Copied: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java (from r1734383, sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java?p2=sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java&p1=sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java&r1=1734383&r2=1734399&rev=1734399&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -109,7 +109,7 @@ public final strictfp class HyperRectang
          * different than zero.
          */
         final int origin = random.nextInt(10);
-        final byte[] array = new byte[origin + length*Short.BYTES];
+        final byte[] array = new byte[origin + length*(Short.SIZE / Byte.SIZE)];
         for (int i=0; i<origin; i++) {
             array[i] = (byte) random.nextInt(0x100);
         }
@@ -117,7 +117,7 @@ public final strictfp class HyperRectang
          * Fill the array with short values using the encoding describes in javadoc.
          * Then wrap the array in a pseudo-channel so we can create the reader to test.
          */
-        ShortBuffer view = ByteBuffer.wrap(array, origin, length*Short.BYTES).order(ByteOrder.nativeOrder()).asShortBuffer();
+        ShortBuffer view = ByteBuffer.wrap(array, origin, length*(Short.SIZE / Byte.SIZE)).order(ByteOrder.nativeOrder()).asShortBuffer();
         for (int i3=0; i3<size[3]; i3++) {
             for (int i2=0; i2<size[2]; i2++) {
                 for (int i1=0; i1<size[1]; i1++) {

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java?rev=1734399&r1=1734398&r2=1734399&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java [UTF-8] Thu Mar 10 12:42:29 2016
@@ -35,6 +35,7 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.storage.ChannelDataOutputTest.class,
     org.apache.sis.internal.storage.ChannelImageInputStreamTest.class,
     org.apache.sis.internal.storage.ChannelImageOutputStreamTest.class,
+    org.apache.sis.internal.storage.HyperRectangleReaderTest.class,
     org.apache.sis.storage.ProbeResultTest.class,
     org.apache.sis.storage.StorageConnectorTest.class,
     org.apache.sis.internal.storage.xml.MimeTypeDetectorTest.class,
@@ -42,6 +43,7 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.storage.xml.StoreTest.class,
     org.apache.sis.internal.storage.wkt.StoreProviderTest.class,
     org.apache.sis.internal.storage.wkt.StoreTest.class,
+    org.apache.sis.internal.storage.csv.StoreTest.class,
     org.apache.sis.storage.DataStoresTest.class,
     org.apache.sis.index.GeoHashCoderTest.class
 })



Mime
View raw message