sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1679630 [3/3] - in /sis/branches/JDK7: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-metadata/src/test/java/org/apache/sis/metadata/ core/sis-metadata/src/test/jav...
Date Fri, 15 May 2015 19:11:11 GMT
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] Fri May 15 19:11:09 2015
@@ -64,12 +64,6 @@ public abstract strictfp class MatrixTes
     protected static final boolean DETERMINIST = !DoubleDouble.DISABLED;
 
     /**
-     * A constant for any test in this class or a subclass which expect
-     * a floating point value to be strictly equals to an other value.
-     */
-    static final double STRICT = 0;
-
-    /**
      * Tolerance factor for comparisons of floating point numbers between SIS and JAMA implementation,
      * which is {@value}. Note that the matrix element values used in this class vary between 0 and 100,
      * and the {@code StrictMath.ulp(100.0)} value is approximatively 1.4E-14.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -47,11 +47,6 @@ import static org.apache.sis.test.Metada
 @DependsOn(DefaultParameterDescriptorGroupTest.class)
 public final strictfp class ContextualParametersTest extends TestCase {
     /**
-     * For floating point comparisons.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * Creates an instance to use for testing purpose.
      */
     private static ContextualParameters create(final int srcDim, final int dstDim) {

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -35,11 +35,6 @@ import static org.opengis.test.Assert.*;
  */
 public final strictfp class MathTransformsTest extends TestCase {
     /**
-     * For floating point comparisons.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * Creates a dummy transform for testing purpose.
      * The transform has the folowing properties:
      *

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -38,11 +38,6 @@ import static org.opengis.test.Assert.*;
 @DependsOn(ExponentialTransform1DTest.class)
 public final class TransferFunctionTest extends TestCase {
     /**
-     * For floating point comparisons.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * Tests the creation of a linear transfer function.
      */
     @Test

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] Fri May 15 19:11:09 2015
@@ -56,11 +56,6 @@ import static org.apache.sis.internal.ut
  */
 public strictfp class ReferencingAssert extends MetadataAssert {
     /**
-     * The tolerance threshold for strict comparisons of floating point values.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * For subclass constructor only.
      */
     protected ReferencingAssert() {
@@ -152,8 +147,8 @@ public strictfp class ReferencingAssert
         assertEquals("name",         name,         axis.getName().getCode());
         assertEquals("abbreviation", abbreviation, axis.getAbbreviation());
         assertEquals("direction",    direction,    axis.getDirection());
-        assertEquals("minimumValue", minimumValue, axis.getMinimumValue(), STRICT);
-        assertEquals("maximumValue", maximumValue, axis.getMaximumValue(), STRICT);
+        assertEquals("minimumValue", minimumValue, axis.getMinimumValue(), TestCase.STRICT);
+        assertEquals("maximumValue", maximumValue, axis.getMaximumValue(), TestCase.STRICT);
         assertEquals("unit",         unit,         axis.getUnit());
         assertEquals("rangeMeaning", rangeMeaning, axis.getRangeMeaning());
     }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -61,11 +61,6 @@ import java.nio.charset.StandardCharsets
 })
 public final strictfp class ReferencingInMetadataTest extends XMLTestCase {
     /**
-     * Tolerance threshold for strict floating point comparisons.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * The resource file which contains an XML representation
      * of a {@link Metadata} object with a {@link VerticalCRS}.
      */

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Fri May 15 19:11:09 2015
@@ -91,6 +91,7 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.operation.DefaultFormulaTest.class,
     org.apache.sis.referencing.operation.DefaultOperationMethodTest.class,
     org.apache.sis.referencing.operation.AbstractSingleOperationTest.class,
+    // Other test classes from the 'operation' package after the CRS tests below.
     org.apache.sis.referencing.operation.transform.OperationMethodSetTest.class,
     org.apache.sis.internal.referencing.provider.AffineTest.class,
     org.apache.sis.internal.referencing.provider.LongitudeRotationTest.class,
@@ -128,6 +129,8 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.crs.DefaultGeographicCRSTest.class,
     org.apache.sis.referencing.crs.DefaultVerticalCRSTest.class,
     org.apache.sis.referencing.crs.DefaultTemporalCRSTest.class,
+    org.apache.sis.referencing.operation.DefaultTransformationTest.class,
+    org.apache.sis.referencing.operation.DefaultConversionTest.class,
     org.apache.sis.referencing.crs.DefaultProjectedCRSTest.class,
     org.apache.sis.referencing.crs.DefaultDerivedCRSTest.class,
     org.apache.sis.referencing.crs.SubTypesTest.class,

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java [UTF-8] Fri May 15 19:11:09 2015
@@ -88,7 +88,7 @@ public abstract class TypeRegistration {
         /*
          * Implementation note: do not keep the ServiceLoader in static field because:
          *
-         * 1) It would cache the RegsterableTypes instances, which are not needed after this method call.
+         * 1) It would cache the TypeRegistration instances, which are not needed after this method call.
          * 2) The ClassLoader between different invocations may be different in an OSGi context.
          */
         final ArrayList<Class<?>> types = new ArrayList<>();

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java [UTF-8] Fri May 15 19:11:09 2015
@@ -24,7 +24,7 @@ package org.apache.sis.internal.system;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.6
  * @module
  */
 public final class Semaphores {
@@ -39,11 +39,11 @@ public final class Semaphores {
     public static final byte COMPARING = 1;
 
     /**
-     * A flag to indicate that {@link org.apache.sis.referencing.operation.DefaultSingleOperation}
-     * is querying {@code org.apache.sis.referencing.operation.transform.ConcatenatedTransform} in
-     * the intend to format WKT (normally a {@code "PROJCS"} element).
+     * A flag to indicate that {@link org.apache.sis.referencing.operation.AbstractCoordinateOperation}
+     * is querying parameters of a {@code MathTransform} enclosed in the operation. This is often in the
+     * intend to format WKT of a {@code "ProjectedCRS"} element.
      */
-    public static final byte PROJCS = 2;
+    public static final byte ENCLOSED_IN_OPERATION = 2;
 
     /**
      * A flag to indicate that empty collections should be returned as {@code null}. Returning null
@@ -71,7 +71,7 @@ public final class Semaphores {
     /**
      * Returns {@code true} if the given flag is set.
      *
-     * @param flag One of {@link #COMPARING}, {@link #PROJCS} or other constants.
+     * @param flag One of {@link #COMPARING}, {@link #ENCLOSED_IN_OPERATION} or other constants.
      * @return {@code true} if the given flag is set.
      */
     public static boolean query(final byte flag) {
@@ -82,7 +82,7 @@ public final class Semaphores {
     /**
      * Sets the given flag.
      *
-     * @param flag One of {@link #COMPARING}, {@link #PROJCS} or other constants.
+     * @param flag One of {@link #COMPARING}, {@link #ENCLOSED_IN_OPERATION} or other constants.
      * @return {@code true} if the given flag was already set.
      */
     public static boolean queryAndSet(final byte flag) {
@@ -99,7 +99,7 @@ public final class Semaphores {
     /**
      * Clears the given flag.
      *
-     * @param flag One of {@link #COMPARING}, {@link #PROJCS} or other constants.
+     * @param flag One of {@link #COMPARING}, {@link #ENCLOSED_IN_OPERATION} or other constants.
      */
     public static void clear(final byte flag) {
         final Semaphores s = FLAGS.get();

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] Fri May 15 19:11:09 2015
@@ -50,7 +50,7 @@ import java.util.Objects;
  *
  * <p>Read-only subclasses need to implement the following methods:</p>
  * <ul>
- *   <li>{@link #size()}</li>
+ *   <li>{@link #size()} (not mandatory but recommended)</li>
  *   <li>{@link #get(Object)}</li>
  *   <li>{@link #entryIterator()} (non-standard method)</li>
  * </ul>
@@ -69,7 +69,7 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.6
  * @module
  */
 public abstract class AbstractMap<K,V> implements Map<K,V> {
@@ -133,19 +133,114 @@ public abstract class AbstractMap<K,V> i
     }
 
     /**
+     * An implementation of {@link EntryIterator} which delegates its work to a standard iterator.
+     * Subclasses can modify the {@link #value} or other properties during iteration.
+     *
+     * <p>This method does not implement the {@link #remove()} method, thus assuming an unmodifiable map
+     * (which is consistent with the default implementation of {@link AbstractMap} methods).
+     * Modifiable maps should override {@code remove()} themselves.</p>
+     *
+     * @param <K> The type of keys maintained by the map.
+     * @param <V> The type of mapped values.
+     *
+     * @see AbstractMap#entryIterator()
+     */
+    protected static class IteratorAdapter<K,V> extends EntryIterator<K,V> {
+        /**
+         * The standard iterator on which to delegate the work.
+         * It is safe to change this value before to invoke {@link #next()}.
+         */
+        protected Iterator<Entry<K,V>> it;
+
+        /**
+         * The entry found by the last call to {@link #next()}.
+         */
+        protected Entry<K,V> entry;
+
+        /**
+         * The value of <code>{@linkplain #entry}.getValue()}</code>.
+         * It is safe to change this value after {@link #next()} invocation.
+         */
+        protected V value;
+
+        /**
+         * Creates a new adapter initialized to the entry iterator of the given map.
+         *
+         * @param map The map from which to return entries.
+         */
+        public IteratorAdapter(final Map<K,V> map) {
+            it = map.entrySet().iterator();
+        }
+
+        /**
+         * Moves to the next entry having a non-null value. If this method returns {@code true}, then the
+         * {@link #entry} and {@link #value} fields are set to the properties of the new current entry.
+         * Otherwise (if this method returns {@code false}) the {@link #entry} and {@link #value} fields
+         * are undetermined.
+         *
+         * @return {@inheritDoc}
+         */
+        @Override
+        protected boolean next() {
+            do {
+                if (!it.hasNext()) {
+                    return false;
+                }
+                entry = it.next();
+                value = entry.getValue();
+            } while (value == null);
+            return true;
+        }
+
+        /**
+         * Returns <code>{@linkplain #entry}.getKey()}</code>.
+         *
+         * @return {@inheritDoc}
+         */
+        @Override
+        protected K getKey() {
+            return entry.getKey();
+        }
+
+        /**
+         * Returns {@link #value}, which was itself initialized to <code>{@linkplain #entry}.getValue()}</code>.
+         *
+         * @return {@inheritDoc}
+         */
+        @Override
+        protected V getValue() {
+            return value;
+        }
+    }
+
+    /**
      * For subclass constructors.
      */
     protected AbstractMap() {
     }
 
     /**
+     * Returns the number of key-value mappings in this map.
+     * The default implementation count the number of values returned by {@link #entryIterator()}.
+     * Subclasses should implement a more efficient method.
+     */
+    @Override
+    public int size() {
+        int count = 0;
+        for (final EntryIterator<K,V> it = entryIterator(); it.next();) {
+            if (++count == Integer.MAX_VALUE) break;
+        }
+        return count;
+    }
+
+    /**
      * Returns {@code true} if this map contains no element.
      *
      * @return {@code true} if this map contains no element.
      */
     @Override
     public boolean isEmpty() {
-        return size() == 0;
+        return !entryIterator().next();
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] Fri May 15 19:11:09 2015
@@ -147,7 +147,7 @@ public final class ObjectConverters exte
     }
 
     /**
-     * Returns a map whose whose keys and values are derived <cite>on-the-fly</cite> from the given map.
+     * Returns a map whose keys and values are derived <cite>on-the-fly</cite> from the given map.
      * Conversions from the original entries to the derived entries are performed when needed
      * by invoking the {@link ObjectConverter#apply(Object)} method on the given converters.
      *
@@ -175,7 +175,7 @@ public final class ObjectConverters exte
     }
 
     /**
-     * Returns a map whose whose keys are derived <cite>on-the-fly</cite> from the given map.
+     * Returns a map whose keys are derived <cite>on-the-fly</cite> from the given map.
      * Conversions from the original keys to the derived keys are performed when needed by
      * invoking the {@link ObjectConverter#apply(Object)} method on the given converter.
      *
@@ -203,7 +203,7 @@ public final class ObjectConverters exte
     }
 
     /**
-     * Returns a map whose whose values are derived <cite>on-the-fly</cite> from the given map.
+     * Returns a map whose values are derived <cite>on-the-fly</cite> from the given map.
      * Conversions from the original values to the derived values are performed when needed by
      * invoking the {@link ObjectConverter#apply(Object)} method on the given converter.
      *

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] Fri May 15 19:11:09 2015
@@ -165,7 +165,7 @@ public final class Containers extends St
     }
 
     /**
-     * Returns a map whose whose keys and values are derived <cite>on-the-fly</cite> from the given map.
+     * Returns a map whose keys and values are derived <cite>on-the-fly</cite> from the given map.
      * Conversions from the original entries to the derived entries are performed when needed
      * by invoking the {@link ObjectConverter#apply(Object)} method on the given converters.
      * Those conversions are repeated every time a {@code Map} method is invoked; there is no cache.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Fri May 15 19:11:09 2015
@@ -399,6 +399,11 @@ public final class Errors extends Indexe
         public static final short IncompatibleCoordinateSystemTypes = 44;
 
         /**
+         * Datum of “{1}” shall be “{0}”.
+         */
+        public static final short IncompatibleDatum_2 = 186;
+
+        /**
          * Property “{0}” has an incompatible value.
          */
         public static final short IncompatiblePropertyValue_1 = 45;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Fri May 15 19:11:09 2015
@@ -89,6 +89,7 @@ IllegalRange_2                    = Rang
 IllegalUnicodeCodePoint_2         = Value {1} for \u201c{0}\u201d is not a valid Unicode code point.
 IllegalUnitFor_2                  = Unit of measurement \u201c{1}\u201d is not valid for \u201c{0}\u201d values.
 IncompatibleCoordinateSystemTypes = Incompatible coordinate system types.
+IncompatibleDatum_2               = Datum of \u201c{1}\u201d shall be \u201c{0}\u201d.
 IncompatiblePropertyValue_1       = Property \u201c{0}\u201d has an incompatible value.
 IncompatibleUnit_1                = Unit \u201c{0}\u201d is incompatible with current value.
 IncompatibleUnits_2               = Units \u201c{0}\u201d and \u201c{1}\u201d are incompatible.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Fri May 15 19:11:09 2015
@@ -79,6 +79,7 @@ IllegalRange_2                    = La p
 IllegalUnicodeCodePoint_2         = La valeur {1} de \u00ab\u202f{0}\u202f\u00bb n\u2019est pas un code Unicode valide.
 IllegalUnitFor_2                  = L\u2019unit\u00e9 de mesure \u00ab\u202f{1}\u202f\u00bb n\u2019est pas valide pour les valeurs de \u00ab\u202f{0}\u202f\u00bb.
 IncompatibleCoordinateSystemTypes = Types de syst\u00e8mes de coordonn\u00e9es incompatibles.
+IncompatibleDatum_2               = Le r\u00e9f\u00e9rentiel de \u00ab\u202f{1}\u202f\u00bb doit \u00eatre \u00ab\u202f{0}\u202f\u00bb.
 IncompatiblePropertyValue_1       = La valeur de la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est pas compatible.
 IncompatibleUnit_1                = L\u2019unit\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est pas compatible avec la valeur actuelle.
 IncompatibleUnits_2               = Les unit\u00e9s \u00ab\u202f{0}\u202f\u00bb et \u00ab\u202f{1}\u202f\u00bb ne sont pas compatibles.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] Fri May 15 19:11:09 2015
@@ -423,14 +423,16 @@ public final class XML extends Static {
 
     /**
      * Unmarshall an object from the given string.
+     * Note that the given argument is the XML document itself,
+     * <strong>not</strong> a URL to a XML document.
      *
-     * @param  input The XML representation of an object.
+     * @param  xml The XML representation of an object.
      * @return The object unmarshalled from the given input.
      * @throws JAXBException If an error occurred during the unmarshalling.
      */
-    public static Object unmarshal(final String input) throws JAXBException {
-        ensureNonNull("input", input);
-        final StringReader in = new StringReader(input);
+    public static Object unmarshal(final String xml) throws JAXBException {
+        ensureNonNull("input", xml);
+        final StringReader in = new StringReader(xml);
         final MarshallerPool pool = getPool();
         final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
         final Object object = unmarshaller.unmarshal(in);

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -50,7 +50,6 @@ public final strictfp class AbstractMapT
         private final List<String> values = new ArrayList<>(Arrays.asList("one", "two", "three"));
 
         @Override public    void    clear   ()                    {       values.clear();}
-        @Override public    int     size    ()                    {return values.size();}
         @Override public    String  get     (Object  k)           {return values.get(((Integer) k) - 1);}
         @Override public    String  put     (Integer k, String v) {return values.set(k - 1, v);}
         @Override protected boolean addKey  (Integer k)           {return values.add(k == 4 ? "four" : "other");}
@@ -58,7 +57,7 @@ public final strictfp class AbstractMapT
         @Override protected EntryIterator<Integer,String> entryIterator() {
             return new EntryIterator<Integer,String>() {
                 private int key;
-                @Override protected boolean next()     {return ++key <= size();}
+                @Override protected boolean next()     {return ++key <= values.size();}
                 @Override protected Integer getKey()   {return key;}
                 @Override protected String  getValue() {return get(key);}
             };
@@ -68,15 +67,16 @@ public final strictfp class AbstractMapT
     /**
      * Tests {@link AbstractMap#keySet()}, {@link AbstractMap#values()} and {@link AbstractMap#entrySet()}.
      * This method will also opportunistically tests basic methods like {@link AbstractMap#isEmpty()} and
-     * {@link AbstractMap#containsValue(Object)}. This test does not write in the map.
+     * {@link AbstractMap#containsValue(Object)}. This test does not add new values in the map.
      */
     @Test
     public void testReadOnly() {
         final Count map = new Count();
-        assertFalse("isEmpty",       map.isEmpty());
-        assertTrue ("containsKey",   map.containsKey(3));
-        assertTrue ("containsValue", map.containsValue("three"));
-        assertFalse("containsValue", map.containsValue("six"));
+        assertEquals("size", 3,       map.size());
+        assertFalse ("isEmpty",       map.isEmpty());
+        assertTrue  ("containsKey",   map.containsKey(3));
+        assertTrue  ("containsValue", map.containsValue("three"));
+        assertFalse ("containsValue", map.containsValue("six"));
 
         final Collection<Integer> keys = map.keySet();
         assertTrue("contains", keys.contains(3));
@@ -97,11 +97,15 @@ public final strictfp class AbstractMapT
                 }, entries.toArray());
 
         map.clear();
-        assertFalse("containsValue", map.containsValue("three"));
-        assertTrue ("isEmpty", map.isEmpty());
-        assertTrue ("isEmpty", keys.isEmpty());
-        assertTrue ("isEmpty", values.isEmpty());
-        assertTrue ("isEmpty", entries.isEmpty());
+        assertFalse ("containsValue", map.containsValue("three"));
+        assertTrue  ("isEmpty", map    .isEmpty());
+        assertTrue  ("isEmpty", keys   .isEmpty());
+        assertTrue  ("isEmpty", values .isEmpty());
+        assertTrue  ("isEmpty", entries.isEmpty());
+        assertEquals("size", 0, map    .size());
+        assertEquals("size", 0, keys   .size());
+        assertEquals("size", 0, values .size());
+        assertEquals("size", 0, entries.size());
     }
 
     /**
@@ -112,7 +116,9 @@ public final strictfp class AbstractMapT
     @DependsOnMethod("testReadOnly")
     public void testAddKey() {
         final Count map = new Count();
+        assertEquals("size", 3, map.size());
         assertTrue(map.keySet().add(4));
+        assertEquals("size", 4, map.size());
         assertArrayEquals("entrySet", new SimpleEntry<?,?>[] {
                     new SimpleEntry<>(1, "one"),
                     new SimpleEntry<>(2, "two"),
@@ -129,7 +135,9 @@ public final strictfp class AbstractMapT
     @DependsOnMethod("testReadOnly")
     public void testAddValue() {
         final Count map = new Count();
+        assertEquals("size", 3, map.size());
         assertTrue(map.values().add("quatre"));
+        assertEquals("size", 4, map.size());
         assertArrayEquals("entrySet", new SimpleEntry<?,?>[] {
                     new SimpleEntry<>(1, "one"),
                     new SimpleEntry<>(2, "two"),

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -63,11 +63,6 @@ public final strictfp class DoubleDouble
     private static final double PRODUCT_TOLERANCE_FACTOR = 1E-15;
 
     /**
-     * Tolerance threshold for strict comparisons of floating point values.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * The random number generator to use for the test.
      */
     private final Random random = TestUtilities.createRandomNumberGenerator();

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -40,11 +40,6 @@ import static org.apache.sis.math.Decima
 @DependsOn(org.apache.sis.internal.util.NumericsTest.class)
 public final strictfp class DecimalFunctionsTest extends TestCase {
     /**
-     * Tolerance threshold for strict comparisons of floating point values.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * Verifies the values of {@link DecimalFunctions#EXPONENT_FOR_ZERO}.
      */
     @Test

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -45,11 +45,6 @@ import org.apache.sis.internal.jdk8.JDK8
 })
 public final strictfp class MathFunctionsTest extends TestCase {
     /**
-     * Tolerance threshold for strict comparisons of floating point values.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * Small number for floating point comparisons.
      */
     private static final double EPS = 1E-12;

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -52,11 +52,6 @@ public final strictfp class StatisticsTe
     private static final double EPS = 1E-10;
 
     /**
-     * Tolerance threshold for strict comparisons of floating point values.
-     */
-    private static final double STRICT = 0;
-
-    /**
      * Tests the initial state of newly constructed instance.
      */
     @Test

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] Fri May 15 19:11:09 2015
@@ -56,6 +56,16 @@ import static org.apache.sis.test.TestCo
 @RunWith(TestRunner.class)
 public abstract strictfp class TestCase {
     /**
+     * Tolerance threshold for strict comparisons of floating point numbers.
+     * This constant can be used like below, where {@code expected} and {@code actual} are {@code double} values:
+     *
+     * {@preformat java
+     *     assertEquals(expected, actual, STRICT);
+     * }
+     */
+    protected static final double STRICT = 0;
+
+    /**
      * A flag for code that are pending future SIS development before to be enabled.
      * This flag is always set to {@code false}. It shall be used as below:
      *

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java [UTF-8] Fri May 15 19:11:09 2015
@@ -25,6 +25,7 @@ import java.util.*;
 import org.apache.sis.feature.DefaultAttributeType;
 import org.apache.sis.feature.DefaultFeatureType;
 import org.apache.sis.internal.shapefile.jdbc.*;
+import org.apache.sis.storage.shapefile.InvalidShapefileFormatException;
 import org.apache.sis.storage.shapefile.ShapeTypeEnum;
 import org.opengis.feature.Feature;
 
@@ -38,7 +39,7 @@ import com.esri.core.geometry.*;
  * @since   0.5
  * @module
  */
-public class ShapefileByteReader extends CommonByteReader<InvalidShapefileFormatException, ShapefileNotFoundException> {
+public class ShapefileByteReader extends CommonByteReader<InvalidShapefileFormatException, SQLShapefileNotFoundException> {
     /** Name of the Geometry field. */
     private static final String GEOMETRY_NAME = "geometry";
 
@@ -56,12 +57,12 @@ public class ShapefileByteReader extends
      * @param shapefile Shapefile.
      * @param dbaseFile underlying database file name.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws InvalidDbaseFileFormatException if the database file format is invalid.
-     * @throws ShapefileNotFoundException if the shapefile has not been found.
-     * @throws DbaseFileNotFoundException if the database file has not been found.
+     * @throws SQLInvalidDbaseFileFormatException if the database file format is invalid.
+     * @throws SQLShapefileNotFoundException if the shapefile has not been found.
+     * @throws SQLDbaseFileNotFoundException if the database file has not been found.
      */
-    public ShapefileByteReader(File shapefile, File dbaseFile) throws InvalidShapefileFormatException, InvalidDbaseFileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException {
-        super(shapefile, InvalidShapefileFormatException.class, ShapefileNotFoundException.class);
+    public ShapefileByteReader(File shapefile, File dbaseFile) throws InvalidShapefileFormatException, SQLInvalidDbaseFileFormatException, SQLShapefileNotFoundException, SQLDbaseFileNotFoundException {
+        super(shapefile, InvalidShapefileFormatException.class, SQLShapefileNotFoundException.class);
         loadDatabaseFieldDescriptors(dbaseFile);
         loadDescriptor();
 
@@ -129,10 +130,10 @@ public class ShapefileByteReader extends
     /**
      * Load database field descriptors.
      * @param dbaseFile Database file.
-     * @throws InvalidDbaseFileFormatException if the database format is incorrect.
-     * @throws DbaseFileNotFoundException if the database file cannot be found.
+     * @throws SQLInvalidDbaseFileFormatException if the database format is incorrect.
+     * @throws SQLDbaseFileNotFoundException if the database file cannot be found.
      */
-    private void loadDatabaseFieldDescriptors(File dbaseFile) throws InvalidDbaseFileFormatException, DbaseFileNotFoundException {
+    private void loadDatabaseFieldDescriptors(File dbaseFile) throws SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException {
         MappedByteReader databaseReader = null;
 
         try {

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java [UTF-8] Fri May 15 19:11:09 2015
@@ -32,7 +32,7 @@ import java.util.logging.Level;
  * @since   0.5
  * @module
  */
-abstract class AbstractDbase3ByteReader extends CommonByteReader<InvalidDbaseFileFormatException, DbaseFileNotFoundException> implements Dbase3ByteReader {
+abstract class AbstractDbase3ByteReader extends CommonByteReader<SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException> implements Dbase3ByteReader {
     /** Number of bytes in the header. */
     protected short dbaseHeaderBytes;
 
@@ -92,11 +92,11 @@ abstract class AbstractDbase3ByteReader
     /**
      * Map a dbf file.
      * @param file Database file.
-     * @throws DbaseFileNotFoundException if the DBF file has not been found.
-     * @throws InvalidDbaseFileFormatException if the database has an invalid format.
+     * @throws SQLDbaseFileNotFoundException if the DBF file has not been found.
+     * @throws SQLInvalidDbaseFileFormatException if the database has an invalid format.
      */
-    public AbstractDbase3ByteReader(File file) throws DbaseFileNotFoundException, InvalidDbaseFileFormatException {
-        super(file, InvalidDbaseFileFormatException.class, DbaseFileNotFoundException.class);
+    public AbstractDbase3ByteReader(File file) throws SQLDbaseFileNotFoundException, SQLInvalidDbaseFileFormatException {
+        super(file, SQLInvalidDbaseFileFormatException.class, SQLDbaseFileNotFoundException.class);
     }
 
     /**
@@ -135,11 +135,11 @@ abstract class AbstractDbase3ByteReader
      * Convert the binary code page value of the Dbase 3 file to a recent Charset.
      * @param codePageBinaryValue page code binary value.
      * @return Charset.
-     * @throws InvalidDbaseFileFormatException if the binary value is not one of the standard values that the DBF file should carry : the Dbase 3
+     * @throws SQLInvalidDbaseFileFormatException if the binary value is not one of the standard values that the DBF file should carry : the Dbase 3
      * file might be corrupted.
      * @throws UnsupportedCharsetException if the code page as no representation in recents Charset (legacy DOS or macintosh charsets).
      */
-    protected Charset toCharset(byte codePageBinaryValue) throws InvalidDbaseFileFormatException, UnsupportedCharsetException {
+    protected Charset toCharset(byte codePageBinaryValue) throws SQLInvalidDbaseFileFormatException, UnsupportedCharsetException {
         // Attempt to find a known conversion.
         String dbfCodePage = toCodePage(codePageBinaryValue);
 
@@ -162,7 +162,7 @@ abstract class AbstractDbase3ByteReader
         // If the code page is invalid, the database itself has chances to be invalid too.
         if (dbfCodePage.equals("invalid")) {
             String message = format(Level.WARNING, "excp.illegal_codepage", codePageBinaryValue, getFile().getAbsolutePath());
-            throw new InvalidDbaseFileFormatException(message);
+            throw new SQLInvalidDbaseFileFormatException(message);
         }
 
         // If the code page cannot find a match for a more recent Charset, we wont be able to handle this DBF.

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java [UTF-8] Fri May 15 19:11:09 2015
@@ -63,13 +63,13 @@ public class DBFDriver extends AbstractJ
      * @param  url  The path to a {@code .dbf} file.
      * @param  info Ignored in current implementation.
      * @return A connection to the given DBF file.
-     * @throws InvalidDbaseFileFormatException if the database file format is invalid.
-     * @throws DbaseFileNotFoundException if the database file doesn't exist.
-     * @throws InvalidDbaseFileFormatException if the database file has a wrong format.
+     * @throws SQLInvalidDbaseFileFormatException if the database file format is invalid.
+     * @throws SQLDbaseFileNotFoundException if the database file doesn't exist.
+     * @throws SQLInvalidDbaseFileFormatException if the database file has a wrong format.
      */
     @Override
     @SuppressWarnings("resource") // the function opens a connection.
-    public Connection connect(final String url, @SuppressWarnings("unused") Properties info) throws InvalidDbaseFileFormatException, DbaseFileNotFoundException {
+    public Connection connect(final String url, @SuppressWarnings("unused") Properties info) throws SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException {
         Objects.requireNonNull(url, "the DBase3 url cannot be null");
         File file = new File(url);
 

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java [UTF-8] Fri May 15 19:11:09 2015
@@ -42,10 +42,10 @@ public class MappedByteReader extends Ab
     /**
      * Construct a mapped byte reader on a file.
      * @param dbase3File File.
-     * @throws InvalidDbaseFileFormatException if the database seems to be invalid.
-     * @throws DbaseFileNotFoundException if the Dbase file has not been found.
+     * @throws SQLInvalidDbaseFileFormatException if the database seems to be invalid.
+     * @throws SQLDbaseFileNotFoundException if the Dbase file has not been found.
      */
-    public MappedByteReader(File dbase3File) throws InvalidDbaseFileFormatException, DbaseFileNotFoundException {
+    public MappedByteReader(File dbase3File) throws SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException {
         super(dbase3File);
         loadDescriptor();
     }
@@ -115,9 +115,9 @@ public class MappedByteReader extends Ab
 
     /**
      * Loading the database file content from binary .dbf file.
-     * @throws InvalidDbaseFileFormatException if descriptor is not readable.
+     * @throws SQLInvalidDbaseFileFormatException if descriptor is not readable.
      */
-    private void loadDescriptor() throws InvalidDbaseFileFormatException {
+    private void loadDescriptor() throws SQLInvalidDbaseFileFormatException {
         try {
             this.dbaseVersion = getByteBuffer().get();
             getByteBuffer().get(this.dbaseLastUpdate);
@@ -152,7 +152,7 @@ public class MappedByteReader extends Ab
             // If the last character read after the field descriptor isn't 0x0D, the expected mark has not been found and the DBF is corrupted.
             if (descriptorTerminator != 0x0D) {
                 String message = format(Level.WARNING, "excp.filedescriptor_problem", getFile().getAbsolutePath(), "Character marking the end of the fields descriptors (0x0D) has not been found.");
-                throw new InvalidDbaseFileFormatException(message);
+                throw new SQLInvalidDbaseFileFormatException(message);
             }
         }
         catch(BufferUnderflowException e) {
@@ -161,7 +161,7 @@ public class MappedByteReader extends Ab
             // Therefore, an internal structure problem cause maybe a premature End of file or anything else, but the only thing
             // we can conclude is : we are not before a device trouble, but a file format trouble.
             String message = format(Level.WARNING, "excp.filedescriptor_problem", getFile().getAbsolutePath(), e.getMessage());
-            throw new InvalidDbaseFileFormatException(message);
+            throw new SQLInvalidDbaseFileFormatException(message);
         }
     }
 

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java [UTF-8] Fri May 15 19:11:09 2015
@@ -50,17 +50,17 @@ public class DBFConnection extends Abstr
      * Constructs a connection to the given database.
      * @param datafile Data file ({@code .dbf} extension).
      * @param br Byte reader to use for reading binary content.
-     * @throws DbaseFileNotFoundException if the Database file cannot be found or is not a file.
+     * @throws SQLDbaseFileNotFoundException if the Database file cannot be found or is not a file.
      */
-    public DBFConnection(final File datafile, Dbase3ByteReader br) throws DbaseFileNotFoundException {
+    public DBFConnection(final File datafile, Dbase3ByteReader br) throws SQLDbaseFileNotFoundException {
         // Check that file exists.
         if (!datafile.exists()) {
-            throw new DbaseFileNotFoundException(format(Level.WARNING, "excp.file_not_found", datafile.getAbsolutePath()));
+            throw new SQLDbaseFileNotFoundException(format(Level.WARNING, "excp.file_not_found", datafile.getAbsolutePath()));
         }
 
         // Check that its not a directory.
         if (datafile.isDirectory()) {
-            throw new DbaseFileNotFoundException(format(Level.WARNING, "excp.directory_not_expected", datafile.getAbsolutePath()));
+            throw new SQLDbaseFileNotFoundException(format(Level.WARNING, "excp.directory_not_expected", datafile.getAbsolutePath()));
         }
 
        databaseFile = datafile;

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java [UTF-8] Fri May 15 19:11:09 2015
@@ -410,8 +410,17 @@ public class DBFRecordBasedResultSet ext
      * @see org.apache.sis.internal.shapefile.jdbc.resultset.DBFResultSet#getObject(java.lang.String)
      */
     @Override
-    public Object getObject(String columnLabel) throws SQLConnectionClosedException, SQLIllegalColumnIndexException, SQLFeatureNotSupportedException, SQLNoSuchFieldException, SQLNotNumericException, SQLNotDateException {
-        return getObject(findColumn(columnLabel));
+    public Object getObject(String columnLabel) throws SQLConnectionClosedException, SQLFeatureNotSupportedException, SQLNoSuchFieldException, SQLNotNumericException, SQLNotDateException {
+        int index = -1;
+        
+        try {
+            index = findColumn(columnLabel);
+            return getObject(index);
+        }
+        catch(SQLIllegalColumnIndexException e) {
+            String message = format(Level.SEVERE, "assert.wrong_index_for_column_name", index, columnLabel);
+            throw new RuntimeException(message, e);
+        }
     }
 
     /**

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java [UTF-8] Fri May 15 19:11:09 2015
@@ -19,12 +19,12 @@ package org.apache.sis.storage.shapefile
 import java.io.File;
 import java.io.InputStream;
 import java.sql.SQLFeatureNotSupportedException;
-import java.text.*;
+import java.text.DecimalFormat;
+import java.text.MessageFormat;
 
 import org.apache.sis.feature.DefaultFeatureType;
-import org.apache.sis.internal.shapefile.InvalidShapefileFormatException;
+import org.apache.sis.internal.shapefile.SQLShapefileNotFoundException;
 import org.apache.sis.internal.shapefile.ShapefileByteReader;
-import org.apache.sis.internal.shapefile.ShapefileNotFoundException;
 import org.apache.sis.internal.shapefile.jdbc.*;
 import org.apache.sis.internal.shapefile.jdbc.connection.DBFConnection;
 import org.apache.sis.internal.shapefile.jdbc.metadata.DBFDatabaseMetaData;
@@ -33,6 +33,7 @@ import org.apache.sis.internal.shapefile
 import org.apache.sis.internal.shapefile.jdbc.sql.SQLInvalidStatementException;
 import org.apache.sis.internal.shapefile.jdbc.sql.SQLUnsupportedParsingFeatureException;
 import org.apache.sis.internal.shapefile.jdbc.statement.DBFStatement;
+import org.apache.sis.storage.DataStoreClosedException;
 import org.opengis.feature.Feature;
 
 /**
@@ -75,27 +76,44 @@ public class InputFeatureStream extends
      * Create an input stream of features over a connection.
      * @param shpfile Shapefile.
      * @param dbaseFile Database file.
-     * @throws SQLInvalidStatementException if the given SQL Statement is invalid.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
      * @throws InvalidDbaseFileFormatException if the Dbase file format is invalid.
      * @throws ShapefileNotFoundException if the shapefile has not been found.
      * @throws DbaseFileNotFoundException if the database file has not been found.
      */
-    public InputFeatureStream(File shpfile, File dbaseFile) throws SQLInvalidStatementException, InvalidDbaseFileFormatException, InvalidShapefileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException {
-        connection = (DBFConnection)new DBFDriver().connect(dbaseFile.getAbsolutePath(), null);
-        sql = MessageFormat.format("SELECT * FROM {0}", dbaseFile.getName());
-        shapefile = shpfile;
-        databaseFile = dbaseFile;
-
-        shapefileReader = new ShapefileByteReader(shapefile, databaseFile);
-        featuresType = shapefileReader.getFeaturesType();
-
+    public InputFeatureStream(File shpfile, File dbaseFile) throws InvalidDbaseFileFormatException, InvalidShapefileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException {
         try {
-            executeQuery();
+            connection = (DBFConnection)new DBFDriver().connect(dbaseFile.getAbsolutePath(), null);
+            sql = MessageFormat.format("SELECT * FROM {0}", dbaseFile.getName());
+            shapefile = shpfile;
+            databaseFile = dbaseFile;
+    
+            shapefileReader = new ShapefileByteReader(shapefile, databaseFile);
+            featuresType = shapefileReader.getFeaturesType();
+    
+            try {
+                executeQuery();
+            }
+            catch(SQLConnectionClosedException e) {
+                // This would be an internal trouble because in this function (at least) it should be open.
+                throw new RuntimeException(e.getMessage(), e);
+            }
+            catch(SQLInvalidStatementException e) {
+                // This would be an internal trouble because if any SQL statement is executed for the dbase file initialization, it should has a correct syntax or grammar.
+                throw new RuntimeException(e.getMessage(), e);
+            }
         }
-        catch(SQLConnectionClosedException e) {
-            // This would be an internal trouble because in this function (at least) it should be open.
-            throw new RuntimeException(e.getMessage(), e);
+        catch(SQLInvalidDbaseFileFormatException ex) {
+            // Promote this exception to an DataStoreException compatible exception.
+            throw new InvalidDbaseFileFormatException(ex.getMessage(), ex);
+        }
+        catch(SQLDbaseFileNotFoundException ex) {
+            // Promote this exception to an DataStoreException compatible exception.
+            throw new DbaseFileNotFoundException(ex.getMessage(), ex);
+        }
+        catch(SQLShapefileNotFoundException ex) {
+            // Promote this exception to an DataStoreException compatible exception.
+            throw new ShapefileNotFoundException(ex.getMessage(), ex);
         }
     }
 
@@ -126,7 +144,30 @@ public class InputFeatureStream extends
     }
 
     /**
-     * Read next feature responding to the SQL request.
+     * Read next feature responding to the SQL query.
+     * @return Feature, null if no more feature is available.
+     * @throws DataStoreClosedException if the current connection used to query the shapefile has been closed.
+     * @throws DataStoreQueryException if the statement used to query the shapefile content is incorrect.
+     * @throws DataStoreQueryResultException if the shapefile results cause a trouble (wrong format, for example).
+     * @throws InvalidShapefileFormatException if the shapefile structure shows a problem.
+     */
+    public Feature readFeature() throws DataStoreClosedException, DataStoreQueryException, DataStoreQueryResultException, InvalidShapefileFormatException {
+        try {
+            return internalReadFeature();
+        }
+        catch(SQLConnectionClosedException e) {
+            throw new DataStoreClosedException(e.getMessage(), e);
+        }
+        catch(SQLInvalidStatementException | SQLIllegalParameterException | SQLNoSuchFieldException | SQLUnsupportedParsingFeatureException | SQLFeatureNotSupportedException e) {
+            throw new DataStoreQueryException(e.getMessage(), e);
+        }
+        catch(SQLNotNumericException | SQLNotDateException e) {
+            throw new DataStoreQueryResultException(e.getMessage(), e);
+        }
+    }
+    
+    /**
+     * Read next feature responding to the SQL query.
      * @return Feature, null if no more feature is available.
      * @throws SQLNotNumericException if a field expected numeric isn't.
      * @throws SQLNotDateException if a field expected of date kind, isn't.
@@ -135,11 +176,10 @@ public class InputFeatureStream extends
      * @throws SQLInvalidStatementException if the SQL statement is invalid.
      * @throws SQLConnectionClosedException if the connection is closed.
      * @throws SQLUnsupportedParsingFeatureException if a SQL ability is not currently available through this driver.
-     * @throws SQLIllegalColumnIndexException if a column index is illegal.
      * @throws SQLFeatureNotSupportedException if a SQL ability is not currently available through this driver.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
      */
-    public Feature readFeature() throws SQLConnectionClosedException, SQLInvalidStatementException, SQLIllegalParameterException, SQLNoSuchFieldException, SQLUnsupportedParsingFeatureException, SQLNotNumericException, SQLNotDateException, SQLFeatureNotSupportedException, SQLIllegalColumnIndexException, InvalidShapefileFormatException {
+    private Feature internalReadFeature() throws SQLConnectionClosedException, SQLInvalidStatementException, SQLIllegalParameterException, SQLNoSuchFieldException, SQLUnsupportedParsingFeatureException, SQLNotNumericException, SQLNotDateException, SQLFeatureNotSupportedException, InvalidShapefileFormatException {
         try {
             if (endOfFile) {
                 return null;

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java [UTF-8] Fri May 15 19:11:09 2015
@@ -19,13 +19,6 @@ package org.apache.sis.storage.shapefile
 import java.io.File;
 import java.util.Objects;
 
-import org.apache.sis.internal.shapefile.InvalidShapefileFormatException;
-import org.apache.sis.internal.shapefile.ShapefileNotFoundException;
-import org.apache.sis.internal.shapefile.jdbc.DbaseFileNotFoundException;
-import org.apache.sis.internal.shapefile.jdbc.InvalidDbaseFileFormatException;
-import org.apache.sis.internal.shapefile.jdbc.sql.SQLInvalidStatementException;
-// Branch-dependent imports
-
 /**
  * Provides a ShapeFile Reader.
  *
@@ -62,13 +55,12 @@ public class ShapeFile {
     /**
      * Find features corresponding to an SQL request SELECT * FROM database.
      * @return Features
-     * @throws SQLInvalidStatementException if the SQL statement is invalid.
      * @throws DbaseFileNotFoundException if the database file has not been found.
      * @throws ShapefileNotFoundException if the shapefile has not been found.
      * @throws InvalidDbaseFileFormatException if the database file format is invalid.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
      */
-    public InputFeatureStream findAll() throws InvalidDbaseFileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException, SQLInvalidStatementException, InvalidShapefileFormatException {
+    public InputFeatureStream findAll() throws InvalidDbaseFileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException, InvalidShapefileFormatException {
         return new InputFeatureStream(shapeFile, databaseFile);
     }
 }

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties [ISO-8859-1] Fri May 15 19:11:09 2015
@@ -1,3 +1,7 @@
+# Assertion : if this exception is thrown, the involved code that produced it is sure to have a bug.
+#0 : Wrong index returned by findColumn.
+#1 : Field name that caused the wrong calculation. 
+assert.wrong_index_for_column_name=[Erreur interne de l''API] The column index {0}, illegal, has been returned by findColumn for the field ''{1}''.
 
 # Exception : field is not a date. 
 #0 : Field name.

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties [ISO-8859-1] Fri May 15 19:11:09 2015
@@ -1,3 +1,8 @@
+# Assertion : if this exception is thrown, the involved code that produced it is sure to have a bug.
+#0 : Wrong index returned by findColumn.
+#1 : Field name that caused the wrong calculation. 
+assert.wrong_index_for_column_name=[Erreur interne de l''API] L''index de colonne {0}, illégal, a été renvoyé par findColumn pour le champ ''{1}''.
+
 # Exception : field is not a date. 
 #0 : Field name.
 #1 : SQL Query.

Modified: sis/branches/JDK7/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java?rev=1679630&r1=1679629&r2=1679630&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java [UTF-8] Fri May 15 19:11:09 2015
@@ -18,9 +18,8 @@ package org.apache.sis.storage.shapefile
 
 import java.io.File;
 import java.net.URISyntaxException;
-import java.sql.SQLException;
 
-import org.apache.sis.internal.shapefile.InvalidShapefileFormatException;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 import org.opengis.feature.Feature;
@@ -48,11 +47,10 @@ public final strictfp class ShapeFileTes
     /**
      * Test polylines count.
      * @throws URISyntaxException if the resource name is incorrect.
-     * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws SQLException if any SQL Exception occuring.
+     * @throws DataStoreException if a general file reading trouble occurs.
      */
     @Test
-    public void testPolyineCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException {
+    public void testPolyineCount() throws URISyntaxException, DataStoreException {
         ShapeFile shp = new ShapeFile(path("SignedBikeRoute_4326_clipped.shp"));
         readAll(shp);
     }
@@ -60,11 +58,10 @@ public final strictfp class ShapeFileTes
     /**
      * Test polygon count.
      * @throws URISyntaxException if the resource name is incorrect.
-     * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws SQLException if any SQL Exception occuring.
+     * @throws DataStoreException if a general file reading trouble occurs.
      */
      @Test
-     public void testPolygonCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException {
+     public void testPolygonCount() throws URISyntaxException, DataStoreException {
         ShapeFile shp = new ShapeFile(path("ANC90Ply_4326.shp"));
         readAll(shp);
     }
@@ -72,11 +69,10 @@ public final strictfp class ShapeFileTes
      /**
       * Test point count.
       * @throws URISyntaxException if the resource name is incorrect.
-      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-      * @throws SQLException if any SQL Exception occuring.
+      * @throws DataStoreException if a general file reading trouble occurs.
       */
      @Test
-     public void testPointCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException {
+     public void testPointCount() throws URISyntaxException, DataStoreException {
         ShapeFile shp = new ShapeFile(path("ABRALicenseePt_4326_clipped.shp"));
         readAll(shp);
      }
@@ -84,10 +80,9 @@ public final strictfp class ShapeFileTes
     /**
      * Read all the shapefile content.
      * @param shp Shapefile to read.
-     * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws SQLException if any SQL Exception occuring.
+     * @throws DataStoreException if a general file reading trouble occurs.
      */
-    private void readAll(ShapeFile shp) throws SQLException, InvalidShapefileFormatException {
+    private void readAll(ShapeFile shp) throws DataStoreException {
         try(InputFeatureStream is = shp.findAll()) {
             Feature feature = is.readFeature();
 



Mime
View raw message