sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1767577 [10/15] - in /sis/trunk: ./ 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-feature/src/main/...
Date Tue, 01 Nov 2016 21:03:08 GMT
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -20,7 +20,6 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-import javax.measure.unit.SI;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.crs.CRSAuthorityFactory;
@@ -39,6 +38,7 @@ import org.apache.sis.internal.system.Lo
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.referencing.crs.HardCodedCRS;
 import org.apache.sis.referencing.datum.HardCodedDatum;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.LoggingWatcher;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
@@ -55,7 +55,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn(AuthorityFactoryProxyTest.class)
@@ -207,7 +207,7 @@ public final strictfp class MultiAuthori
         assertSame("With spaces",   HardCodedCRS  .DEPTH,     factory.createVerticalCRS  (" MoCk : : 9905"));
         assertSame("Version 0",     HardCodedDatum.SPHERE,    factory.createGeodeticDatum("MOCK: 0:6047"));
         assertSame("With spaces",   Extents       .WORLD,     factory.createExtent       ("MOCK: 2.3 : 1262"));
-        assertSame("With spaces",   SI            .METRE,     factory.createUnit         (" MoCK : : 9001 "));
+        assertSame("With spaces",   Units         .METRE,     factory.createUnit         (" MoCK : : 9001 "));
         assertEquals("Greenwich",   factory.getDescriptionText("MOCK:8901").toString());
         try {
             factory.createGeodeticDatum("MOCK2:4326");
@@ -236,7 +236,7 @@ public final strictfp class MultiAuthori
         assertSame("With version",  HardCodedDatum.WGS84,     factory.createDatum        ("urn:ogc:def:datum:mock:2.3:6326"));
         assertSame("Empty version", HardCodedDatum.GREENWICH, factory.createObject       ("urn:ogc:def:meridian: MoCk :: 8901"));
         assertSame("Version 0",     HardCodedDatum.SPHERE,    factory.createGeodeticDatum("urn:ogc:def:datum:MOCK: 0 :6047"));
-        assertSame("Upper case",    SI            .METRE,     factory.createUnit         ("URN:OGC:DEF:UOM:MOCK::9001"));
+        assertSame("Upper case",    Units         .METRE,     factory.createUnit         ("URN:OGC:DEF:UOM:MOCK::9001"));
         try {
             factory.createGeographicCRS("urn:ogc:def:datum:MOCK::4326");
             fail("Should create an object of the wrong type.");

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -23,7 +23,7 @@ import java.util.Locale;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Collections;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterValueGroup;
@@ -83,7 +83,7 @@ import static org.apache.sis.test.Refere
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Vadim Semenov
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -492,11 +492,11 @@ public final strictfp class EPSGFactoryT
             for (int i=0; i<dimension; i++) {
                 final CoordinateSystemAxis ref  = expected.getAxis(i);
                 final CoordinateSystemAxis axis = deprecated.getAxis(i);
-                assertEquals("name",         ref.getName(),         axis.getName());
-                assertEquals("alias",        ref.getAlias(),        axis.getAlias());
-                assertEquals("direction",    ref.getDirection(),    axis.getDirection());
-                assertEquals("rangeMeaning", ref.getRangeMeaning(), axis.getRangeMeaning());
-                assertEquals("unit",         ref.getUnit().toSI(),  axis.getUnit().toSI());
+                assertEquals("name",         ref.getName(),                 axis.getName());
+                assertEquals("alias",        ref.getAlias(),                axis.getAlias());
+                assertEquals("direction",    ref.getDirection(),            axis.getDirection());
+                assertEquals("rangeMeaning", ref.getRangeMeaning(),         axis.getRangeMeaning());
+                assertEquals("unit",         ref.getUnit().getSystemUnit(), axis.getUnit().getSystemUnit());
             }
         }
     }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -70,7 +70,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -322,7 +322,7 @@ public final strictfp class CoordinateOp
                 "  CS[ellipsoidal, 2],\n" +
                 "    Axis[“Latitude (φ)”, NORTH],\n" +
                 "    Axis[“Longitude (λ)”, EAST],\n" +
-                "    Unit[“grade”, 0.015707963267949],\n" +
+                "    Unit[“grad”, 0.015707963267949],\n" +
                 "  Id[“EPSG”, “4807”]]");
 
         final GeographicCRS       targetCRS = CommonCRS.WGS84.geographic();
@@ -369,7 +369,7 @@ public final strictfp class CoordinateOp
                 "    Axis[“(X)”, geocentricX],\n" +
                 "    Axis[“(Y)”, geocentricY],\n" +
                 "    Axis[“(Z)”, geocentricZ],\n" +
-                "    Unit[“km”, 1000]]");
+                "    Unit[“kilometre”, 1000]]");
 
         final GeocentricCRS       targetCRS = CommonCRS.WGS84.geocentric();
         final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -154,7 +154,7 @@ public final strictfp class CoordinateOp
                 "  CS[ellipsoidal, 2],\n" +
                 "    Axis[“Latitude (φ)”, NORTH],\n" +
                 "    Axis[“Longitude (λ)”, EAST],\n" +
-                "    Unit[“grade”, 0.015707963267948967]]");
+                "    Unit[“grad”, 0.015707963267948967]]");
                 // Intentionally omit Id[“EPSG”, 4807] for testing capability to find it back.
 
         final CoordinateReferenceSystem targetCRS = CommonCRS.WGS84.geographic();
@@ -224,7 +224,7 @@ public final strictfp class CoordinateOp
                 "  CS[ellipsoidal, 2],\n" +
                 "    Axis[“Longitude (λ)”, EAST],\n" +
                 "    Axis[“Latitude (φ)”, NORTH],\n" +
-                "    Unit[“grade”, 0.015707963267948967]]");
+                "    Unit[“grad”, 0.015707963267948967]]");
 
         final CoordinateReferenceSystem sourceCRS = CommonCRS.WGS84.normalizedGeographic();
         final CoordinateOperation operation = registry.createOperation(sourceCRS, targetCRS);
@@ -254,8 +254,8 @@ public final strictfp class CoordinateOp
                 "  $NTF,\n" +
                 "    PrimeMeridian[“Paris”, 2.5969213],\n" +
                 "  CS[ellipsoidal, 3],\n" +
-                "    Axis[“Latitude (φ)”, NORTH, Unit[“grade”, 0.015707963267948967]],\n" +
-                "    Axis[“Longitude (λ)”, EAST, Unit[“grade”, 0.015707963267948967]],\n" +
+                "    Axis[“Latitude (φ)”, NORTH, Unit[“grad”, 0.015707963267948967]],\n" +
+                "    Axis[“Longitude (λ)”, EAST, Unit[“grad”, 0.015707963267948967]],\n" +
                 "    Axis[“Height (h)”, UP, Unit[“m”, 1]]]");
 
         final CoordinateReferenceSystem targetCRS = CommonCRS.WGS84.geographic3D();

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -67,7 +67,7 @@ import static org.apache.sis.test.Metada
 public final strictfp class DefaultConversionTest extends TestCase {
     /**
      * The rotation from a CRS using the Paris prime meridian to a CRS using the Greenwich prime meridian,
-     * in degrees. The definitive value is 2.5969213 grades.
+     * in degrees. The definitive value is 2.5969213 grads.
      */
     private static final double OFFSET = 2.33722917;
 

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -93,7 +93,7 @@ public final strictfp class DefaultCoord
                 "    Datum[“Nouvelle Triangulation Française (Paris)”,\n" +
                 "      Ellipsoid[“Clarke 1880 (IGN)”, 6378249.2, 293.4660212936269]],\n" +
                 "      PrimeMeridian[“Paris”, 2.5969213],\n" +
-                "    Unit[“grade”, 0.015707963267948967]]\n," +
+                "    Unit[“grad”, 0.015707963267948967]]\n," +
                 "  Conversion[“Lambert zone II”,\n" +
                 "    Method[“Lambert Conic Conformal (1SP)”],\n" +
                 "    Parameter[“Latitude of natural origin”, 52.0],\n" +

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/SingleOperationMarshallingTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -20,7 +20,6 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.Iterator;
 import javax.xml.bind.JAXBException;
-import javax.measure.unit.NonSI;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
@@ -33,6 +32,7 @@ import org.opengis.referencing.crs.Geode
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.test.Validators;
+import org.apache.sis.measure.Units;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.internal.referencing.provider.Mercator1SP;
 import org.apache.sis.internal.jaxb.referencing.CC_OperationParameterGroupTest;
@@ -55,7 +55,7 @@ import static org.apache.sis.test.Refere
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -71,8 +71,8 @@ public final strictfp class SingleOperat
         final ParameterBuilder builder = new ParameterBuilder();
         builder.setCodeSpace(EPSG, "EPSG").setRequired(true);
         ParameterDescriptor<?>[] parameters = {
-            builder.addIdentifier("8801").addName("Latitude of natural origin" ).create(0, NonSI.DEGREE_ANGLE),
-            builder.addIdentifier("8802").addName("Longitude of natural origin").create(0, NonSI.DEGREE_ANGLE)
+            builder.addIdentifier("8801").addName("Latitude of natural origin" ).create(0, Units.DEGREE),
+            builder.addIdentifier("8802").addName("Longitude of natural origin").create(0, Units.DEGREE)
             // There is more parameters for a Mercator projection, but 2 is enough for this test.
         };
         builder.addName(null, "Mercator (1SP)");
@@ -221,9 +221,9 @@ public final strictfp class SingleOperat
         assertSame("parameters.descriptors", method.getParameters(), parameters.getDescriptor());
 
         final ParameterValue<?> parameter = (ParameterValue<?>) getSingleton(parameters.values());
-        assertSame  ("parameters.descriptor", descriptor,  parameter.getDescriptor());
-        assertEquals("parameters.unit",       NonSI.GRADE, parameter.getUnit());
-        assertEquals("parameters.value",      2.5969213,   parameter.getValue());
+        assertSame  ("parameters.descriptor", descriptor, parameter.getDescriptor());
+        assertEquals("parameters.unit",       Units.GRAD, parameter.getUnit());
+        assertEquals("parameters.value",      2.5969213,  parameter.getValue());
 
         final CoordinateReferenceSystem sourceCRS = c.getSourceCRS();
         assertInstanceOf("sourceCRS",            GeodeticCRS.class,  sourceCRS);

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.referencing.operation.projection;
 
-import javax.measure.unit.SI;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.OperationMethod;
@@ -27,6 +26,7 @@ import org.apache.sis.parameter.Paramete
 import org.apache.sis.referencing.operation.transform.ContextualParameters;
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.system.DefaultFactories;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
@@ -41,7 +41,7 @@ import static org.apache.sis.test.Assert
  * @author  Rémi Marechal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -130,11 +130,11 @@ public final strictfp class ObliqueStere
         /*
          * Following parameters are reproduced verbatim from EPSG registry and EPSG guide.
          */
-        p.parameter("Latitude of natural origin")    .setValue(φ0, SI.RADIAN);
-        p.parameter("Longitude of natural origin")   .setValue(λ0, SI.RADIAN);
+        p.parameter("Latitude of natural origin")    .setValue(φ0, Units.RADIAN);
+        p.parameter("Longitude of natural origin")   .setValue(λ0, Units.RADIAN);
         p.parameter("Scale factor at natural origin").setValue(k0);
-        p.parameter("False easting")                 .setValue(FE, SI.METRE);
-        p.parameter("False northing")                .setValue(FN, SI.METRE);
+        p.parameter("False easting")                 .setValue(FE, Units.METRE);
+        p.parameter("False northing")                .setValue(FN, Units.METRE);
 
         transform = new ObliqueStereographic(op, (Parameters) p);
     }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransformTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransformTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransformTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransformTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.referencing.operation.transform;
 
-import javax.measure.unit.SI;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.SphericalCS;
@@ -26,6 +25,7 @@ import org.apache.sis.referencing.crs.De
 import org.apache.sis.referencing.cs.CoordinateSystems;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.CommonCRS;
+import org.apache.sis.measure.Units;
 
 // Test dependencies
 import org.opengis.test.referencing.TransformTestCase;
@@ -42,7 +42,7 @@ import org.junit.Test;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -84,7 +84,7 @@ public final strictfp class CoordinateSy
      * Returns the given coordinate system but with linear axes in centimetres instead of metres.
      */
     private static CoordinateSystem toCentimetres(final CoordinateSystem cs) {
-        return CoordinateSystems.replaceLinearUnit(cs, SI.CENTIMETRE);
+        return CoordinateSystems.replaceLinearUnit(cs, Units.CENTIMETRE);
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.referencing.operation.transform;
 
 import java.util.Iterator;
-import javax.measure.unit.SI;
 import org.opengis.util.FactoryException;
 import org.opengis.geometry.DirectPosition;
 import org.opengis.referencing.datum.Ellipsoid;
@@ -29,6 +28,7 @@ import org.apache.sis.internal.referenci
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.geometry.DirectPosition2D;
 import org.apache.sis.geometry.GeneralDirectPosition;
+import org.apache.sis.measure.Units;
 
 import static java.lang.StrictMath.toRadians;
 
@@ -46,7 +46,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -152,7 +152,7 @@ public final strictfp class EllipsoidToC
     public void testHighEccentricity() throws FactoryException, TransformException, FactoryException {
         transform = EllipsoidToCentricTransform.createGeodeticConversion(
                 DefaultFactories.forBuildin(MathTransformFactory.class),
-                6000000, 4000000, SI.METRE, true, EllipsoidToCentricTransform.TargetType.CARTESIAN);
+                6000000, 4000000, Units.METRE, true, EllipsoidToCentricTransform.TargetType.CARTESIAN);
 
         final double delta = toRadians(100.0 / 60) / 1852;
         derivativeDeltas  = new double[] {delta, delta, 100};

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.referencing.operation.transform;
 
 import java.util.Iterator;
-import javax.measure.unit.SI;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
@@ -25,6 +24,7 @@ import org.opengis.referencing.operation
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.referencing.datum.HardCodedDatum;
 import org.apache.sis.referencing.operation.matrix.Matrices;
+import org.apache.sis.measure.Units;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -38,7 +38,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -209,7 +209,7 @@ public final strictfp class TransformSep
     @DependsOnMethod("testLinearTransform")
     public void testPassThroughTransform() throws FactoryException {
         final MathTransform nonLinear = new EllipsoidToCentricTransform(6378137, 6356752.314245179,
-                SI.METRE, false, EllipsoidToCentricTransform.TargetType.CARTESIAN);
+                Units.METRE, false, EllipsoidToCentricTransform.TargetType.CARTESIAN);
         final TransformSeparator s = new TransformSeparator(PassThroughTransform.create(2, nonLinear, 3));
         /*
          * Trivial case: no dimension specified, we should get the transform unchanged.

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -20,7 +20,7 @@ import java.util.Collection;
 import java.awt.geom.Rectangle2D;
 import java.awt.geom.RectangularShape;
 import java.awt.geom.AffineTransform;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.geometry.Envelope;
 import org.opengis.metadata.Identifier;
 import org.opengis.parameter.GeneralParameterValue;

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.test.integration;
 
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 import java.text.ParseException;
@@ -51,11 +50,11 @@ import static org.junit.Assert.*;
  *   <li>Format in WKT, parse, reformat again and verify that we get the same WKT string.</li>
  * </ul>
  *
- * This test is executed only of {@link #RUN_EXTENSIVE_TESTS} is {@code true}.
+ * This test is executed only if {@link #RUN_EXTENSIVE_TESTS} is {@code true}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final strictfp class ConsistencyTest extends TestCase {
@@ -68,15 +67,6 @@ public final strictfp class ConsistencyT
     ));
 
     /**
-     * Codes to exclude from the {@link #lookup(CoordinateReferenceSystem, CoordinateReferenceSystem)} test.
-     * The reason why those tests are excluded now is related to the way JSR-275 parse units. We may resolve
-     * those issues when we will replace JSR-275 by another library.
-     */
-    private static final Set<String> LOOKUP_EXCLUDES = Collections.singleton(
-            "EPSG:5754"         // Poolbeg height. Uses British foot (1936).
-    );
-
-    /**
      * Verifies the WKT consistency of all CRS instances.
      *
      * @throws FactoryException if an error other than "unsupported operation method" occurred.
@@ -135,10 +125,10 @@ public final strictfp class ConsistencyT
      * Formats the given CRS using the given formatter, parses it and reformat again.
      * Then the two WKT are compared.
      *
-     * @param  f    The formatter to use.
-     * @param  code The authority code, used only in case of errors.
-     * @param  crs  The CRS to test.
-     * @return The parsed CRS.
+     * @param  f     the formatter to use.
+     * @param  code  the authority code, used only in case of errors.
+     * @param  crs   the CRS to test.
+     * @return the parsed CRS.
      */
     private static CoordinateReferenceSystem parseAndFormat(final WKTFormat f,
             final String code, final CoordinateReferenceSystem crs)
@@ -227,9 +217,6 @@ public final strictfp class ConsistencyT
             throws FactoryException
     {
         final Identifier id = IdentifiedObjects.getIdentifier(crs, null);
-        if (LOOKUP_EXCLUDES.contains(IdentifiedObjects.toString(id))) {
-            return;
-        }
         /*
          * Lookup operation is not going to work if the CRS are not approximatively equal.
          */

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataTest.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataTest.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -24,7 +24,6 @@ import java.io.StringWriter;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.JAXBException;
-import javax.measure.unit.SI;
 
 import org.opengis.metadata.*;
 import org.opengis.metadata.citation.*;
@@ -46,6 +45,7 @@ import org.opengis.referencing.crs.Verti
 import org.opengis.referencing.datum.VerticalDatum;
 import org.opengis.referencing.datum.VerticalDatumType;
 
+import org.apache.sis.measure.Units;
 import org.apache.sis.metadata.iso.*;
 import org.apache.sis.metadata.iso.citation.*;
 import org.apache.sis.metadata.iso.constraint.*;
@@ -98,7 +98,7 @@ import org.apache.sis.internal.geoapi.ev
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see org.apache.sis.metadata.iso.DefaultMetadataTest
@@ -284,7 +284,7 @@ public strictfp class MetadataTest exten
             {
                 final DefaultCoordinateSystemAxis axis = new DefaultCoordinateSystemAxis(
                         singletonMap(DefaultCoordinateSystemAxis.NAME_KEY, new NamedIdentifier(null, "Depth")),
-                        "d", AxisDirection.DOWN, SI.METRE);
+                        "d", AxisDirection.DOWN, Units.METRE);
 
                 final DefaultVerticalCS cs = new DefaultVerticalCS(
                         singletonMap(DefaultVerticalCS.NAME_KEY, new NamedIdentifier(null, "Depth")),

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -23,6 +23,7 @@ import java.nio.charset.UnsupportedChars
 import java.net.URISyntaxException;
 import java.net.MalformedURLException;
 import java.nio.file.InvalidPathException;
+import javax.measure.format.ParserException;
 import org.apache.sis.math.FunctionProperty;
 import org.apache.sis.util.Locales;
 import org.apache.sis.util.Numbers;
@@ -82,8 +83,8 @@ abstract class StringConverter<T> extend
     /**
      * Creates a new converter for the given target class.
      *
-     * @param targetClass The {@linkplain #getTargetClass() target class}.
-     * @param inverse The inverse converter from the target to the source class.
+     * @param  targetClass  the {@linkplain #getTargetClass() target class}.
+     * @param  inverse      the inverse converter from the target to the source class.
      */
     @SuppressWarnings("OverridableMethodCallDuringObjectConstruction")
     StringConverter(final Class<T> targetClass) {
@@ -121,7 +122,7 @@ abstract class StringConverter<T> extend
      * This method verifies that the given string is non-null and non-empty,
      * then delegates to {@link #doConvert(String)}.
      *
-     * @param  source The string to convert, or {@code null}.
+     * @param  source  the string to convert, or {@code null}.
      * @return The converted value, or {@code null} if the given string was null or empty.
      * @throws UnconvertibleObjectException If an error occurred during the conversion.
      */
@@ -144,7 +145,7 @@ abstract class StringConverter<T> extend
      * Invoked by {@link #apply(String)} for converting the given string to the target
      * type of this converter.
      *
-     * @param  source The string to convert, guaranteed to be non-null and non-empty.
+     * @param  source  the string to convert, guaranteed to be non-null and non-empty.
      * @return The converted value.
      * @throws Exception If an error occurred during the conversion.
      */
@@ -302,12 +303,12 @@ abstract class StringConverter<T> extend
         }
     }
 
-    public static final class Unit extends StringConverter<javax.measure.unit.Unit<?>> {
+    public static final class Unit extends StringConverter<javax.measure.Unit<?>> {
         private static final long serialVersionUID = -1809497218136016210L;
         @SuppressWarnings("unchecked")
-        public Unit() {super((Class) javax.measure.unit.Unit.class);}               // Instantiated by ServiceLoader.
+        public Unit() {super((Class) javax.measure.Unit.class);}               // Instantiated by ServiceLoader.
 
-        @Override javax.measure.unit.Unit<?> doConvert(String source) throws IllegalArgumentException {
+        @Override javax.measure.Unit<?> doConvert(String source) throws ParserException {
             return Units.valueOf(source);
         }
     }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -201,14 +201,14 @@ public final class Context extends Marsh
      *     }
      * }
      *
-     * @param  bitMasks        A combination of {@link #MARSHALLING}, {@code SUBSTITUTE_*} or other bit masks.
-     * @param  locale          The locale, or {@code null} if unspecified.
-     * @param  timezone        The timezone, or {@code null} if unspecified.
-     * @param  schemas         The schemas root URL, or {@code null} if none.
-     * @param  versionGML      The GML version, or {@code null}.
-     * @param  resolver        The resolver in use.
-     * @param  converter       The converter in use.
-     * @param  warningListener The object to inform about warnings.
+     * @param  bitMasks         a combination of {@link #MARSHALLING}, {@code SUBSTITUTE_*} or other bit masks.
+     * @param  locale           the locale, or {@code null} if unspecified.
+     * @param  timezone         the timezone, or {@code null} if unspecified.
+     * @param  schemas          the schemas root URL, or {@code null} if none.
+     * @param  versionGML       the GML version, or {@code null}.
+     * @param  resolver         the resolver in use.
+     * @param  converter        the converter in use.
+     * @param  warningListener  the object to inform about warnings.
      */
     @SuppressWarnings("ThisEscapedInObjectConstruction")
     public Context(final int                bitMasks,
@@ -220,7 +220,7 @@ public final class Context extends Marsh
         this.bitMasks          = bitMasks;
         this.locales           = new LinkedList<>();
         this.timezone          = timezone;
-        this.schemas           = schemas; // No clone, because this class is internal.
+        this.schemas           = schemas;               // No clone, because this class is internal.
         this.versionGML        = versionGML;
         this.resolver          = resolver;
         this.converter         = converter;
@@ -242,7 +242,7 @@ public final class Context extends Marsh
     /**
      * Returns the locale to use for marshalling, or {@code null} if no locale were explicitly specified.
      *
-     * @return The locale in the context of current (un)marshalling process.
+     * @return the locale in the context of current (un)marshalling process.
      */
     @Override
     public final Locale getLocale() {
@@ -252,7 +252,7 @@ public final class Context extends Marsh
     /**
      * Returns the timezone to use for marshalling, or {@code null} if none were explicitely specified.
      *
-     * @return The timezone in the context of current (un)marshalling process.
+     * @return the timezone in the context of current (un)marshalling process.
      */
     @Override
     public final TimeZone getTimeZone() {
@@ -263,7 +263,7 @@ public final class Context extends Marsh
      * Returns the schema version of the XML document being (un)marshalled.
      * See the super-class javadoc for the list of prefix that we shall support.
      *
-     * @return The version in the context of current (un)marshalling process.
+     * @return the version in the context of current (un)marshalling process.
      */
     @Override
     public final Version getVersion(final String prefix) {
@@ -291,7 +291,7 @@ public final class Context extends Marsh
      * Returns the context of the XML (un)marshalling currently progressing in the current thread,
      * or {@code null} if none.
      *
-     * @return The current (un)marshalling context, or {@code null} if none.
+     * @return the current (un)marshalling context, or {@code null} if none.
      */
     public static Context current() {
         return CURRENT.get();
@@ -313,7 +313,7 @@ public final class Context extends Marsh
      *     }
      * }
      *
-     * @param locale The locale to set, or {@code null}.
+     * @param  locale  the locale to set, or {@code null}.
      */
     public static void push(Locale locale) {
         final Context current = current();
@@ -339,9 +339,9 @@ public final class Context extends Marsh
     /**
      * Returns {@code true} if the given flag is set.
      *
-     * @param  context The current context, or {@code null} if none.
-     * @param  flag One of {@link #MARSHALLING}, {@link #SUBSTITUTE_LANGUAGE},
-     *         {@link #SUBSTITUTE_COUNTRY} or other bit masks.
+     * @param  context  the current context, or {@code null} if none.
+     * @param  flag     one of {@link #MARSHALLING}, {@link #SUBSTITUTE_LANGUAGE}, {@link #SUBSTITUTE_COUNTRY}
+     *                  or other bit masks.
      * @return {@code true} if the given flag is set.
      */
     public static boolean isFlagSet(final Context context, final int flag) {
@@ -356,8 +356,8 @@ public final class Context extends Marsh
      * <div class="note"><b>API note:</b>
      * This method is static for the convenience of performing the check for null context.</div>
      *
-     * @param  context The current context, or {@code null} if none.
-     * @param  version The version to compare to.
+     * @param  context  the current context, or {@code null} if none.
+     * @param  version  the version to compare to.
      * @return {@code true} if the GML version is equals or newer than the specified version.
      *
      * @see #getVersion(String)
@@ -380,11 +380,11 @@ public final class Context extends Marsh
      * <div class="note"><b>API note:</b>
      * This method is static for the convenience of performing the check for null context.</div>
      *
-     * @param  context The current context, or {@code null} if none.
-     * @param  key One of the value documented in the <cite>"Map key"</cite> column of
-     *         {@link org.apache.sis.xml.XML#SCHEMAS}.
-     * @param  defaultSchema The value to return if no schema is found for the given key.
-     * @return The base URL of the schema, or an empty buffer if none were specified.
+     * @param  context        the current context, or {@code null} if none.
+     * @param  key            one of the value documented in the <cite>"Map key"</cite> column of
+     *                        {@link org.apache.sis.xml.XML#SCHEMAS}.
+     * @param  defaultSchema  the value to return if no schema is found for the given key.
+     * @return the base URL of the schema, or an empty buffer if none were specified.
      */
     public static StringBuilder schema(final Context context, final String key, String defaultSchema) {
         final StringBuilder buffer = new StringBuilder(128);
@@ -429,8 +429,8 @@ public final class Context extends Marsh
      * For performance reasons, this {@code wrapper} information is not provided by default.
      * See {@link #setWrapper(Context, PropertyType)} for more information.
      *
-     * @param  context The current context, or {@code null} if none.
-     * @return The {@code <gml:*PropertyType>} which is wrapping the {@code <gml:*Type>} object to (un)marshal,
+     * @param  context  the current context, or {@code null} if none.
+     * @return the {@code <gml:*PropertyType>} which is wrapping the {@code <gml:*Type>} object to (un)marshal,
      *         or {@code null} if unknown.
      */
     public static PropertyType<?,?> getWrapper(final Context context) {
@@ -446,9 +446,9 @@ public final class Context extends Marsh
      * {@code beforeUnmarshal(…)} method. For an implementation example, see
      * {@link org.apache.sis.internal.jaxb.referencing.CC_OperationParameter}.</p>
      *
-     * @param context The current context, or {@code null} if none.
-     * @param wrapper The {@code <gml:*PropertyType>} which is wrapping the {@code <gml:*Type>} object to (un)marshal,
-     *                or {@code null} if unknown.
+     * @param context  the current context, or {@code null} if none.
+     * @param wrapper  the {@code <gml:*PropertyType>} which is wrapping the {@code <gml:*Type>} object to (un)marshal,
+     *                 or {@code null} if unknown.
      */
     public static void setWrapper(final Context context, final PropertyType<?,?> wrapper) {
         if (context != null) {
@@ -460,9 +460,9 @@ public final class Context extends Marsh
      * If a {@code gml:id} value has already been used for the given object in the current XML document,
      * returns that identifier. Otherwise returns {@code null}.
      *
-     * @param  context The current context, or {@code null} if none.
-     * @param  object  The object for which to get the {@code gml:id}.
-     * @return The identifier used in the current XML document for the given object, or {@code null} if none.
+     * @param  context  the current context, or {@code null} if none.
+     * @param  object   the object for which to get the {@code gml:id}.
+     * @return the identifier used in the current XML document for the given object, or {@code null} if none.
      *
      * @since 0.7
      */
@@ -474,9 +474,9 @@ public final class Context extends Marsh
      * Returns the object for the given {@code gml:id}, or {@code null} if none.
      * This association is valid only for the current XML document.
      *
-     * @param  context The current context, or {@code null} if none.
-     * @param  id      The identifier for which to get the object.
-     * @return The object associated to the given identifier, or {@code null} if none.
+     * @param  context  the current context, or {@code null} if none.
+     * @param  id       the identifier for which to get the object.
+     * @return the object associated to the given identifier, or {@code null} if none.
      *
      * @since 0.7
      */
@@ -490,9 +490,9 @@ public final class Context extends Marsh
      * invocation of {@code Context} method.  If this method returns {@code false}, then the caller is responsible
      * for computing an other identifier candidate.
      *
-     * @param  context The current context, or {@code null} if none.
-     * @param  object  The object for which to assign the {@code gml:id}.
-     * @param  id      The identifier to assign to the given object.
+     * @param  context  the current context, or {@code null} if none.
+     * @param  object   the object for which to assign the {@code gml:id}.
+     * @param  id       the identifier to assign to the given object.
      * @return {@code true} if the given identifier can be used.
      *
      * @since 0.7
@@ -518,8 +518,8 @@ public final class Context extends Marsh
      * <div class="note"><b>API note:</b>
      * This method is static for the convenience of performing the check for null context.</div>
      *
-     * @param  context The current context, or {@code null} if none.
-     * @return The current reference resolver (never null).
+     * @param  context  the current context, or {@code null} if none.
+     * @return the current reference resolver (never null).
      */
     public static ReferenceResolver resolver(final Context context) {
         if (context != null) {
@@ -538,8 +538,8 @@ public final class Context extends Marsh
      * <div class="note"><b>API note:</b>
      * This method is static for the convenience of performing the check for null context.</div>
      *
-     * @param  context The current context, or {@code null} if none.
-     * @return The current value converter (never null).
+     * @param  context  the current context, or {@code null} if none.
+     * @return the current value converter (never null).
      */
     public static ValueConverter converter(final Context context) {
         if (context != null) {
@@ -558,14 +558,14 @@ public final class Context extends Marsh
      * <p>If the given {@code resources} is {@code null}, then this method will build the log
      * message from the {@code exception}.</p>
      *
-     * @param context   The current context, or {@code null} if none.
-     * @param level     The logging level.
-     * @param classe    The class to declare as the warning source.
-     * @param method    The name of the method to declare as the warning source.
-     * @param exception The exception thrown, or {@code null} if none.
-     * @param resources Either {@code Errors.class}, {@code Messages.class} or {@code null} for the exception message.
-     * @param key       The resource keys as one of the constants defined in the {@code Keys} inner class.
-     * @param arguments The arguments to be given to {@code MessageFormat} for formatting the log message.
+     * @param  context    the current context, or {@code null} if none.
+     * @param  level      the logging level.
+     * @param  classe     the class to declare as the warning source.
+     * @param  method     the name of the method to declare as the warning source.
+     * @param  exception  the exception thrown, or {@code null} if none.
+     * @param  resources  either {@code Errors.class}, {@code Messages.class} or {@code null} for the exception message.
+     * @param  key        the resource keys as one of the constants defined in the {@code Keys} inner class.
+     * @param  arguments  the arguments to be given to {@code MessageFormat} for formatting the log message.
      *
      * @since 0.5
      */
@@ -610,12 +610,12 @@ public final class Context extends Marsh
      * Convenience method for sending a warning for the given message from the {@link Errors} or {@link Messages}
      * resources. The message will be logged at {@link Level#WARNING}.
      *
-     * @param context   The current context, or {@code null} if none.
-     * @param classe    The class to declare as the warning source.
-     * @param method    The name of the method to declare as the warning source.
-     * @param resources Either {@code Errors.class} or {@code Messages.class}.
-     * @param key       The resource keys as one of the constants defined in the {@code Keys} inner class.
-     * @param arguments The arguments to be given to {@code MessageFormat} for formatting the log message.
+     * @param  context    the current context, or {@code null} if none.
+     * @param  classe     the class to declare as the warning source.
+     * @param  method     the name of the method to declare as the warning source.
+     * @param  resources  either {@code Errors.class} or {@code Messages.class}.
+     * @param  key        the resource keys as one of the constants defined in the {@code Keys} inner class.
+     * @param  arguments  the arguments to be given to {@code MessageFormat} for formatting the log message.
      *
      * @since 0.5
      */
@@ -629,11 +629,11 @@ public final class Context extends Marsh
      * Convenience method for sending a warning for the given exception.
      * The logger will be {@code "org.apache.sis.xml"}.
      *
-     * @param context   The current context, or {@code null} if none.
-     * @param classe    The class to declare as the warning source.
-     * @param method    The name of the method to declare as the warning source.
-     * @param cause     The exception which occurred.
-     * @param isWarning {@code true} for {@link Level#WARNING}, or {@code false} for {@link Level#FINE}.
+     * @param  context    the current context, or {@code null} if none.
+     * @param  classe     the class to declare as the warning source.
+     * @param  method     the name of the method to declare as the warning source.
+     * @param  cause      the exception which occurred.
+     * @param  isWarning  {@code true} for {@link Level#WARNING}, or {@code false} for {@link Level#FINE}.
      */
     public static void warningOccured(final Context context, final Class<?> classe,
             final String method, final Exception cause, final boolean isWarning)

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Distance.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Distance.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Distance.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Distance.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,11 +16,11 @@
  */
 package org.apache.sis.internal.jaxb.gco;
 
-import javax.measure.unit.SI;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.apache.sis.internal.jaxb.gml.Measure;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -33,7 +33,7 @@ import org.apache.sis.internal.jaxb.gml.
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 @XmlType(name = "Distance_PropertyType")
@@ -60,7 +60,7 @@ public final class GO_Distance extends X
      *       replace the Double type by some quantity type.
      */
     private GO_Distance(final Double value) {
-        distance = new Measure(value, SI.METRE);
+        distance = new Measure(value, Units.METRE);
         distance.asXPointer = true;
     }
 

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Measure.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,11 +16,11 @@
  */
 package org.apache.sis.internal.jaxb.gco;
 
-import javax.measure.unit.SI;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import org.apache.sis.internal.jaxb.gml.Measure;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -33,7 +33,7 @@ import org.apache.sis.internal.jaxb.gml.
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 @XmlType(name = "Measure_PropertyType")
@@ -60,7 +60,7 @@ public final class GO_Measure extends Xm
      *       replace the Double type by some quantity type.
      */
     private GO_Measure(final Double value) {
-        measure = new Measure(value, SI.METRE);
+        measure = new Measure(value, Units.METRE);
         measure.asXPointer = true;
     }
 

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,11 +16,10 @@
  */
 package org.apache.sis.internal.jaxb.gco;
 
-import javax.measure.unit.Unit;
+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/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -16,10 +16,11 @@
  */
 package org.apache.sis.internal.jaxb.gml;
 
+import java.util.Locale;
+import java.io.IOException;
 import java.net.URISyntaxException;
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
-import javax.measure.quantity.Quantity;
+import javax.measure.Unit;
+import javax.measure.Quantity;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlValue;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -27,6 +28,7 @@ import org.apache.sis.internal.jaxb.Cont
 import org.apache.sis.internal.jaxb.Schemas;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.DefinitionURI;
+import org.apache.sis.measure.UnitFormat;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.measure.Units;
 
@@ -62,7 +64,7 @@ import org.apache.sis.measure.Units;
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  *
  * @see org.apache.sis.measure.Measure
@@ -72,6 +74,16 @@ import org.apache.sis.measure.Units;
 @XmlType(name = "MeasureType")
 public final class Measure {
     /**
+     * An instance for formatting units with a syntax close to the UCUM one.
+     * While {@code UnitFormat} is generally not thread-safe, this particular
+     * instance is safe if we never invoke any setter method.
+     */
+    private static final UnitFormat UCUM = new UnitFormat(Locale.ROOT);
+    static {
+        UCUM.setStyle(UnitFormat.Style.UCUM);
+    }
+
+    /**
      * The value of the measure.
      */
     @XmlValue
@@ -123,7 +135,7 @@ public final class Measure {
      *     http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])
      * }
      *
-     * @return The string representation of the unit of measure.
+     * @return the string representation of the unit of measure.
      *
      * @todo Strictly speaking, the above URL should be used only for "m", "deg" and "rad" units because they
      *       are the only ones defined in the <code>gmxUom.xml</code> file. What should we do for other units?
@@ -138,10 +150,10 @@ public final class Measure {
      * {@code uom} attribute, instead of letting the {@code uom} attribute on the measurement value.
      * The main example is {@link org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis}.
      *
-     * @param  unit The unit to format.
+     * @param  unit       the unit to format.
      * @param  asXPointer {@code true} if the units shall be formatted as {@code xpointer}.
-     * @param  inAxis {@code true} for a unit used in Coordinate System Axis definition.
-     * @return The string representation of the unit of measure.
+     * @param  inAxis     {@code true} for a unit used in Coordinate System Axis definition.
+     * @return the string representation of the unit of measure.
      */
     public static String getUOM(final Unit<?> unit, final boolean asXPointer, final boolean inAxis) {
         if (!asXPointer) {
@@ -150,21 +162,24 @@ public final class Measure {
                 return DefinitionURI.PREFIX + ":uom:" + Constants.EPSG + "::" + code;
             }
         }
-        if (unit == null || unit.equals(Unit.ONE)) {
+        if (unit == null || unit.equals(Units.UNITY)) {
             return "";
         }
-        if (unit.equals(NonSI.PIXEL)) {
-            return "pixel"; // TODO: maybe not the most appropriate unit.
+        final StringBuilder buffer = Context.schema(Context.current(), "gmd", Schemas.METADATA_ROOT)
+                                            .append(Schemas.UOM_PATH).append("#xpointer(//*[@gml:id='");
+        try {
+            UCUM.format(unit, buffer);
+        } catch (IOException e) {
+            throw new AssertionError(e);        // Should never happen since we wrote to a StringBuilder.
         }
-        return Context.schema(Context.current(), "gmd", Schemas.METADATA_ROOT).append(Schemas.UOM_PATH)
-                .append("#xpointer(//*[@gml:id='").append(unit).append("'])").toString();
+        return buffer.append("'])").toString();
     }
 
     /**
      * Sets the unit of measure. This method is invoked by JAXB at unmarshalling time.
      *
-     * @param uom The unit of measure as a string.
-     * @throws URISyntaxException If the {@code uom} looks like a URI, but can not be parsed.
+     * @param  uom  the unit of measure as a string.
+     * @throws URISyntaxException if the {@code uom} looks like a URI, but can not be parsed.
      */
     public void setUOM(String uom) throws URISyntaxException {
         final Context context = Context.current();
@@ -177,11 +192,11 @@ public final class Measure {
      * @todo For now, this method does not format useful error message in case of wrong unit type.
      *       We define this method merely as a placeholder for future improvement in error handling.
      *
-     * @param  <Q>  Compile-time type of the {@code type} argument.
-     * @param  type The quantity for the desired unit.
-     * @return A unit compatible with the given type, or {@code null} if none.
+     * @param  <Q>   compile-time type of the {@code type} argument.
+     * @param  type  the quantity for the desired unit.
+     * @return a unit compatible with the given type, or {@code null} if none.
      */
-    public <Q extends Quantity> Unit<Q> getUnit(final Class<Q> type) {
+    public <Q extends Quantity<Q>> Unit<Q> getUnit(final Class<Q> type) {
         return (unit != null) ? unit.asType(type) : null;
     }
 
@@ -191,10 +206,10 @@ 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).
+     * @param  newUnit  the new unit (can not be null).
      * @return {@code true} if a different unit was defined before this method call.
      */
     public boolean setUnit(final Unit<?> newUnit) {
@@ -206,8 +221,8 @@ public final class Measure {
     /**
      * Sends a warning for a missing {@code "uom"} attribute.
      *
-     * @param caller     The class of the method invoking this method.
-     * @param methodName The name of the method invoking this method.
+     * @param  caller      the class of the method invoking this method.
+     * @param  methodName  the name of the method invoking this method.
      */
     public static void missingUOM(final Class<?> caller, final String methodName) {
         Context.warningOccured(Context.current(), caller, methodName,

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/MeasureList.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/MeasureList.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/MeasureList.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/MeasureList.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -23,7 +23,7 @@ import java.net.URISyntaxException;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlValue;
 import javax.xml.bind.annotation.XmlAttribute;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.util.ObjectConverter;
 import org.apache.sis.util.ObjectConverters;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java [UTF-8] Tue Nov  1 21:03:06 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/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Loggers.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Loggers.java?rev=1767577&r1=1767576&r2=1767577&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Loggers.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Loggers.java [UTF-8] Tue Nov  1 21:03:06 2016
@@ -57,6 +57,11 @@ public final class Loggers extends Stati
     public static final String MATH = "org.apache.sis.math";
 
     /**
+     * The logger for operations related to units of measurement.
+     */
+    public static final String MEASURE = "org.apache.sis.measure";
+
+    /**
      * The logger for operations related to JDBC operations.
      */
     public static final String SQL = "org.apache.sis.sql";



Mime
View raw message