sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1766508 [3/6] - in /sis/branches/JDK7: ./ application/ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-openoffice/ application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ core/ core/sis-metadata/sr...
Date Tue, 25 Oct 2016 10:45:15 GMT
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -220,7 +220,7 @@ public class InterpolatedMolodenskyTrans
         if (pg != context) {
             Δf = Δfmod / semiMinor;
             pg.getOrCreate(Molodensky.AXIS_LENGTH_DIFFERENCE).setValue(Δa, unit);
-            pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.ONE);
+            pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.UNITY);
         }
         if (grid instanceof DatumShiftGridFile<?,?>) {
             ((DatumShiftGridFile<?,?>) grid).setFileParameters(pg);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -20,7 +20,6 @@ import java.util.Arrays;
 import java.util.Objects;
 import javax.measure.Unit;
 import javax.measure.Quantity;
-import javax.measure.UnitConverter;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
@@ -120,14 +119,14 @@ public class InterpolatedTransform exten
      * <code>{@linkplain #getContextualParameters()}.{@linkplain ContextualParameters#completeTransform
      * completeTransform}(factory, this)}</code>.
      *
-     * @param  <T> Dimension of the coordinate and the translation unit.
-     * @param  grid The grid of datum shifts from source to target datum.
+     * @param  <T>   dimension of the coordinate and the translation unit.
+     * @param  grid  the grid of datum shifts from source to target datum.
      * @throws NoninvertibleMatrixException if the conversion from geodetic coordinates
      *         to grid indices can not be inverted.
      *
      * @see #createGeodeticTransformation(MathTransformFactory, DatumShiftGrid)
      */
-    @SuppressWarnings("OverridableMethodCallDuringObjectConstruction")
+    @SuppressWarnings( {"OverridableMethodCallDuringObjectConstruction", "fallthrough"})
     protected <T extends Quantity<T>> InterpolatedTransform(final DatumShiftGrid<T,T> grid)
             throws NoninvertibleMatrixException
     {
@@ -164,12 +163,15 @@ public class InterpolatedTransform exten
         @SuppressWarnings("unchecked")
         final Unit<T> normalized = Units.isAngular(unit) ? (Unit<T>) Units.DEGREE : unit.getSystemUnit();
         if (!unit.equals(normalized)) {
-            final UnitConverter converter = normalized.getConverterTo(unit);
-            if (!converter.isLinear()) {
-                throw new IllegalArgumentException(Resources.format(Resources.Keys.NonLinearUnitConversion_2, normalized, unit));
+            Number scale  = 1.0;
+            Number offset = 0.0;
+            final Number[] coefficients = Units.coefficients(normalized.getConverterTo(unit));
+            switch (coefficients != null ? coefficients.length : -1) {
+                case 2:  scale  = coefficients[1];       // Fall through
+                case 1:  offset = coefficients[0];       // Fall through
+                case 0:  break;
+                default: throw new IllegalArgumentException(Resources.format(Resources.Keys.NonLinearUnitConversion_2, normalized, unit));
             }
-            final Double offset = converter.convert(0);
-            final Double scale  = Units.derivative(converter, 0);
             for (int j=0; j<dimension; j++) {
                 normalize.convertBefore(j, scale, offset);
             }
@@ -199,13 +201,13 @@ public class InterpolatedTransform exten
      *       coordinates in the unit given by {@link Unit#toSI()}.</li>
      * </ul>
      *
-     * @param <T>      Dimension of the coordinate and the translation unit.
-     * @param factory  The factory to use for creating the transform.
-     * @param grid     The grid of datum shifts from source to target datum.
-     *                 The {@link DatumShiftGrid#interpolateInCell DatumShiftGrid.interpolateInCell(…)}
-     *                 method shall compute translations from <em>source</em> to <em>target</em> as
-     *                 {@linkplain DatumShiftGrid#isCellValueRatio() ratio of offsets divided by cell sizes}.
-     * @return The transformation between geodetic coordinates.
+     * @param  <T>      dimension of the coordinate and the translation unit.
+     * @param  factory  the factory to use for creating the transform.
+     * @param  grid     the grid of datum shifts from source to target datum.
+     *                  The {@link DatumShiftGrid#interpolateInCell DatumShiftGrid.interpolateInCell(…)}
+     *                  method shall compute translations from <em>source</em> to <em>target</em> as
+     *                  {@linkplain DatumShiftGrid#isCellValueRatio() ratio of offsets divided by cell sizes}.
+     * @return the transformation between geodetic coordinates.
      * @throws FactoryException if an error occurred while creating a transform.
      */
     public static <T extends Quantity<T>> MathTransform createGeodeticTransformation(
@@ -229,7 +231,7 @@ public class InterpolatedTransform exten
      * Returns the number of input dimensions.
      * This fixed to {@link DatumShiftGrid#getTranslationDimensions()}.
      *
-     * @return The dimension of input points.
+     * @return the dimension of input points.
      */
     @Override
     public final int getSourceDimensions() {
@@ -240,7 +242,7 @@ public class InterpolatedTransform exten
      * Returns the number of target dimensions.
      * This fixed to {@link DatumShiftGrid#getTranslationDimensions()}.
      *
-     * @return The dimension of output points.
+     * @return the dimension of output points.
      */
     @Override
     public final int getTargetDimensions() {
@@ -353,7 +355,7 @@ public class InterpolatedTransform exten
      * Returns the inverse of this interpolated transform.
      * The source ellipsoid of the returned transform will be the target ellipsoid of this transform, and conversely.
      *
-     * @return A transform from the target ellipsoid to the source ellipsoid of this transform.
+     * @return a transform from the target ellipsoid to the source ellipsoid of this transform.
      */
     @Override
     public MathTransform inverse() {
@@ -429,7 +431,7 @@ public class InterpolatedTransform exten
          * Transforms a single coordinate in a list of ordinal values,
          * and optionally returns the derivative at that location.
          *
-         * @throws TransformException If there is no convergence.
+         * @throws TransformException if there is no convergence.
          */
         @Override
         public final Matrix transform(final double[] srcPts, final int srcOff, double[] dstPts, int dstOff,
@@ -450,7 +452,7 @@ public class InterpolatedTransform exten
                 final double oy = yi;
                 xi = x - vector[0];
                 yi = y - vector[1];
-                if (!(Math.abs(xi - ox) > tolerance ||    // Use '!' for catching NaN.
+                if (!(Math.abs(xi - ox) > tolerance ||          // Use '!' for catching NaN.
                       Math.abs(yi - oy) > tolerance))
                 {
                     if (dimension > GRID_DIMENSION) {
@@ -519,7 +521,7 @@ nextPoint:  while (--numPts >= 0) {
                     final double oy = yi;
                     xi = x - vector[0];
                     yi = y - vector[1];
-                    if (!(Math.abs(xi - ox) > tolerance ||    // Use '!' for catching NaN.
+                    if (!(Math.abs(xi - ox) > tolerance ||          // Use '!' for catching NaN.
                           Math.abs(yi - oy) > tolerance))
                     {
                         if (dimension > GRID_DIMENSION) {
@@ -536,7 +538,7 @@ nextPoint:  while (--numPts >= 0) {
                             do dstPts[dstOff + --i] += vector[i];
                             while (i > GRID_DIMENSION);
                         }
-                        dstPts[dstOff  ] = xi;      // Shall not be done before above loop.
+                        dstPts[dstOff  ] = xi;          // Shall not be done before above loop.
                         dstPts[dstOff+1] = yi;
                         dstOff += inc;
                         srcOff += inc;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -189,7 +189,7 @@ public class MolodenskyTransform extends
         pg.getOrCreate(Molodensky.TY)                    .setValue(tY, unit);
         pg.getOrCreate(Molodensky.TZ)                    .setValue(tZ, unit);
         pg.getOrCreate(Molodensky.AXIS_LENGTH_DIFFERENCE).setValue(Δa, unit);
-        pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.ONE);
+        pg.getOrCreate(Molodensky.FLATTENING_DIFFERENCE) .setValue(Δf, Units.UNITY);
         if (pg != context) {
             pg.parameter("abridged").setValue(isAbridged);  // Only in internal parameters.
         }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -398,10 +398,10 @@ public final strictfp class AxisDirectio
         assertEquals("Z",   AxisDirections.suggestAbbreviation("not needed",             GEOCENTRIC_Z,     Units.METRE));
         assertEquals("D",   AxisDirections.suggestAbbreviation("not needed",             DOWN,             Units.METRE));
         assertEquals("t",   AxisDirections.suggestAbbreviation("not needed",             FUTURE,           Units.DAY));
-        assertEquals("i",   AxisDirections.suggestAbbreviation("not needed",             COLUMN_NEGATIVE,  Units.ONE));
-        assertEquals("j",   AxisDirections.suggestAbbreviation("not needed",             ROW_NEGATIVE,     Units.ONE));
-        assertEquals("x",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_RIGHT,    Units.ONE));
-        assertEquals("y",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_DOWN,     Units.ONE));
+        assertEquals("i",   AxisDirections.suggestAbbreviation("not needed",             COLUMN_NEGATIVE,  Units.UNITY));
+        assertEquals("j",   AxisDirections.suggestAbbreviation("not needed",             ROW_NEGATIVE,     Units.UNITY));
+        assertEquals("x",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_RIGHT,    Units.UNITY));
+        assertEquals("y",   AxisDirections.suggestAbbreviation("not needed",             DISPLAY_DOWN,     Units.UNITY));
         assertEquals("N",   AxisDirections.suggestAbbreviation("not needed",             NORTH,            Units.METRE));
         assertEquals("S",   AxisDirections.suggestAbbreviation("not needed",             SOUTH,            Units.METRE));
         assertEquals("E",   AxisDirections.suggestAbbreviation("not needed",             EAST,             Units.METRE));

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -44,16 +44,16 @@ public final strictfp class SeismicBinGr
     static {
         final ParameterBuilder builder = builder();
         final ParameterDescriptor<?>[] parameters = {
-            builder.addIdentifier("8733").addName("Bin grid origin I")                  .create(Double.NaN, Units.ONE),
-            builder.addIdentifier("8734").addName("Bin grid origin J")                  .create(Double.NaN, Units.ONE),
+            builder.addIdentifier("8733").addName("Bin grid origin I")                  .create(Double.NaN, Units.UNITY),
+            builder.addIdentifier("8734").addName("Bin grid origin J")                  .create(Double.NaN, Units.UNITY),
             builder.addIdentifier("8735").addName("Bin grid origin Easting")            .create(Double.NaN, Units.METRE),
             builder.addIdentifier("8736").addName("Bin grid origin Northing")           .create(Double.NaN, Units.METRE),
-            builder.addIdentifier("8737").addName("Scale factor of bin grid")           .create(Double.NaN, Units.ONE),
+            builder.addIdentifier("8737").addName("Scale factor of bin grid")           .create(Double.NaN, Units.UNITY),
             builder.addIdentifier("8738").addName("Bin width on I-axis")                .create(Double.NaN, Units.METRE),
             builder.addIdentifier("8739").addName("Bin width on J-axis")                .create(Double.NaN, Units.METRE),
             builder.addIdentifier("8740").addName("Map grid bearing of bin grid J-axis").create(Double.NaN, Units.DEGREE),
-            builder.addIdentifier("8741").addName("Bin node increment on I-axis")       .create(Double.NaN, Units.ONE),
-            builder.addIdentifier("8742").addName("Bin node increment on J-axis")       .create(Double.NaN, Units.ONE)
+            builder.addIdentifier("8741").addName("Bin node increment on I-axis")       .create(Double.NaN, Units.UNITY),
+            builder.addIdentifier("8742").addName("Bin node increment on J-axis")       .create(Double.NaN, Units.UNITY)
         };
         PARAMETERS = builder
                 .addIdentifier("1049")

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -571,7 +571,7 @@ public final strictfp class GeodeticObje
         assertEquals("semi_major",   6378137.0, param.parameter("semi_major"      ).doubleValue(Units.METRE),  STRICT);
         assertEquals("semi_minor",   6356752.3, param.parameter("semi_minor"      ).doubleValue(Units.METRE),  0.1);
         assertEquals("central_meridian", -20.0, param.parameter("central_meridian").doubleValue(Units.DEGREE), STRICT);
-        assertEquals("scale_factor",       1.0, param.parameter("scale_factor"    ).doubleValue(Units.ONE),    STRICT);
+        assertEquals("scale_factor",       1.0, param.parameter("scale_factor"    ).doubleValue(Units.UNITY),    STRICT);
         assertEquals("false_easting", 500000.0, param.parameter("false_easting"   ).doubleValue(Units.METRE),  STRICT);
         assertEquals("false_northing",     0.0, param.parameter("false_northing"  ).doubleValue(Units.METRE),  STRICT);
     }
@@ -657,7 +657,7 @@ public final strictfp class GeodeticObje
         assertNameAndIdentifierEqual("TransverseMercator", 0, crs);
         assertNameAndIdentifierEqual("Sphere", 0, crs.getBaseCRS());
         assertNameAndIdentifierEqual("Sphere", 0, crs.getDatum());
-        verifyProjectedCS(crs.getCoordinateSystem(), Units.FOOT_SURVEY_US);
+        verifyProjectedCS(crs.getCoordinateSystem(), Units.US_SURVEY_FOOT);
 
         final ParameterValueGroup param = crs.getConversionFromBase().getParameterValues();
         assertEquals("Transverse Mercator", crs.getConversionFromBase().getMethod().getName().getCode());
@@ -806,7 +806,7 @@ public final strictfp class GeodeticObje
         assertEquals("semi_major",     6378249.2, param.parameter("semi_major"      ).doubleValue(Units.METRE),  STRICT);
         assertEquals("semi_minor",     6356515.0, param.parameter("semi_minor"      ).doubleValue(Units.METRE),  1E-12);
         assertEquals("central_meridian",     0.0, param.parameter("central_meridian").doubleValue(Units.DEGREE), STRICT);
-        assertEquals("scale_factor",  0.99987742, param.parameter("scale_factor"    ).doubleValue(Units.ONE),    STRICT);
+        assertEquals("scale_factor",  0.99987742, param.parameter("scale_factor"    ).doubleValue(Units.UNITY),    STRICT);
         assertEquals("false_easting",   600000.0, param.parameter("false_easting"   ).doubleValue(Units.METRE),  STRICT);
         assertEquals("false_northing", 2200000.0, param.parameter("false_northing"  ).doubleValue(Units.METRE),  STRICT);
         return param.parameter("latitude_of_origin");
@@ -871,7 +871,7 @@ public final strictfp class GeodeticObje
         assertEquals("semi_minor",        6356515.0, param.parameter("semi_minor"        ).doubleValue(Units.METRE),  1E-12);
         assertEquals("latitude_of_origin",     44.1, param.parameter("latitude_of_origin").doubleValue(Units.DEGREE), STRICT);
         assertEquals("central_meridian", 2.33722917, param.parameter("central_meridian"  ).doubleValue(Units.DEGREE), STRICT);
-        assertEquals("scale_factor",    0.999877499, param.parameter("scale_factor"      ).doubleValue(Units.ONE),    STRICT);
+        assertEquals("scale_factor",    0.999877499, param.parameter("scale_factor"      ).doubleValue(Units.UNITY),    STRICT);
         assertEquals("false_easting",      600000.0, param.parameter("false_easting"     ).doubleValue(Units.METRE),  STRICT);
         assertEquals("false_northing",     200000.0, param.parameter("false_northing"    ).doubleValue(Units.METRE),  STRICT);
     }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -531,7 +531,7 @@ public final strictfp class DefaultParam
             assertEquals ("Expected integer value", i,    p.intValue());
             assertEquals ("Expected integer value", i,    p.doubleValue(), STRICT);
 
-            p = create("Dimensionless double value", i, Units.ONE);
+            p = create("Dimensionless double value", i, Units.UNITY);
             d = p.getDescriptor();
             validate(p);
 
@@ -542,7 +542,7 @@ public final strictfp class DefaultParam
             assertNull   ("Expected no enumeration.",     d.getValidValues());
             assertEquals ("Expected double type.",        Double.class, d.getValueClass());
             assertTrue   ("Expected double type.",        p.getValue() instanceof Double);
-            assertEquals ("Expected dimensionless.",      Units.ONE, p.getUnit());
+            assertEquals ("Expected dimensionless.",      Units.UNITY, p.getUnit());
             assertEquals ("Expected integer value", i,    p.intValue());
             assertEquals ("Expected integer value", i,    p.doubleValue(), STRICT);
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -85,7 +85,7 @@ public final strictfp class ParameterBui
                    .addName(Citations.GEOTIFF, "NatOriginLong")
                    .setRemarks("Some remarks.")               .createBounded(-180, +180, 0, Units.DEGREE),
             builder.addName("Latitude of natural origin")     .createBounded( -80,  +84, 0, Units.DEGREE),
-            builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Units.ONE),
+            builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Units.UNITY),
             builder.addName("False easting")                  .create(0, Units.METRE),
             builder.addName("False northing")                 .create(0, Units.METRE)
         };

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -79,7 +79,7 @@ public final strictfp class ParameterFor
                     .setRemarks("This parameter is shown for completeness, but should never have a value different than 0 for this projection.")
                     .createBounded( -80,  +84,  40, Units.DEGREE),
             builder.addIdentifier("8802").addName("Longitude of natural origin")     .addName(OGC, "central_meridian")  .createBounded(-180, +180, -60, Units.DEGREE),
-            builder.addIdentifier("8805").addName("Scale factor at natural origin")  .addName(OGC, "scale_factor")      .createStrictlyPositive(1, Units.ONE),
+            builder.addIdentifier("8805").addName("Scale factor at natural origin")  .addName(OGC, "scale_factor")      .createStrictlyPositive(1, Units.UNITY),
             builder.addIdentifier("8806").addName("False easting").setRequired(false).addName(OGC, "false_easting")     .create( 5000, Units.METRE),
             builder.addIdentifier("8807").addName("False northing")                  .addName(OGC, "false_northing")    .create(10000, Units.METRE)
         };

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -407,7 +407,7 @@ public final strictfp class ParameterMar
         final Iterator<GeneralParameterDescriptor> itd = group.getDescriptor().descriptors().iterator();
         verifyParameter(8801, "Latitude of natural origin",     "latitude_of_origin", 40, Units.DEGREE, itd.next(), it.next());
         verifyParameter(8802, "Longitude of natural origin",    "central_meridian",  -60, Units.DEGREE, itd.next(), it.next());
-        verifyParameter(8805, "Scale factor at natural origin", "scale_factor",        1, Units.ONE,    itd.next(), it.next());
+        verifyParameter(8805, "Scale factor at natural origin", "scale_factor",        1, Units.UNITY,    itd.next(), it.next());
         assertFalse("Unexpected parameter.", it.hasNext());
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -117,7 +117,7 @@ public final strictfp class DefaultProje
                 .setConversionMethod("Lambert Conic Conformal (1SP)")
                 .setConversionName("Lambert zone II")
                 .setParameter("Latitude of natural origin",             52, Units.GRAD)
-                .setParameter("Scale factor at natural origin", 0.99987742, Units.ONE)
+                .setParameter("Scale factor at natural origin", 0.99987742, Units.UNITY)
                 .setParameter("False easting",                      600000, Units.METRE)
                 .setParameter("False northing",                    2200000, Units.METRE)
                 .setCodeSpace(Citations.EPSG, Constants.EPSG)

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -433,7 +433,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"i"</cite>.
      */
     public static final DefaultCoordinateSystemAxis COLUMN = create("Column", "i",
-            AxisDirection.COLUMN_POSITIVE, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.COLUMN_POSITIVE, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Axis for row indices in a {@linkplain org.opengis.coverage.grid.GridCoverage grid coverage}.
@@ -441,7 +441,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"j"</cite>.
      */
     public static final DefaultCoordinateSystemAxis ROW = create("Row", "j",
-            AxisDirection.ROW_POSITIVE, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.ROW_POSITIVE, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Axis for <var>x</var> values in a display device.
@@ -449,7 +449,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"x"</cite>.
      */
     public static final DefaultCoordinateSystemAxis DISPLAY_X = create("x", "x",
-            AxisDirection.DISPLAY_RIGHT, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.DISPLAY_RIGHT, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Axis for <var>y</var> values in a display device.
@@ -457,7 +457,7 @@ public final strictfp class HardCodedAxe
      * The abbreviation is lower case <cite>"y"</cite>.
      */
     public static final DefaultCoordinateSystemAxis DISPLAY_Y = create("y", "y",
-            AxisDirection.DISPLAY_DOWN, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.DISPLAY_DOWN, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Undefined or unknown axis. Axis direction is {@link AxisDirection#OTHER OTHER}
@@ -465,7 +465,7 @@ public final strictfp class HardCodedAxe
      * for axes that were not properly defined.
      */
     public static final DefaultCoordinateSystemAxis UNDEFINED = create("Undefined", "z",
-            AxisDirection.OTHER, Units.ONE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
+            AxisDirection.OTHER, Units.UNITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null);
 
     /**
      * Creates a new axis of the given name, abbreviation, direction and unit.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -64,7 +64,7 @@ public final strictfp class AffineTransf
     /**
      * Run the test in the flipped or unflipped case.
      *
-     * @param f -1 for the flipped case, or +1 for the unflipped case.
+     * @param  f  -1 for the flipped case, or +1 for the unflipped case.
      */
     private static void runTest(final int f) {
         // Test identity
@@ -113,7 +113,7 @@ public final strictfp class AffineTransf
         assertEquals( r, AffineTransforms2D.getRotation(tr), EPS);
         assertEquals(-1, AffineTransforms2D.getSwapXY  (tr));
         assertEquals( f, AffineTransforms2D.getFlip    (tr));
-        assertEquals( 1, getFlipFromType(tr)); // Always unflipped according Java 1.5.0_09...
+        assertEquals( 1, getFlipFromType(tr));                      // Always unflipped according Java 1.5.0_09
 
         // Tests axis swapping
         r = toRadians(-90 * f);

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -40,11 +40,11 @@ public final strictfp class GeneralMatri
     /**
      * Computes a random size for the next matrix to create.
      *
-     * @param random The random number generator to use.
+     * @param  random  the random number generator to use.
      */
     @Override
     void prepareNewMatrixSize(final Random random) {
-        size = 5 + random.nextInt(8); // Matrix sizes from 5 to 12 inclusive.
+        size = 5 + random.nextInt(8);                   // Matrix sizes from 5 to 12 inclusive.
     }
 
     /** {@inheritDoc} */ @Override int getNumRow() {return size;}
@@ -69,10 +69,10 @@ public final strictfp class GeneralMatri
     @Test
     public void testGetExtendedElements() {
         testGetExtendedElements(new GeneralMatrix(2, 2, new double[] {
-                StrictMath.PI / 180, // Degrees to radians
-                180 / StrictMath.PI, // Radians to degrees
-                0.9,                 // Gradians to degrees
-                0.1234567}));        // Random value with no special meaning.
+                StrictMath.PI / 180,            // Degrees to radians
+                180 / StrictMath.PI,            // Radians to degrees
+                0.9,                            // Gradians to degrees
+                0.1234567}));                   // Random value with no special meaning.
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -81,7 +81,7 @@ public final strictfp class MatricesTest
         }
         final MatrixSIS matrix = Matrices.create(SIZE, SIZE, elements);
         assertInstanceOf("Created with DoubleDouble elements", GeneralMatrix.class, matrix);
-        assertFalse(expected.equals(matrix)); // Because not the same type.
+        assertFalse(expected.equals(matrix));                                       // Because not the same type.
         assertTrue(Matrices.equals(expected, matrix, ComparisonMode.BY_CONTRACT));
         final double[] errors = ((GeneralMatrix) matrix).elements;
         for (int i = 0; i < SIZE*SIZE; i++) {
@@ -130,12 +130,12 @@ public final strictfp class MatricesTest
         assertFalse("isIdentity", matrix.isIdentity());
         assertEquals("numRow", 4, matrix.getNumRow());
         assertEquals("numCol", 4, matrix.getNumCol());
-        assertEquals(Matrices.create(4, 4, new double[] {
+        assertMatrixEquals("(N,E,U) → (W,U,S)", Matrices.create(4, 4, new double[] {
              0,-1, 0, 0,
              0, 0, 1, 0,
             -1, 0, 0, 0,
              0, 0, 0, 1
-        }), matrix);
+        }), matrix, STRICT);
     }
 
     /**
@@ -156,11 +156,11 @@ public final strictfp class MatricesTest
         assertFalse("isIdentity", matrix.isIdentity());
         assertEquals("numRow", 3, matrix.getNumRow());
         assertEquals("numCol", 4, matrix.getNumCol());
-        assertEquals(Matrices.create(3, 4, new double[] {
+        assertMatrixEquals("(N,E,U) → (D,N)", Matrices.create(3, 4, new double[] {
             0, 0,-1, 0,
             1, 0, 0, 0,
             0, 0, 0, 1
-        }), matrix);
+        }), matrix, STRICT);
     }
 
     /**
@@ -181,11 +181,11 @@ public final strictfp class MatricesTest
         assertFalse("isIdentity", matrix.isIdentity());
         assertEquals("numRow", 3, matrix.getNumRow());
         assertEquals("numCol", 4, matrix.getNumCol());
-        assertEquals(Matrices.create(3, 4, new double[] {
+        assertMatrixEquals("(N,E,U) → (D,D)", Matrices.create(3, 4, new double[] {
             0, 0,-1, 0,
             0, 0,-1, 0,
             0, 0, 0, 1
-        }), matrix);
+        }), matrix, STRICT);
     }
 
     /**
@@ -303,11 +303,11 @@ public final strictfp class MatricesTest
         assertFalse("isIdentity", matrix.isIdentity());
         assertEquals("numRow", 3, matrix.getNumRow());
         assertEquals("numCol", 3, matrix.getNumCol());
-        assertEquals(Matrices.create(3, 3, new double[] {
+        assertMatrixEquals("(N,E) → (E,N)", Matrices.create(3, 3, new double[] {
             0,   -3.0, 350,
             2.5,  0,    75,
             0,    0,     1
-        }), matrix);
+        }), matrix, STRICT);
         /*
          * Test dropping a dimension.
          */
@@ -319,11 +319,11 @@ public final strictfp class MatricesTest
                 dstEnvelope, new AxisDirection[] {EAST, NORTH});
         assertEquals("numRow", 3, matrix.getNumRow());
         assertEquals("numCol", 4, matrix.getNumCol());
-        assertEquals(Matrices.create(3, 4, new double[] {
+        assertMatrixEquals("(N,E,U) → (E,N)", Matrices.create(3, 4, new double[] {
             0,   -3.0, 0, 350,
             2.5,  0,   0,  75,
             0,    0,   0,   1
-        }), matrix);
+        }), matrix, STRICT);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -74,9 +74,9 @@ public final strictfp class Matrix2Test
     @Test
     public void testGetExtendedElements() {
         GeneralMatrixTest.testGetExtendedElements(new Matrix2(
-                StrictMath.PI / 180, // Degrees to radians
-                180 / StrictMath.PI, // Radians to degrees
-                0.9,                 // Gradians to degrees
-                0.1234567));         // Random value with no special meaning.
+                StrictMath.PI / 180,        // Degrees to radians
+                180 / StrictMath.PI,        // Radians to degrees
+                0.9,                        // Gradians to degrees
+                0.1234567));                // Random value with no special meaning.
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -95,7 +95,7 @@ public final strictfp class Matrix4Test
         final Matrix4 step1 = new Matrix4(
                 0.9,  0,    0,    parisMeridian,
                 0,    0.9,  0,    0,
-                0,    0,    0.8,  0, // Random conversion factor for z values.
+                0,    0,    0.8,  0,                // Random conversion factor for z values.
                 0,    0,    0,    1);
         /*
          * Degrees to radians with swapping of (longitude, latitude) axes

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=1766508&r1=1766507&r2=1766508&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] Tue Oct 25 10:45:14 2016
@@ -120,7 +120,7 @@ public abstract strictfp class MatrixTes
      * (which happen only when performing some more extensive tests), then the given seed will be replaced
      * by a random one.
      *
-     * @param seed The initial seed.
+     * @param  seed  the initial seed.
      */
     final void initialize(final long seed) {
         random = DETERMINIST ? new Random(seed) : TestUtilities.createRandomNumberGenerator();
@@ -130,7 +130,7 @@ public abstract strictfp class MatrixTes
      * Computes a random size for the next matrix to create. This method is overridden
      * only by subclasses that test matrix implementations supporting arbitrary sizes.
      *
-     * @param random The random number generator to use for computing a random matrix size.
+     * @param  random  the random number generator to use for computing a random matrix size.
      */
     void prepareNewMatrixSize(final Random random) {
     }
@@ -151,9 +151,9 @@ public abstract strictfp class MatrixTes
     /**
      * Verifies that the SIS matrix is equals to the JAMA one, up to the given tolerance value.
      *
-     * @param expected  The JAMA matrix used as a reference implementation.
-     * @param actual    The SIS matrix to compare to JAMA.
-     * @param tolerance The tolerance threshold, usually either {@link #STRICT} or {@link #TOLERANCE}.
+     * @param  expected   the JAMA matrix used as a reference implementation.
+     * @param  actual     the SIS matrix to compare to JAMA.
+     * @param  tolerance  the tolerance threshold, usually either {@link #STRICT} or {@link #TOLERANCE}.
      */
     static void assertEqualsJAMA(final Matrix expected, final MatrixSIS actual, final double tolerance) {
         final int numRow = actual.getNumRow();
@@ -396,9 +396,9 @@ public abstract strictfp class MatrixTes
      * Consequently it is sub-classes responsibility to add a {@code testConvertBefore()} method
      * which invoke this method.
      *
-     * @param matrix The matrix of size 3×3 to test.
-     * @param withShear {@code true} for including shear in the matrix to test.
-     *        This value can be set to {@code false} if the subclass want to test a simpler case.
+     * @param  matrix     the matrix of size 3×3 to test.
+     * @param  withShear  {@code true} for including shear in the matrix to test.
+     *         This value can be set to {@code false} if the subclass want to test a simpler case.
      *
      * @since 0.6
      */
@@ -466,7 +466,7 @@ public abstract strictfp class MatrixTes
      * Consequently it is sub-classes responsibility to add a {@code testConvertAfter()} method
      * which invoke this method.
      *
-     * @param matrix The matrix of size 3×3 to test.
+     * @param  matrix  the matrix of size 3×3 to test.
      *
      * @since 0.6
      */

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -51,11 +51,11 @@ public final strictfp class NonSquareMat
     /**
      * Computes a random size for the next matrix to create.
      *
-     * @param random The random number generator to use.
+     * @param  random  the random number generator to use.
      */
     @Override
     void prepareNewMatrixSize(final Random random) {
-        numRow = 5 + random.nextInt(8); // Matrix sizes from 5 to 12 inclusive.
+        numRow = 5 + random.nextInt(8);                 // Matrix sizes from 5 to 12 inclusive.
         int n;
         do n = 5 + random.nextInt(8);
         while (n == numRow);
@@ -150,9 +150,9 @@ public final strictfp class NonSquareMat
      * Tests {@link NonSquareMatrix#inverse()} or {@link NonSquareMatrix#solve(Matrix)} with a conversion
      * matrix having more source dimensions (columns) than target dimensions (rows).
      *
-     * @param  Y    The matrix to give to {@code solve(Y)}, {@code null} for testing {@code inverse()}.
-     * @param  sf   The scale factor by which to multiply all expected scale elements.
-     * @param  uks  Value of unknown scales (O for {@code inverse()}, or NaN for {@code solve(Y)}).
+     * @param  Y    the matrix to give to {@code solve(Y)}, {@code null} for testing {@code inverse()}.
+     * @param  sf   the scale factor by which to multiply all expected scale elements.
+     * @param  uks  value of unknown scales (O for {@code inverse()}, or NaN for {@code solve(Y)}).
      * @throws NoninvertibleMatrixException if the matrix can not be inverted.
      */
     private static void testDimensionReduction(final MatrixSIS Y, final double sf, final double uks)
@@ -178,8 +178,8 @@ public final strictfp class NonSquareMat
      * Tests {@link NonSquareMatrix#inverse()} or {@link NonSquareMatrix#solve(Matrix)} with a conversion
      * matrix having more target dimensions (rows) than source dimensions (columns).
      *
-     * @param  Y    The matrix to give to {@code solve(Y)}, {@code null} for testing {@code inverse()}.
-     * @param  sf   The scale factor by which to multiply all expected scale elements.
+     * @param  Y   the matrix to give to {@code solve(Y)}, {@code null} for testing {@code inverse()}.
+     * @param  sf  the scale factor by which to multiply all expected scale elements.
      * @throws NoninvertibleMatrixException if the matrix can not be inverted.
      */
     private static void testDimensionIncrease(final MatrixSIS Y, final double sf)

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -91,7 +91,7 @@ public final strictfp class SolverTest e
     /**
      * Tests the {@code Solver.solve(MatrixSIS, Matrix, int)} method.
      *
-     * @throws NoninvertibleMatrixException Should never happen.
+     * @throws NoninvertibleMatrixException if an unexpected error occurred while inverting the matrix.
      */
     @Test
     public void testSolve() throws NoninvertibleMatrixException {
@@ -111,7 +111,7 @@ public final strictfp class SolverTest e
             try {
                 jama = reference.solve(referenceArg);
             } catch (RuntimeException e) {
-                out.println(e); // "Matrix is singular."
+                out.println(e);                                         // "Matrix is singular."
                 continue;
             }
             final MatrixSIS U = Solver.solve(matrix, matrixArg);
@@ -122,7 +122,7 @@ public final strictfp class SolverTest e
     /**
      * Tests {@link Solver#inverse(MatrixSIS, boolean)} with a square matrix that contains a {@link Double#NaN} value.
      *
-     * @throws NoninvertibleMatrixException Should not happen.
+     * @throws NoninvertibleMatrixException if an unexpected error occurred while inverting the matrix.
      */
     @Test
     @DependsOnMethod("testSolve")

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -33,7 +33,6 @@ import org.opengis.referencing.crs.Coord
 import org.opengis.referencing.crs.GeneralDerivedCRS;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.util.Constants;
-import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.internal.referencing.provider.Affine;
 import org.apache.sis.internal.referencing.provider.LambertConformal2SP;
 import org.apache.sis.measure.Range;
@@ -493,8 +492,8 @@ public strictfp class CoordinateOperatio
      * or an empty string (never {@code null}) if none.
      */
     private static String getUnit(final ParameterDescriptor<?> param) {
-        final String unit = PatchedUnitFormat.toString(param.getUnit());
-        if (unit != null && !unit.isEmpty()) {
+        final String unit = param.getUnit().toString();
+        if (!unit.isEmpty()) {
             if (unit.equals("°")) {
                 return unit;
             }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -20,7 +20,6 @@ import javax.measure.Unit;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.internal.jaxb.gml.Measure;
-import org.apache.sis.internal.util.PatchedUnitFormat;
 
 
 /**
@@ -29,7 +28,7 @@ import org.apache.sis.internal.util.Patc
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  *
  * @see Measure
@@ -56,7 +55,7 @@ public class UnitAdapter extends XmlAdap
      */
     @Override
     public String marshal(final Unit<?> value) {
-        return PatchedUnitFormat.toString(value);
+        return (value != null) ? value.toString() : null;
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -149,7 +149,7 @@ public final class Measure {
                 return DefinitionURI.PREFIX + ":uom:" + Constants.EPSG + "::" + code;
             }
         }
-        if (unit == null || unit.equals(Units.ONE)) {
+        if (unit == null || unit.equals(Units.UNITY)) {
             return "";
         }
         return Context.schema(Context.current(), "gmd", Schemas.METADATA_ROOT).append(Schemas.UOM_PATH)
@@ -187,7 +187,7 @@ public final class Measure {
      *
      * <div class="note"><b>Example:</b>
      * Some users wrongly assign the "m" unit to {@code Ellipsoid.inverseFlattening}.
-     * The SIS adapter forces the unit to {@link Unit#ONE}, but we want to let the user
+     * The SIS adapter forces the unit to {@link Units#UNITY}, but we want to let the user
      * know that he probably did something wrong.</div>
      *
      * @param  newUnit The new unit (can not be null).

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -40,7 +40,7 @@ import org.apache.sis.util.logging.Loggi
  */
 public final class DefaultFactories extends SystemListener {
     /**
-     * Cache of factories which are found by {@code META-INF/services}.
+     * Cache of factories found by {@link ServiceLoader} from {@code META-INF/services} files content.
      */
     private static final Map<Class<?>, Object> FACTORIES = new IdentityHashMap<>(4);
     static {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -17,6 +17,7 @@
 package org.apache.sis.internal.util;
 
 import java.util.Arrays;
+import org.apache.sis.math.Fraction;
 import org.apache.sis.math.MathFunctions;
 import org.apache.sis.math.DecimalFunctions;
 // No BigDecimal dependency - see class javadoc
@@ -59,7 +60,7 @@ import org.apache.sis.internal.jdk8.JDK8
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  *
  * @see <a href="http://en.wikipedia.org/wiki/Double-double_%28arithmetic%29#Double-double_arithmetic">Wikipedia: Double-double arithmetic</a>
@@ -194,7 +195,7 @@ public final class DoubleDouble extends
     /**
      * Creates a new value initialized to the given value.
      *
-     * @param other The other value to copy.
+     * @param  other  the other value to copy.
      */
     public DoubleDouble(final DoubleDouble other) {
         value = other.value;
@@ -202,14 +203,33 @@ public final class DoubleDouble extends
     }
 
     /**
-     * Creates a new value initialized to the given number. If the given number is an
-     * instance of {@code DoubleDouble}, then its error term will be taken in account.
+     * Creates a new value initialized to the given number. If the given number is an instance of
+     * {@code DoubleDouble} or {@link Fraction}, then the error term will be taken in account.
      *
-     * @param otherValue The initial value.
+     * @param  otherValue  the initial value.
      */
     public DoubleDouble(final Number otherValue) {
-        value = otherValue.doubleValue();
-        error = (otherValue instanceof DoubleDouble) ? ((DoubleDouble) otherValue).error : errorForWellKnownValue(value);
+        if (otherValue instanceof Fraction) {
+            value = ((Fraction) otherValue).denominator;
+            inverseDivide(((Fraction) otherValue).numerator, 0);
+        } else {
+            value = otherValue.doubleValue();
+            error = (otherValue instanceof DoubleDouble) ? ((DoubleDouble) otherValue).error : errorForWellKnownValue(value);
+        }
+    }
+
+    /**
+     * Returns {@code true} if the given value is one of the special cases recognized by the
+     * {@link DoubleDouble(Number)} constructor. Those special cases should rarely occur, so
+     * we do not complicate the code with optimized code paths.
+     *
+     * @param  value  the value to test.
+     * @return {@code true} if it is worth to convert the given value to a {@code DoubleDouble}.
+     *
+     * @since 0.8
+     */
+    public static boolean shouldConvert(final Number value) {
+        return (value instanceof Fraction);
     }
 
     /**
@@ -219,7 +239,7 @@ public final class DoubleDouble extends
      * <b>Tip:</b> if the other value is known to be an integer or a power of 2, then invoking
      * <code>{@linkplain #DoubleDouble(double, double) DoubleDouble}(otherValue, 0)</code> is more efficient.
      *
-     * @param value The initial value.
+     * @param  value  the initial value.
      */
     public DoubleDouble(final double value) {
         this.value = value;
@@ -230,8 +250,8 @@ public final class DoubleDouble extends
      * Creates a new value initialized to the given value and error.
      * It is caller's responsibility to ensure that the (value, error) pair is normalized.
      *
-     * @param value The initial value.
-     * @param error The initial error.
+     * @param  value  the initial value.
+     * @param  error  the initial error.
      */
     public DoubleDouble(final double value, final double error) {
         this.value = value;
@@ -240,14 +260,28 @@ public final class DoubleDouble extends
     }
 
     /**
+     * Returns the given value as a {@code DoubleDouble}. This method returns the given instance
+     * directly if it can be safely casted to {@code DoubleDouble}.
+     *
+     * @param  value  the value to cast or to copy, or {@code null}.
+     * @return the value as a {@code DoubleDouble} (may be the same instance than the given argument),
+     *         or {@code null} if the given value was null.
+     *
+     * @since 0.8
+     */
+    public static DoubleDouble castOrCopy(final Number value) {
+        return (value == null || value instanceof DoubleDouble) ? (DoubleDouble) value : new DoubleDouble(value);
+    }
+
+    /**
      * Uses the given value verbatim, without inferring an error term for double-double arithmetic.
      * We use this method when the value has been computed using transcendental functions (cosine,
      * logarithm, <i>etc.</i>) in which case there is no way we can infer a meaningful error term.
      *
      * <p>We use this method both for readability and for making easier to search where such thing occur.</p>
      *
-     * @param  value The value to wrap in a {@code DoubleDouble} instance.
-     * @return A {@code DoubleDouble} containing exactly the given value, without error term.
+     * @param  value  the value to wrap in a {@code DoubleDouble} instance.
+     * @return a {@code DoubleDouble} containing exactly the given value, without error term.
      */
     public static DoubleDouble verbatim(final double value) {
         return new DoubleDouble(value, 0);
@@ -257,7 +291,7 @@ public final class DoubleDouble extends
      * Returns a new {@code DoubleDouble} instance initialized to the conversion factor
      * from radians to angular degrees.
      *
-     * @return An instance initialized to the 57.2957795130823208767981548141052 value.
+     * @return an instance initialized to the 57.2957795130823208767981548141052 value.
      */
     public static DoubleDouble createRadiansToDegrees() {
         return new DoubleDouble(57.2957795130823208767981548141052, -1.9878495670576283E-15);
@@ -267,7 +301,7 @@ public final class DoubleDouble extends
      * Returns a new {@code DoubleDouble} instance initialized to the conversion factor
      * from angular degrees to radians.
      *
-     * @return An instance initialized to the 0.01745329251994329576923690768488613 value.
+     * @return an instance initialized to the 0.01745329251994329576923690768488613 value.
      */
     public static DoubleDouble createDegreesToRadians() {
         return new DoubleDouble(0.01745329251994329576923690768488613, 2.9486522708701687E-19);
@@ -277,7 +311,7 @@ public final class DoubleDouble extends
      * Returns a new {@code DoubleDouble} instance initialized to the conversion factor
      * from arc-seconds to radians.
      *
-     * @return An instance initialized to the 0.000004848136811095359935899141023579480 value.
+     * @return an instance initialized to the 0.000004848136811095359935899141023579480 value.
      */
     public static DoubleDouble createSecondsToRadians() {
         return new DoubleDouble(0.000004848136811095359935899141023579480, 9.320078015422868E-23);
@@ -303,8 +337,8 @@ public final class DoubleDouble extends
      * the intend was to provide the "feet to metres" conversion factor and complete the double-double instance
      * accordingly.
      *
-     * @param  value The value for which to get this error.
-     * @return The error for the given value, or 0 if unknown. In the later case,
+     * @param  value  the value for which to get this error.
+     * @return the error for the given value, or 0 if unknown. In the later case,
      *         the base 2 representation of the given value is assumed to be accurate enough.
      */
     public static double errorForWellKnownValue(final double value) {
@@ -337,7 +371,7 @@ public final class DoubleDouble extends
     /**
      * Sets this {@code DoubleDouble} to the same value than the given instance.
      *
-     * @param other The instance to copy.
+     * @param  other  the instance to copy.
      */
     public void setFrom(final DoubleDouble other) {
         value = other.value;
@@ -353,9 +387,9 @@ public final class DoubleDouble extends
      *   error = array[index + errorOffset];
      * }
      *
-     * @param array        The array from which to get the value and error.
-     * @param index        Index of the value in the given array.
-     * @param errorOffset  Offset to add to {@code index} in order to get the index of the error in the given array.
+     * @param  array        the array from which to get the value and error.
+     * @param  index        index of the value in the given array.
+     * @param  errorOffset  offset to add to {@code index} in order to get the index of the error in the given array.
      */
     public void setFrom(final double[] array, final int index, final int errorOffset) {
         value = array[index];
@@ -377,8 +411,8 @@ public final class DoubleDouble extends
      *
      * <p>Source: [Hida &amp; al.] page 4 algorithm 3, itself reproduced from [Shewchuk] page 312.</p>
      *
-     * @param a The first number to add.
-     * @param b The second number to add, which must be smaller than {@code a}.
+     * @param  a  the first number to add.
+     * @param  b  the second number to add, which must be smaller than {@code a}.
      */
     public void setToQuickSum(final double a, final double b) {
         value = a + b;
@@ -391,8 +425,8 @@ public final class DoubleDouble extends
      *
      * <p>Source: [Hida &amp; al.] page 4 algorithm 4, itself reproduced from [Shewchuk] page 314.</p>
      *
-     * @param a The first number to add.
-     * @param b The second number to add.
+     * @param  a  the first number to add.
+     * @param  b  the second number to add.
      */
     public void setToSum(final double a, final double b) {
         value = a + b;
@@ -407,8 +441,8 @@ public final class DoubleDouble extends
      *
      * <p>Source: [Hida &amp; al.] page 4 algorithm 6, itself reproduced from [Shewchuk] page 326.</p>
      *
-     * @param a The first number to multiply.
-     * @param b The second number to multiply.
+     * @param  a  the first number to multiply.
+     * @param  b  the second number to multiply.
      */
     public void setToProduct(final double a, final double b) {
         value = a * b;
@@ -431,9 +465,9 @@ public final class DoubleDouble extends
      *   array[index + errorOffset] = error;
      * }
      *
-     * @param array        The array where to store the value and error.
-     * @param index        Index of the value in the given array.
-     * @param errorOffset  Offset to add to {@code index} in order to get the index of the error in the given array.
+     * @param  array        the array where to store the value and error.
+     * @param  index        index of the value in the given array.
+     * @param  errorOffset  offset to add to {@code index} in order to get the index of the error in the given array.
      */
     public void storeTo(final double[] array, final int index, final int errorOffset) {
         array[index] = value;
@@ -443,10 +477,10 @@ public final class DoubleDouble extends
     /**
      * Swaps two double-double values in the given array.
      *
-     * @param array        The array where to swap the values and errors.
-     * @param i0           Index of the first value to swap.
-     * @param i1           Index of the second value to swap.
-     * @param errorOffset  Offset to add to the indices in order to get the error indices in the given array.
+     * @param  array        the array where to swap the values and errors.
+     * @param  i0           index of the first value to swap.
+     * @param  i1           index of the second value to swap.
+     * @param  errorOffset  offset to add to the indices in order to get the error indices in the given array.
      *
      * @see org.apache.sis.util.ArraysExt#swap(double[], int, int)
      */
@@ -475,7 +509,7 @@ public final class DoubleDouble extends
      *    add(other.value, other.error);
      * }
      *
-     * @param other The other value to add to this {@code DoubleDouble}.
+     * @param  other  the other value to add to this {@code DoubleDouble}.
      */
     public void add(final DoubleDouble other) {
         add(other.value, other.error);
@@ -483,13 +517,15 @@ public final class DoubleDouble extends
 
     /**
      * Adds a {@code Number} value to this {@code DoubleDouble}. If the given number is an instance
-     * of {@code DoubleDouble}, then its error term will be taken in account.
+     * of {@code DoubleDouble} or {@link Fraction}, then the error term will be taken in account.
      *
-     * @param other The other value to add to this {@code DoubleDouble}.
+     * @param  other  the other value to add to this {@code DoubleDouble}.
      */
     public void add(final Number other) {
         if (other instanceof DoubleDouble) {
             add((DoubleDouble) other);
+        } else if (shouldConvert(other)) {
+            add(new DoubleDouble(other));
         } else {
             add(other.doubleValue());
         }
@@ -506,7 +542,7 @@ public final class DoubleDouble extends
      * <b>Tip:</b> if the other value is known to be an integer or a power of 2, then invoking
      * <code>{@linkplain #add(double, double) add}(otherValue, 0)</code> is more efficient.
      *
-     * @param otherValue The other value to add to this {@code DoubleDouble}.
+     * @param  otherValue  the other value to add to this {@code DoubleDouble}.
      */
     public void add(final double otherValue) {
         add(otherValue, errorForWellKnownValue(otherValue));
@@ -537,8 +573,8 @@ public final class DoubleDouble extends
      *   setToQuickSum(value, error);
      * }
      *
-     * @param otherValue The other value to add to this {@code DoubleDouble}.
-     * @param otherError The error of the other value to add to this {@code DoubleDouble}.
+     * @param  otherValue  the other value to add to this {@code DoubleDouble}.
+     * @param  otherError  the error of the other value to add to this {@code DoubleDouble}.
      */
     public void add(final double otherValue, final double otherError) {
         // Inline expansion of the code in above javadoc.
@@ -571,9 +607,9 @@ public final class DoubleDouble extends
      *    add(array[index], array[index + errorOffset]);
      * }
      *
-     * @param array        The array from which to get the value and error.
-     * @param index        Index of the value in the given array.
-     * @param errorOffset  Offset to add to {@code index} in order to get the index of the error in the given array.
+     * @param  array        the array from which to get the value and error.
+     * @param  index        index of the value in the given array.
+     * @param  errorOffset  offset to add to {@code index} in order to get the index of the error in the given array.
      */
     public void add(final double[] array, final int index, final int errorOffset) {
         add(array[index], array[index + errorOffset]);
@@ -587,7 +623,7 @@ public final class DoubleDouble extends
      *    subtract(other.value, other.error);
      * }
      *
-     * @param other The other value to subtract from this value.
+     * @param  other  the other value to subtract from this value.
      */
     public void subtract(final DoubleDouble other) {
         subtract(other.value, other.error);
@@ -595,13 +631,15 @@ public final class DoubleDouble extends
 
     /**
      * Subtracts a {@code Number} from this {@code DoubleDouble}. If the given number is an instance
-     * of {@code DoubleDouble}, then its error term will be taken in account.
+     * of {@code DoubleDouble} or {@link Fraction}, then the error term will be taken in account.
      *
-     * @param other The other value to subtract from this {@code DoubleDouble}.
+     * @param  other  the other value to subtract from this {@code DoubleDouble}.
      */
     public void subtract(final Number other) {
         if (other instanceof DoubleDouble) {
             subtract((DoubleDouble) other);
+        } else if (shouldConvert(other)) {
+            subtract(new DoubleDouble(other));
         } else {
             subtract(other.doubleValue());
         }
@@ -618,7 +656,7 @@ public final class DoubleDouble extends
      * <b>Tip:</b> if the other value is known to be an integer or a power of 2, then invoking
      * <code>{@linkplain #subtract(double, double) subtract}(otherValue, 0)</code> is more efficient.
      *
-     * @param otherValue The other value to subtract from this {@code DoubleDouble}.
+     * @param  otherValue  the other value to subtract from this {@code DoubleDouble}.
      */
     public void subtract(final double otherValue) {
         subtract(otherValue, errorForWellKnownValue(otherValue));
@@ -628,8 +666,8 @@ public final class DoubleDouble extends
      * Subtracts an other double-double value from this {@code DoubleDouble}.
      * The result is stored in this instance.
      *
-     * @param otherValue The other value to subtract from this {@code DoubleDouble}.
-     * @param otherError The error of the other value to subtract from this {@code DoubleDouble}.
+     * @param  otherValue  the other value to subtract from this {@code DoubleDouble}.
+     * @param  otherError  the error of the other value to subtract from this {@code DoubleDouble}.
      */
     public void subtract(final double otherValue, final double otherError) {
         add(-otherValue, -otherError);
@@ -643,9 +681,9 @@ public final class DoubleDouble extends
      *    subtract(array[index], array[index + errorOffset]);
      * }
      *
-     * @param array        The array from which to get the value and error.
-     * @param index        Index of the value in the given array.
-     * @param errorOffset  Offset to add to {@code index} in order to get the index of the error in the given array.
+     * @param  array        the array from which to get the value and error.
+     * @param  index        index of the value in the given array.
+     * @param  errorOffset  offset to add to {@code index} in order to get the index of the error in the given array.
      */
     public void subtract(final double[] array, final int index, final int errorOffset) {
         subtract(array[index], array[index + errorOffset]);
@@ -659,7 +697,7 @@ public final class DoubleDouble extends
      *    multiply(other.value, other.error);
      * }
      *
-     * @param other The other value to multiply by this value.
+     * @param  other  the other value to multiply by this value.
      */
     public void multiply(final DoubleDouble other) {
         multiply(other.value, other.error);
@@ -667,13 +705,15 @@ public final class DoubleDouble extends
 
     /**
      * Multiplies this {@code DoubleDouble} by a {@code Number}. If the given number is an instance
-     * of {@code DoubleDouble}, then its error term will be taken in account.
+     * of {@code DoubleDouble} or {@link Fraction}, then the error term will be taken in account.
      *
-     * @param other The other value to multiply by this {@code DoubleDouble}.
+     * @param  other  the other value to multiply by this {@code DoubleDouble}.
      */
     public void multiply(final Number other) {
         if (other instanceof DoubleDouble) {
             multiply((DoubleDouble) other);
+        } else if (shouldConvert(other)) {
+            multiply(new DoubleDouble(other));
         } else {
             multiply(other.doubleValue());
         }
@@ -690,7 +730,7 @@ public final class DoubleDouble extends
      * <b>Tip:</b> if the other value is known to be an integer or a power of 2, then invoking
      * <code>{@linkplain #multiply(double, double) multiply}(otherValue, 0)</code> is more efficient.
      *
-     * @param otherValue The other value to multiply by this {@code DoubleDouble}.
+     * @param  otherValue  the other value to multiply by this {@code DoubleDouble}.
      */
     public void multiply(final double otherValue) {
         multiply(otherValue, errorForWellKnownValue(otherValue));
@@ -724,8 +764,8 @@ public final class DoubleDouble extends
      *   setToQuickSum(value, error);
      * }
      *
-     * @param otherValue The other value by which to multiply this {@code DoubleDouble}.
-     * @param otherError The error of the other value by which to multiply this {@code DoubleDouble}.
+     * @param  otherValue  the other value by which to multiply this {@code DoubleDouble}.
+     * @param  otherError  the error of the other value by which to multiply this {@code DoubleDouble}.
      */
     public void multiply(final double otherValue, final double otherError) {
         final double thisValue = this.value;
@@ -744,9 +784,9 @@ public final class DoubleDouble extends
      *    multiply(array[index], array[index + errorOffset]);
      * }
      *
-     * @param array        The array from which to get the value and error.
-     * @param index        Index of the value in the given array.
-     * @param errorOffset  Offset to add to {@code index} in order to get the index of the error in the given array.
+     * @param  array        the array from which to get the value and error.
+     * @param  index        index of the value in the given array.
+     * @param  errorOffset  offset to add to {@code index} in order to get the index of the error in the given array.
      */
     public void multiply(final double[] array, final int index, final int errorOffset) {
         multiply(array[index], array[index + errorOffset]);
@@ -760,7 +800,7 @@ public final class DoubleDouble extends
      *    divide(other.value, other.error);
      * }
      *
-     * @param other The other value to by which to divide this value.
+     * @param  other  the other value to by which to divide this value.
      */
     public void divide(final DoubleDouble other) {
         divide(other.value, other.error);
@@ -768,13 +808,15 @@ public final class DoubleDouble extends
 
     /**
      * Divides this {@code DoubleDouble} by a {@code Number}. If the given number is an instance
-     * of {@code DoubleDouble}, then its error term will be taken in account.
+     * of {@code DoubleDouble} or {@link Fraction}, then the error term will be taken in account.
      *
-     * @param other The other value by which to divide this {@code DoubleDouble}.
+     * @param  other  the other value by which to divide this {@code DoubleDouble}.
      */
     public void divide(final Number other) {
         if (other instanceof DoubleDouble) {
             divide((DoubleDouble) other);
+        } else if (shouldConvert(other)) {
+            divide(new DoubleDouble(other));
         } else {
             divide(other.doubleValue());
         }
@@ -791,7 +833,7 @@ public final class DoubleDouble extends
      * <b>Tip:</b> if the other value is known to be an integer or a power of 2, then invoking
      * <code>{@linkplain #divide(double, double) divide}(otherValue, 0)</code> is more efficient.
      *
-     * @param otherValue The other value by which to divide this {@code DoubleDouble}.
+     * @param  otherValue  the other value by which to divide this {@code DoubleDouble}.
      */
     public void divide(final double otherValue) {
         divide(otherValue, errorForWellKnownValue(otherValue));
@@ -801,8 +843,8 @@ public final class DoubleDouble extends
      * Divides this {@code DoubleDouble} by an other double-double value.
      * The result is stored in this instance.
      *
-     * @param denominatorValue The other value by which to divide this {@code DoubleDouble}.
-     * @param denominatorError The error of the other value by which to divide this {@code DoubleDouble}.
+     * @param  denominatorValue  the other value by which to divide this {@code DoubleDouble}.
+     * @param  denominatorError  the error of the other value by which to divide this {@code DoubleDouble}.
      */
     public void divide(final double denominatorValue, final double denominatorError) {
         if (DISABLED) {
@@ -825,9 +867,9 @@ public final class DoubleDouble extends
      *    divide(array[index], array[index + errorOffset]);
      * }
      *
-     * @param array        The array from which to get the value and error.
-     * @param index        Index of the value in the given array.
-     * @param errorOffset  Offset to add to {@code index} in order to get the index of the error in the given array.
+     * @param  array        the array from which to get the value and error.
+     * @param  index        index of the value in the given array.
+     * @param  errorOffset  offset to add to {@code index} in order to get the index of the error in the given array.
      */
     public void divide(final double[] array, final int index, final int errorOffset) {
         divide(array[index], array[index + errorOffset]);
@@ -841,21 +883,23 @@ public final class DoubleDouble extends
      *    inverseDivide(other.value, other.error);
      * }
      *
-     * @param other The other value to divide by this value.
+     * @param  other  the other value to divide by this value.
      */
     public void inverseDivide(final DoubleDouble other) {
         inverseDivide(other.value, other.error);
     }
 
     /**
-     * Divides the given {@code Number} value by this {@code DoubleDouble}. If the given number
-     * is an instance of {@code DoubleDouble}, then its error term will be taken in account.
+     * Divides the given {@code Number} value by this {@code DoubleDouble}. If the given number is an instance
+     * of {@code DoubleDouble} or {@link Fraction}, then the error term will be taken in account.
      *
-     * @param other The other value to divide by this {@code DoubleDouble}.
+     * @param  other  the other value to divide by this {@code DoubleDouble}.
      */
     public void inverseDivide(final Number other) {
         if (other instanceof DoubleDouble) {
             inverseDivide((DoubleDouble) other);
+        } else if (shouldConvert(other)) {
+            inverseDivide(new DoubleDouble(other));
         } else {
             inverseDivide(other.doubleValue());
         }
@@ -872,7 +916,7 @@ public final class DoubleDouble extends
      * <b>Tip:</b> if the other value is known to be an integer or a power of 2, then invoking
      * <code>{@linkplain #inverseDivide(double, double) inverseDivide}(otherValue, 0)</code> is more efficient.
      *
-     * @param numeratorValue The other value to divide by this {@code DoubleDouble}.
+     * @param  numeratorValue  the other value to divide by this {@code DoubleDouble}.
      */
     public void inverseDivide(final double numeratorValue) {
         inverseDivide(numeratorValue, errorForWellKnownValue(numeratorValue));
@@ -891,8 +935,8 @@ public final class DoubleDouble extends
      *
      *   <blockquote>remainder = a - b * (a.value / b.value)</blockquote>
      *
-     * @param numeratorValue The other value to divide by this {@code DoubleDouble}.
-     * @param numeratorError The error of the other value to divide by this {@code DoubleDouble}.
+     * @param  numeratorValue  the other value to divide by this {@code DoubleDouble}.
+     * @param  numeratorError  the error of the other value to divide by this {@code DoubleDouble}.
      */
     public void inverseDivide(final double numeratorValue, final double numeratorError) {
         if (DISABLED) {
@@ -929,9 +973,9 @@ public final class DoubleDouble extends
      *    inverseDivide(array[index], array[index + errorOffset]);
      * }
      *
-     * @param array        The array from which to get the value and error.
-     * @param index        Index of the value in the given array.
-     * @param errorOffset  Offset to add to {@code index} in order to get the index of the error in the given array.
+     * @param  array        the array from which to get the value and error.
+     * @param  index        index of the value in the given array.
+     * @param  errorOffset  offset to add to {@code index} in order to get the index of the error in the given array.
      */
     public void inverseDivide(final double[] array, final int index, final int errorOffset) {
         inverseDivide(array[index], array[index + errorOffset]);
@@ -1018,7 +1062,7 @@ public final class DoubleDouble extends
     /**
      * Returns a hash code value for this number.
      *
-     * @return A hash code value.
+     * @return a hash code value.
      */
     @Override
     public int hashCode() {
@@ -1028,7 +1072,7 @@ public final class DoubleDouble extends
     /**
      * Compares this number with the given object for equality.
      *
-     * @param  obj The other object to compare with this number.
+     * @param  obj  the other object to compare with this number.
      * @return {@code true} if both object are equal.
      */
     @Override
@@ -1047,7 +1091,7 @@ public final class DoubleDouble extends
      * Returns a string representation of this number for debugging purpose.
      * The returned string does not need to contains all digits that this {@code DoubleDouble} can handle.
      *
-     * @return A string representation of this number.
+     * @return a string representation of this number.
      */
     @Override
     public String toString() {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -444,7 +444,7 @@ public abstract class CompoundFormat<T>
         } else if (valueType == Angle.class) {
             return AngleFormat.getInstance(locale);
         } else if (valueType == Unit.class) {
-            return UnitFormat.getInstance(locale);
+            return new UnitFormat(locale);
         } else if (valueType == Range.class) {
             return new RangeFormat(locale);
         } else if (valueType == Class.class) {

Copied: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java (from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java?p2=sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java&p1=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java&r1=1766500&r2=1766508&rev=1766508&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -18,6 +18,7 @@ package org.apache.sis.math;
 
 import java.io.Serializable;
 import org.apache.sis.util.collection.WeakHashSet;
+import org.apache.sis.internal.jdk8.JDK8;
 
 
 /**
@@ -150,7 +151,7 @@ public final class Fraction extends Numb
             }
         }
         return (num == numerator && den == denominator) ? this
-               : new Fraction(Math.toIntExact(num), Math.toIntExact(den));
+               : new Fraction(JDK8.toIntExact(num), JDK8.toIntExact(den));
     }
 
     /**
@@ -161,7 +162,7 @@ public final class Fraction extends Numb
      * @throws ArithmeticException if the result overflows.
      */
     public Fraction negate() {
-        return (numerator == 0) ? this : new Fraction(Math.negateExact(numerator), denominator);
+        return (numerator == 0) ? this : new Fraction(-numerator, denominator);
     }
 
     /**
@@ -175,7 +176,7 @@ public final class Fraction extends Numb
         // Intermediate result must be computed in a type wider that the 'numerator' and 'denominator' type.
         final long td = this .denominator;
         final long od = other.denominator;
-        return simplify(Math.addExact(od * numerator, td * other.numerator), od * td);
+        return simplify(JDK8.addExact(od * numerator, td * other.numerator), od * td);
     }
 
     /**
@@ -189,7 +190,7 @@ public final class Fraction extends Numb
         // Intermediate result must be computed in a type wider that the 'numerator' and 'denominator' type.
         final long td = this .denominator;
         final long od = other.denominator;
-        return simplify(Math.subtractExact(od * numerator, td * other.numerator), od * td);
+        return simplify(JDK8.subtractExact(od * numerator, td * other.numerator), od * td);
     }
 
     /**




Mime
View raw message