sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1740146 [7/7] - in /sis/branches/JDK7: ./ core/sis-feature/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/main/java/org/apache/sis/internal/ core/sis-feature/src/main/java/org/apache/sis/internal/feature/ core...
Date Wed, 20 Apr 2016 13:49:35 GMT
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -56,8 +56,9 @@ import static org.apache.sis.internal.ut
  * {@link #nextPrimeNumber(int) nextPrimeNumber}.
  *
  * @author  Martin Desruisseaux (MPO, IRD, Geomatys)
+ * @author  Johann Sorel (Geomatys)
  * @since   0.3
- * @version 0.6
+ * @version 0.7
  * @module
  *
  * @see DecimalFunctions
@@ -132,6 +133,7 @@ public final class MathFunctions extends
      *
      * @see #primeNumberAt(int)
      */
+    @SuppressWarnings("VolatileArrayField")     // Because we will not modify array content.
     private static volatile short[] primes = new short[] {2, 3};
 
     /**
@@ -543,8 +545,7 @@ public final class MathFunctions extends
 
     /**
      * Returns a {@linkplain Float#isNaN(float) NaN} number for the specified ordinal value.
-     * Valid NaN numbers in Java can have bit fields in the ranges listed below.
-     * This method allocates one of valid NaN bit fields to each ordinal value.
+     * Valid NaN numbers in Java can have bit fields in the ranges listed below:
      *
      * <ul>
      *   <li>[{@code 0x7F800001} … {@code 0x7FFFFFFF}], with
@@ -552,9 +553,12 @@ public final class MathFunctions extends
      *   <li>[{@code 0xFF800001} … {@code 0xFFFFFFFF}]</li>
      * </ul>
      *
-     * The relationship between bit fields and ordinal values is implementation dependent and may
-     * change in any future version of the SIS library. The current implementation restricts the
-     * range of allowed ordinal values to a smaller one than the range of all possible NaN values.
+     * Some of those bits, named the <cite>payload</cite>, can be used for storing custom information.
+     * This method maps some of the payload values to each ordinal value.
+     *
+     * <p>The relationship between payload values and ordinal values is implementation dependent and
+     * may change in any future version of the SIS library. The current implementation restricts the
+     * range of allowed ordinal values to a smaller one than the range of all possible values.</p>
      *
      * @param  ordinal The NaN ordinal value, from {@code -0x200000} to {@code 0x1FFFFF} inclusive.
      * @return One of the legal {@linkplain Float#isNaN(float) NaN} values as a float.
@@ -596,6 +600,68 @@ public final class MathFunctions extends
     }
 
     /**
+     * Converts two long bits values containing a IEEE 754 quadruple precision floating point number
+     * to a double precision floating point number. About 17 decimal digits of precision may be lost
+     * due to the {@code double} type having only half the capacity of quadruple precision type.
+     *
+     * <p>Some quadruple precision values can not be represented in double precision and are mapped
+     * to {@code double} values as below:</p>
+     * <ul>
+     *   <li>Values having a magnitude less than {@link Double#MIN_VALUE} are mapped to
+     *       positive or negative zero.</li>
+     *   <li>Values having a magnitude greater than {@link Double#MAX_VALUE} are mapped to
+     *       {@link Double#POSITIVE_INFINITY} or {@link Double#NEGATIVE_INFINITY}.</li>
+     *   <li>All NaN values are currently collapsed to the single "canonical" {@link Double#NaN} value
+     *       (this policy may be revisited in future SIS version).</li>
+     * </ul>
+     *
+     * @param l0 upper part of the quadruple precision floating point number.
+     * @param l1 lower part of the quadruple precision floating point number.
+     * @return double precision approximation.
+     *
+     * @see <a href="https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">Quadruple-precision floating-point format on Wikipedia</a>
+     *
+     * @since 0.7
+     */
+    public static double quadrupleToDouble(long l0, long l1) {
+        // Build double
+        long sig = (l0 & 0x8000000000000000L);
+        long exp = (l0 & 0x7FFF000000000000L) >> 48;
+        l0       = (l0 & 0x0000FFFFFFFFFFFFL);
+        if (exp == 0) {
+            /*
+             * Subnormal number.
+             * Since we convert them to double precision, subnormal numbers can not be represented
+             * as they are smaller than Double.MIN_VALUE. We map them to zero preserving the sign.
+             */
+            return Double.longBitsToDouble(sig);
+        }
+        if (exp == 0x7FFF) {
+            /*
+             * NaN of infinite number.
+             * Mantissa with all bits at 0 is used for infinite.
+             * This is the only special number that we can preserve.
+             */
+            if (l0 == 0 && l1 == 0) {
+                return Double.longBitsToDouble(sig | 0x7FF0000000000000L);
+            }
+            /*
+             * Other NaN values might have a meaning (e.g. NaN(1) = forest, NaN(2) = lake, etc.)
+             * See above toNanFloat(int) and toNaNOrdinal(float) methods. When truncating the value we
+             * might change the meaning, which could cause several issues later. Therefor we conservatively
+             * collapse all NaNs to the default NaN for now (this may be revisited in a future SIS version).
+             */
+            return Double.NaN;
+        }
+        exp -= (16383 - 1023);      //change from 15 bias to 11 bias
+        // Check cases where mantissa excess what double can support
+        if (exp < 0)    return Double.NEGATIVE_INFINITY;
+        if (exp > 2046) return Double.POSITIVE_INFINITY;
+
+        return Double.longBitsToDouble(sig | (exp << 52) | (l0 << 4) | (l1 >>> 60));
+    }
+
+    /**
      * Returns the <var>i</var><sup>th</sup> prime number.
      * This method returns (2, 3, 5, 7, 11, …) for index (0, 1, 2, 3, 4, …).
      *

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -285,7 +285,7 @@ public final class Classes extends Stati
      *
      * @see Class#getInterfaces()
      */
-    @SuppressWarnings({"unchecked","rawtypes"}) // Generic array creation.
+    @SuppressWarnings({"unchecked","rawtypes"})                             // Generic array creation.
     public static <T> Class<? super T>[] getAllInterfaces(final Class<T> type) {
         final Set<Class<?>> interfaces = getInterfaceSet(type);
         return (interfaces != null) ? interfaces.toArray(new Class[interfaces.size()]) : EMPTY_ARRAY;
@@ -370,10 +370,10 @@ next:       for (final Class<?> candidat
                     for (int i=0; i<count; i++) {
                         final Class<?> old = types[i];
                         if (candidate.isAssignableFrom(old)) {
-                            continue next; // A more specialized interface already exists.
+                            continue next;                      // A more specialized interface already exists.
                         }
                         if (old.isAssignableFrom(candidate)) {
-                            types[i] = candidate; // This interface specializes a previous interface.
+                            types[i] = candidate;               // This interface specializes a previous interface.
                             continue next;
                         }
                     }
@@ -501,14 +501,14 @@ next:       for (final Class<?> candidat
      */
     public static Set<Class<?>> findCommonInterfaces(final Class<?> c1, final Class<?> c2) {
         final Set<Class<?>> interfaces = getInterfaceSet(c1);
-        final Set<Class<?>> buffer     = getInterfaceSet(c2); // To be recycled.
+        final Set<Class<?>> buffer     = getInterfaceSet(c2);               // To be recycled.
         if (interfaces == null || buffer == null) {
             return Collections.emptySet();
         }
         interfaces.retainAll(buffer);
         for (Iterator<Class<?>> it=interfaces.iterator(); it.hasNext();) {
             final Class<?> candidate = it.next();
-            buffer.clear(); // Safe because the buffer can not be Collections.EMPTY_SET at this point.
+            buffer.clear();     // Safe because the buffer can not be Collections.EMPTY_SET at this point.
             getInterfaceSet(candidate, buffer);
             if (interfaces.removeAll(buffer)) {
                 it = interfaces.iterator();
@@ -561,9 +561,9 @@ cmp:    for (final Class<?> c : c1) {
                     continue cmp;
                 }
             }
-            return false; // Interface not found in 'c2'.
+            return false;                       // Interface not found in 'c2'.
         }
-        return n == 0; // If n>0, at least one interface was not found in 'c1'.
+        return n == 0;                          // If n>0, at least one interface was not found in 'c1'.
     }
 
     /**

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=1740146&r1=1740145&r2=1740146&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] Wed Apr 20 13:49:33 2016
@@ -244,7 +244,7 @@ public final class Containers extends St
         final Object value = properties.get(key);
         if (value != null && !type.isInstance(value)) {
             throw new IllegalArgumentException(Errors.getResources(properties)
-                    .getString(Errors.Keys.IllegalPropertyClass_2, key, value.getClass()));
+                    .getString(Errors.Keys.IllegalPropertyValueClass_3, key, type, value.getClass()));
         }
         return (T) value;
     }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -261,8 +261,8 @@ public class DefaultRecord implements Re
         if (value != null) {
             final Class<?> valueClass = definition.getValueClass(index);
             if (valueClass != null && !valueClass.isInstance(value)) {
-                throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
-                        name, value.getClass()));
+                throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyValueClass_3,
+                        name, valueClass, value.getClass()));
             }
         }
         Array.set(values, index, value);
@@ -287,8 +287,8 @@ public class DefaultRecord implements Re
             if (value != null) {
                 final Class<?> valueClass = definition.getValueClass(i);
                 if (valueClass != null && !valueClass.isInstance(value)) {
-                    throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
-                            definition.getName(i), value.getClass()));
+                    throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyValueClass_3,
+                            definition.getName(i), valueClass, value.getClass()));
                 }
             }
             Array.set(values, i, value);

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -754,7 +754,7 @@ public final class Types extends Static
             if (value != null) {
                 if (!(value instanceof CharSequence)) {
                     throw new IllegalArgumentException(Errors.getResources(properties)
-                            .getString(Errors.Keys.IllegalPropertyClass_2, key, value.getClass()));
+                            .getString(Errors.Keys.IllegalPropertyValueClass_2, key, value.getClass()));
                 }
                 if (i18n == null) {
                     i18n = (CharSequence) value;

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=1740146&r1=1740145&r2=1740146&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] Wed Apr 20 13:49:33 2016
@@ -454,9 +454,19 @@ public final class Errors extends Indexe
         public static final short IllegalParameterValue_2 = 144;
 
         /**
+         * Property “{0}” can not be of type ‘{1}’.
+         */
+        public static final short IllegalPropertyType_2 = 223;
+
+        /**
          * Property “{0}” does not accept instances of ‘{1}’.
          */
-        public static final short IllegalPropertyClass_2 = 40;
+        public static final short IllegalPropertyValueClass_2 = 40;
+
+        /**
+         * Expected an instance of ‘{1}’ for the “{0}” property, but got an instance of ‘{2}’.
+         */
+        public static final short IllegalPropertyValueClass_3 = 224;
 
         /**
          * Range [{0} … {1}] is not valid.
@@ -519,6 +529,11 @@ public final class Errors extends Indexe
         public static final short InconsistentTableColumns = 48;
 
         /**
+         * Unit of measurement “{0}” is inconsistent with coordinate system axes.
+         */
+        public static final short InconsistentUnitsForCS_1 = 222;
+
+        /**
          * Index {0} is out of bounds.
          */
         public static final short IndexOutOfBounds_1 = 49;
@@ -791,6 +806,11 @@ public final class Errors extends Indexe
         public static final short NonLinearUnit_1 = 84;
 
         /**
+         * The “{0}” sequence is not monotonic.
+         */
+        public static final short NonMonotonicSequence_1 = 221;
+
+        /**
          * Axis directions {0} and {1} are not perpendicular.
          */
         public static final short NonPerpendicularDirections_2 = 85;
@@ -981,6 +1001,11 @@ public final class Errors extends Indexe
         public static final short UnexpectedCharactersAfter_2 = 198;
 
         /**
+         * Text for ‘{0}’ was expected to {1,choice,0#begin|1#end} with “{2}”, but found “{3}”.
+         */
+        public static final short UnexpectedCharactersAtBound_4 = 225;
+
+        /**
          * Unexpected dimension for a coordinate system of type ‘{0}’.
          */
         public static final short UnexpectedDimensionForCS_1 = 212;
@@ -1001,6 +1026,11 @@ public final class Errors extends Indexe
         public static final short UnexpectedFileFormat_2 = 111;
 
         /**
+         * Expected {1} components in “{0}” but found {2}.
+         */
+        public static final short UnexpectedNumberOfComponents_3 = 226;
+
+        /**
          * Parameter “{0}” was not expected.
          */
         public static final short UnexpectedParameter_1 = 152;
@@ -1136,7 +1166,8 @@ public final class Errors extends Indexe
         public static final short UnspecifiedParameterValues = 185;
 
         /**
-         * Can not handle instances of ‘{0}’ because arbitrary implementations are not yet supported.
+         * Can not handle this instance of ‘{0}’ because arbitrary implementations are not yet
+         * supported.
          */
         public static final short UnsupportedImplementation_1 = 127;
 
@@ -1197,9 +1228,9 @@ public final class Errors extends Indexe
     /**
      * Returns resources in the given locale.
      *
-     * @param  locale The locale, or {@code null} for the default locale.
-     * @return Resources in the given locale.
-     * @throws MissingResourceException if resources can't be found.
+     * @param  locale  the locale, or {@code null} for the default locale.
+     * @return resources in the given locale.
+     * @throws MissingResourceException if resources can not be found.
      */
     public static Errors getResources(final Locale locale) throws MissingResourceException {
         return getBundle(Errors.class, locale);

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=1740146&r1=1740145&r2=1740146&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] Wed Apr 20 13:49:33 2016
@@ -100,7 +100,9 @@ IllegalOrdinateRange_3            = The
 IllegalParameterType_2            = Parameter \u201c{0}\u201d can not be of type \u2018{1}\u2019.
 IllegalParameterValue_2           = Parameter \u201c{0}\u201d can not take the \u201c{1}\u201d value.
 IllegalParameterValueClass_3      = Parameter \u201c{0}\u201d does not accept values of \u2018{2}\u2019 type. Expected an instance of \u2018{1}\u2019 or derived type.
-IllegalPropertyClass_2            = Property \u201c{0}\u201d does not accept instances of \u2018{1}\u2019.
+IllegalPropertyType_2             = Property \u201c{0}\u201d can not be of type \u2018{1}\u2019.
+IllegalPropertyValueClass_2       = Property \u201c{0}\u201d does not accept instances of \u2018{1}\u2019.
+IllegalPropertyValueClass_3       = Expected an instance of \u2018{1}\u2019 for the \u201c{0}\u201d property, but got an instance of \u2018{2}\u2019.
 IllegalRange_2                    = Range [{0} \u2026 {1}] is not valid.
 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.
@@ -113,6 +115,7 @@ IncompatibleUnits_2               = Unit
 InconsistentAttribute_2           = Value \u201c{1}\u201d of attribute \u2018{0}\u2019 is inconsistent with other attributes.
 InconsistentNamespace_2           = Expected \u201c{0}\u201d namespace for \u201c{1}\u201d.
 InconsistentTableColumns          = Inconsistent table columns.
+InconsistentUnitsForCS_1          = Unit of measurement \u201c{0}\u201d is inconsistent with coordinate system axes.
 IdentifierAlreadyBound_1          = Identifier \u201c{0}\u201d is already associated to another object.
 IndexOutOfBounds_1                = Index {0} is out of bounds.
 IndicesOutOfBounds_2              = Indices ({0}, {1}) are out of bounds.
@@ -164,6 +167,7 @@ NonInvertibleTransform            = Tran
 NonAngularUnit_1                  = \u201c{0}\u201d is not an angular unit.
 NonLinearUnit_1                   = \u201c{0}\u201d is not a linear unit.
 NonLinearUnitConversion_2         = Unit conversion from \u201c{0}\u201d to \u201c{1}\u201d is non-linear.
+NonMonotonicSequence_1            = The \u201c{0}\u201d sequence is not monotonic.
 NonPerpendicularDirections_2      = Axis directions {0} and {1} are not perpendicular.
 NonScaleUnit_1                    = \u201c{0}\u201d is not a scale unit.
 NonTemporalUnit_1                 = \u201c{0}\u201d is not a time unit.
@@ -207,10 +211,12 @@ UndefinedOrderingForElements_2    = Orde
 UnexpectedArrayLength_2           = Expected an array of length {0}, but got {1}.
 UnexpectedChange_1                = Unexpected change in \u2018{0}\u2019.
 UnexpectedCharactersAfter_2       = The \u201c{1}\u201d characters after \u201c{0}\u201d was unexpected.
+UnexpectedCharactersAtBound_4     = Text for \u2018{0}\u2019 was expected to {1,choice,0#begin|1#end} with \u201c{2}\u201d, but found \u201c{3}\u201d.
 UnexpectedDimensionForCS_1        = Unexpected dimension for a coordinate system of type \u2018{0}\u2019.
 UnexpectedEndOfFile_1             = Unexpected end of file while reading \u201c{0}\u201d.
 UnexpectedEndOfString_1           = More characters were expected at the end of \u201c{0}\u201d.
 UnexpectedFileFormat_2            = File \u201c{1}\u201d seems to be encoded in an other format than {0}.
+UnexpectedNumberOfComponents_3    = Expected {1} components in \u201c{0}\u201d but found {2}.
 UnexpectedParameter_1             = Parameter \u201c{0}\u201d was not expected.
 UnexpectedTypeForReference_3      = Expected \u201c{0}\u201d to reference an instance of \u2018{1}\u2019, but found an instance of \u2018{2}\u2019.
 UnexpectedValueInElement_2        = Unexpected value \u201c{1}\u201d in \u201c{0}\u201d element.
@@ -238,7 +244,7 @@ UnspecifiedCRS                    = Coor
 UnspecifiedDimensions             = Dimensions have not been specified.
 UnspecifiedFormatForClass_1       = No format is specified for objects of class \u2018{0}\u2019.
 UnspecifiedParameterValues        = Parameter values have not been specified.
-UnsupportedImplementation_1       = Can not handle instances of \u2018{0}\u2019 because arbitrary implementations are not yet supported.
+UnsupportedImplementation_1       = Can not handle this instance of \u2018{0}\u2019 because arbitrary implementations are not yet supported.
 UnsupportedInterpolation_1        = The \u201c{0}\u201d interpolation is unsupported.
 UnsupportedOperation_1            = The \u2018{0}\u2019 operation is unsupported.
 UnsupportedType_1                 = The \u2018{0}\u2019 type is unsupported.

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=1740146&r1=1740145&r2=1740146&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] Wed Apr 20 13:49:33 2016
@@ -97,7 +97,9 @@ IllegalOrdinateRange_3            = La p
 IllegalParameterType_2            = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre du type \u2018{1}\u2019.
 IllegalParameterValue_2           = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas la valeur \u00ab\u202f{1}\u202f\u00bb.
 IllegalParameterValueClass_3      = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas les valeurs de type \u2018{2}\u2019. Une instance de \u2018{1}\u2019 ou d\u2019un type d\u00e9riv\u00e9 \u00e9tait attendue.
-IllegalPropertyClass_2            = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas les valeurs de type \u2018{1}\u2019.
+IllegalPropertyType_2             = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre du type \u2018{1}\u2019.
+IllegalPropertyValueClass_2       = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas les valeurs de type \u2018{1}\u2019.
+IllegalPropertyValueClass_3       = Une instance \u2018{1}\u2019 \u00e9tait attendue pour la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb, mais la valeur donn\u00e9e est une instance de \u2018{2}\u2019.
 IllegalRange_2                    = La plage [{0} \u2026 {1}] n\u2019est pas valide.
 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.
@@ -110,6 +112,7 @@ IncompatibleUnits_2               = Les
 InconsistentAttribute_2           = La valeur \u00ab\u202f{1}\u202f\u00bb de l\u2019attribut \u2018{0}\u2019 n\u2019est pas coh\u00e9rente avec celles des autres attributs.
 InconsistentNamespace_2           = L\u2019espace de nom \u201c{0}\u201d \u00e9tait attendu pour \u201c{1}\u201d.
 InconsistentTableColumns          = Les colonnes des tables ne sont pas coh\u00e9rentes.
+InconsistentUnitsForCS_1          = L\u2019unit\u00e9 de mesure \u00ab\u202f{0}\u202f\u00bb n\u2019est pas coh\u00e9rente avec les axes du syst\u00e8me de coordonn\u00e9es.
 IdentifierAlreadyBound_1          = L\u2019identifiant \u00ab\u202f{0}\u202f\u00bb est d\u00e9j\u00e0 associ\u00e9 \u00e0 un autre objet.
 IndexOutOfBounds_1                = L\u2019index {0} est en dehors des limites permises.
 IndicesOutOfBounds_2              = Les index ({0}, {1}) sont en dehors des limites permises.
@@ -161,6 +164,7 @@ NonInvertibleTransform            = La t
 NonAngularUnit_1                  = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 d\u2019angles.
 NonLinearUnit_1                   = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 de longueurs.
 NonLinearUnitConversion_2         = La conversion des unit\u00e9s \u00ab\u202f{0}\u202f\u00bb vers \u00ab\u202f{1}\u202f\u00bb n\u2019est pas lin\u00e9aire.
+NonMonotonicSequence_1            = La s\u00e9quence \u00ab\u202f{0}\u202f\u00bb n\u2019est pas monotone.
 NonPerpendicularDirections_2      = Les directions {0} et {1} ne sont pas perpendiculaires.
 NonScaleUnit_1                    = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 d\u2019\u00e9chelles.
 NonTemporalUnit_1                 = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 de temps.
@@ -203,9 +207,11 @@ UndefinedOrderingForElements_2    = L\u2
 UnexpectedArrayLength_2           = Un tableau de longueur {0} \u00e9tait attendu, mais le tableau re\u00e7u est de longueur {1}.
 UnexpectedChange_1                = Changement inattendu dans \u2018{0}\u2019.
 UnexpectedCharactersAfter_2       = Les caract\u00e8res \u00ab\u202f{1}\u202f\u00bb apr\u00e8s \u00ab\u202f{0}\u202f\u00bb sont inattendus.
+UnexpectedCharactersAtBound_4     = Le texte pour \u2018{0}\u2019 devait {1,choice,0#commencer|1#finir} par \u00ab\u202f{2}\u202f\u00bb, mais on a trouv\u00e9 \u00ab\u202f{3}\u202f\u00bb.
 UnexpectedDimensionForCS_1        = Dimension inattendue pour un syst\u00e8me de coordonn\u00e9es de type \u2018{0}\u2019.
 UnexpectedEndOfFile_1             = Fin de fichier inattendue lors de la lecture de \u00ab\u202f{0}\u202f\u00bb.
 UnexpectedEndOfString_1           = D\u2019autres caract\u00e8res \u00e9taient attendus \u00e0 la fin du texte \u00ab\u202f{0}\u202f\u00bb.
+UnexpectedNumberOfComponents_3    = Il y a {2} composantes dans \u00ab\u202f{0}\u202f\u00bb alors qu\u2019on en attendait {1}.
 UnexpectedFileFormat_2            = Le fichier \u00ab\u202f{1}\u202f\u00bb semble \u00eatre encod\u00e9 dans un autre format que {0}.
 UnexpectedParameter_1             = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb est inattendu.
 UnexpectedTypeForReference_3      = L\u2019identifiant \u201c{0}\u201d r\u00e9f\u00e9rence une instance de \u2018{2}\u2019 alors qu\u2019on attendait une instance de \u2018{1}\u2019.
@@ -234,7 +240,7 @@ UnparsableStringForClass_2        = Le t
 UnparsableStringForClass_3        = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu comme un objet de type \u2018{0}\u2019, \u00e0 cause des caract\u00e8res \u00ab\u202f{2}\u202f\u00bb.
 UnparsableStringInElement_2       = Le texte \u00ab\u202f{1}\u202f\u00bb dans l\u2019\u00e9l\u00e9ment \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre lu.
 UnresolvedFeatureName_1           = L\u2019entit\u00e9 nomm\u00e9e \u00ab\u202f{0}\u202f\u00bb n\u2019a pas encore \u00e9t\u00e9 r\u00e9solue.
-UnsupportedImplementation_1       = Les instances de \u2018{0}\u2019 ne peuvent pas \u00eatre g\u00e9r\u00e9es parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es.
+UnsupportedImplementation_1       = Cette instance de \u2018{0}\u2019 ne peut pas \u00eatre g\u00e9r\u00e9e parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es.
 UnsupportedInterpolation_1        = L\u2019interpolation \u201c{0}\u201d n\u2019est pas support\u00e9e.
 UnsupportedOperation_1            = L\u2019op\u00e9ration \u2018{0}\u2019 n\u2019est pas support\u00e9e.
 UnsupportedType_1                 = Le type \u2018{0}\u2019 n\u2019est pas support\u00e9.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -431,7 +431,7 @@ public class IndexedResourceBundle exten
     /**
      * If the given class is not public, returns the first public interface or the first public super-class.
      * This is for avoiding confusing the user with private class in message like "Value can not be instance
-     * of XYZ". In the worst case (nothing public other than {@code Object}), returns {@code Object.class}.
+     * of XYZ".
      */
     private static Class<?> getPublicType(Class<?> c) {
         while (!Modifier.isPublic(c.getModifiers())) {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -208,6 +208,16 @@ public final class Messages extends Inde
         public static final short InsertDuration_2 = 40;
 
         /**
+         * Inverse operation uses this parameter value with opposite sign.
+         */
+        public static final short InverseOperationUsesOppositeSign = 42;
+
+        /**
+         * Inverse operation uses the same parameter value.
+         */
+        public static final short InverseOperationUsesSameSign = 43;
+
+        /**
          * No object associated to the “{0}” JNDI name.
          */
         public static final short JNDINotSpecified_1 = 32;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] Wed Apr 20 13:49:33 2016
@@ -44,6 +44,8 @@ IgnoredPropertyAssociatedTo_1    = Ignor
 IgnoredServiceProvider_3         = More than one service provider of type \u2018{0}\u2019 are declared for \u201c{1}\u201d. Only the first provider (an instance of \u2018{2}\u2019) will be used.
 IncompleteParsing_1              = Parsing of \u201c{0}\u201d done, but some elements were ignored.
 InsertDuration_2                 = Inserted {0} records in {1} seconds.
+InverseOperationUsesSameSign     = Inverse operation uses the same parameter value.
+InverseOperationUsesOppositeSign = Inverse operation uses this parameter value with opposite sign.
 JNDINotSpecified_1               = No object associated to the \u201c{0}\u201d JNDI name.
 LoadingDatumShiftFile_1          = Loading datum shift file \u201c{0}\u201d.
 LocalesDiscarded                 = Text were discarded for some locales.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] Wed Apr 20 13:49:33 2016
@@ -51,6 +51,8 @@ IgnoredPropertyAssociatedTo_1    = Une p
 IgnoredServiceProvider_3         = Plusieurs fournisseurs de service de type \u2018{0}\u2019 sont d\u00e9clar\u00e9s pour \u00ab\u202f{1}\u202f\u00bb. Seul le premier fournisseur (une instance de \u2018{2}\u2019) sera utilis\u00e9.
 IncompleteParsing_1              = La lecture de \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9 faite, mais en ignorant certains \u00e9l\u00e9ments.
 InsertDuration_2                 = {0} enregistrements ont \u00e9t\u00e9 ajout\u00e9s en {1} secondes.
+InverseOperationUsesSameSign     = L\u2019op\u00e9ration inverse utilise la m\u00eame valeur pour ce param\u00e8tre.
+InverseOperationUsesOppositeSign = L\u2019op\u00e9ration inverse utilise ce param\u00e8tre avec la valeur de signe oppos\u00e9.
 JNDINotSpecified_1               = Aucun objet n\u2019est associ\u00e9 au nom JNDI \u00ab\u202f{0}\u202f\u00bb.
 LoadingDatumShiftFile_1          = Chargement du fichier de changement de r\u00e9f\u00e9rentiel \u00ab\u202f{0}\u202f\u00bb.
 LocalesDiscarded                 = Des textes ont \u00e9t\u00e9 ignor\u00e9s pour certaines langues.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -17,6 +17,7 @@
 package org.apache.sis.util.resources;
 
 import java.net.URL;
+import java.util.Map;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import javax.annotation.Generated;
@@ -28,7 +29,7 @@ import org.opengis.util.InternationalStr
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.7
  * @module
  */
 public final class Vocabulary extends IndexedResourceBundle {
@@ -191,6 +192,11 @@ public final class Vocabulary extends In
         public static final short DefaultValue = 71;
 
         /**
+         * Derived from {0}
+         */
+        public static final short DerivedFrom_1 = 108;
+
+        /**
          * Description
          */
         public static final short Description = 75;
@@ -626,6 +632,21 @@ public final class Vocabulary extends In
     }
 
     /**
+     * Returns resources in the locale specified in the given property map. This convenience method looks
+     * for the {@link #LOCALE_KEY} entry. If the given map is null, or contains no entry for the locale key,
+     * or the value is not an instance of {@link Locale}, then this method fallback on the default locale.
+     *
+     * @param  properties  the map of properties, or {@code null} if none.
+     * @return resources in the given locale.
+     * @throws MissingResourceException if resources can not be found.
+     *
+     * @since 0.7
+     */
+    public static Vocabulary getResources(final Map<?,?> properties) throws MissingResourceException {
+        return getResources(getLocale(properties));
+    }
+
+    /**
      * Gets a string for the given key from this resource bundle or one of its parents.
      *
      * @param  key The key for the desired string.
@@ -633,7 +654,7 @@ public final class Vocabulary extends In
      * @throws MissingResourceException If no object for the given key can be found.
      */
     public static String format(final short key) throws MissingResourceException {
-        return getResources(null).getString(key);
+        return getResources((Locale) null).getString(key);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] Wed Apr 20 13:49:33 2016
@@ -41,6 +41,7 @@ Datum                   = Datum
 DatumShift              = Datum shift
 DaylightTime            = Daylight time
 DefaultValue            = Default value
+DerivedFrom_1           = Derived from {0}
 Description             = Description
 Destination             = Destination
 Dimensions              = Dimensions

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] Wed Apr 20 13:49:33 2016
@@ -48,6 +48,7 @@ Datum                   = R\u00e9f\u00e9
 DatumShift              = Changement de r\u00e9f\u00e9rentiel
 DaylightTime            = Heure normale
 DefaultValue            = Valeur par d\u00e9faut
+DerivedFrom_1           = D\u00e9riv\u00e9 de {0}
 Description             = Description
 Destination             = Destination
 Dimensions              = Dimensions

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -343,7 +343,7 @@ abstract class Pooled {
                             final Object schema = map.get(key);
                             if (schema != null) {
                                 if (!(schema instanceof String)) {
-                                    throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
+                                    throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyValueClass_2,
                                             name + "[\"" + key + "\"]", value.getClass()));
                                 }
                                 copy.put(key, (String) schema);
@@ -400,7 +400,7 @@ abstract class Pooled {
             }
         } catch (ClassCastException | IllformedLocaleException e) {
             throw new PropertyException(Errors.format(
-                    Errors.Keys.IllegalPropertyClass_2, name, value.getClass()), e);
+                    Errors.Keys.IllegalPropertyValueClass_2, name, value.getClass()), e);
         }
         /*
          * If we reach this point, the given name is not a SIS property. Try to handle

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -96,7 +96,7 @@ final class PooledTemplate extends Poole
         if (value == null) {
             return defaultValue;
         }
-        throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyClass_2, name, value.getClass()));
+        throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyValueClass_2, name, value.getClass()));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -43,7 +43,7 @@ public final strictfp class LazySetTest
      * Creates the set to use for testing purpose.
      */
     private static LazySet<String> create() {
-        return new LazySet<>(Arrays.asList(LABELS));
+        return new LazySet<>(Arrays.asList(LABELS).iterator());
     }
 
     /**

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=1740146&r1=1740145&r2=1740146&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] Wed Apr 20 13:49:33 2016
@@ -35,8 +35,9 @@ import org.apache.sis.internal.jdk8.JDK8
  * Tests the {@link MathFunctions} static methods.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @author  Johann Sorel (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.7
  * @module
  */
 @DependsOn({
@@ -259,6 +260,70 @@ public final strictfp class MathFunction
     }
 
     /**
+     * Tests the {@link MathFunctions#quadrupleToDouble(long, long)} method. Values used in this test are taken from
+     * <a href="https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">Quadruple-precision
+     * floating-point format</a> on Wikipedia.
+     */
+    @Test
+    public void testQuadrupleToDouble(){
+        long l0, l1;
+
+        // 1.0
+        l0 = 0x3FFF000000000000L;
+        l1 = 0x0000000000000000L;
+        assertEquals(doubleToLongBits(1.0),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // -2.0
+        l0 = 0xC000000000000000L;
+        l1 = 0x0000000000000000L;
+        assertEquals(doubleToLongBits(-2.0),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // 3.1415926535897932384626433832795028
+        l0 = 0x4000921FB54442D1L;
+        l1 = 0x8469898CC51701B8L;
+        assertEquals(doubleToLongBits(3.1415926535897932384626433832795028),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // ~1/3
+        l0 = 0x3FFD555555555555L;
+        l1 = 0x5555555555555555L;
+        assertEquals(doubleToLongBits(1.0/3.0),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // positive zero
+        l0 = 0x0000000000000000L;
+        l1 = 0x0000000000000000L;
+        assertEquals(doubleToLongBits(+0.0),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // negative zero
+        l0 = 0x8000000000000000L;
+        l1 = 0x0000000000000000L;
+        assertEquals(doubleToLongBits(-0.0),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // positive infinite
+        l0 = 0x7FFF000000000000L;
+        l1 = 0x0000000000000000L;
+        assertEquals(doubleToLongBits(Double.POSITIVE_INFINITY),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // negative infinite
+        l0 = 0xFFFF000000000000L;
+        l1 = 0x0000000000000000L;
+        assertEquals(doubleToLongBits(Double.NEGATIVE_INFINITY),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+        // a random NaN
+        l0 = 0x7FFF000100040000L;
+        l1 = 0x0001005000080000L;
+        assertEquals(doubleToLongBits(Double.NaN),
+                     doubleToLongBits(quadrupleToDouble(l0, l1)));
+    }
+
+    /**
      * Tests the {@link MathFunctions#primeNumberAt(int)} method.
      */
     @Test

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -229,6 +229,7 @@ public final class TestRunner extends Bl
      *
      * @return The test method to be executed in dependencies order.
      */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
     private FrameworkMethod[] getFilteredChildren() {
         if (filteredChildren == null) {
             final List<FrameworkMethod> children = super.getChildren();

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -45,7 +45,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.7
  * @module
  */
 public final strictfp class TestUtilities extends Static {
@@ -285,7 +285,7 @@ public final strictfp class TestUtilitie
      *   "      └─"
      * }
      *
-     * This method is used for comparing two tree having string representation in different locales.
+     * This method is used for comparing two trees having string representation in different locales.
      * In such case, we can not compare the actual text content. The best we can do is to compare
      * the tree structure.
      *
@@ -341,6 +341,26 @@ public final strictfp class TestUtilitie
     }
 
     /**
+     * Returns a copy of the given array with the last ordinate values dropped for each coordinates.
+     *
+     * @param  coordinates The source coordinates from which to drop the last ordinate values.
+     * @param  sourceDim   Number of dimensions of each point in the {@code coordinates} array.
+     * @param  targetDim   Number of dimensions to retain.
+     * @return Copy of the given {@code coordinates} array with only the {@code targetDim} first dimension for each point.
+     *
+     * @since 0.7
+     */
+    public static double[] dropLastDimensions(final double[] coordinates, final int sourceDim, final int targetDim) {
+        assertEquals("Unexpected array length.", 0, coordinates.length % sourceDim);
+        final int numPts = coordinates.length / sourceDim;
+        final double[] reduced = new double[numPts * targetDim];
+        for (int i=0; i<numPts; i++) {
+            System.arraycopy(coordinates, i*sourceDim, reduced, i*targetDim, targetDim);
+        }
+        return reduced;
+    }
+
+    /**
      * If the given failure is not null, re-thrown it as an {@link Error} or
      * {@link RuntimeException}. Otherwise do nothing.
      *

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=1740146&r1=1740145&r2=1740146&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] Wed Apr 20 13:49:33 2016
@@ -33,10 +33,6 @@ import javax.measure.unit.Unit;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import javax.measure.quantity.Duration;
-import org.opengis.feature.Feature;
-import org.opengis.feature.FeatureType;
-import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
 import org.opengis.metadata.Metadata;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -63,6 +59,10 @@ import org.apache.sis.util.resources.Ind
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.Instant;
 import org.apache.sis.internal.jdk8.DateTimeException;
+import org.opengis.feature.Feature;
+import org.opengis.feature.FeatureType;
+import org.opengis.feature.PropertyType;
+import org.opengis.feature.AttributeType;
 
 
 /**

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java?rev=1740146&r1=1740145&r2=1740146&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java [UTF-8] Wed Apr 20 13:49:33 2016
@@ -18,7 +18,6 @@ package org.apache.sis.internal.storage.
 
 import java.util.Iterator;
 import java.io.StringReader;
-import org.opengis.feature.Feature;
 import org.opengis.metadata.Metadata;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.metadata.extent.SpatialTemporalExtent;
@@ -30,6 +29,9 @@ import org.junit.Test;
 import static org.junit.Assert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
+// Branch-dependent imports
+import org.opengis.feature.Feature;
+
 
 /**
  * Tests {@link Store}.



Mime
View raw message