sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1766508 [1/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
Author: desruisseaux
Date: Tue Oct 25 10:45:14 2016
New Revision: 1766508

URL: http://svn.apache.org/viewvc?rev=1766508&view=rev
Log:
Merge from the partial JSR-363 implementation from JDK8 branch.
Implementation is not yet finished, but there is enough working parts for an intermediate step.

Added:
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/converter/FractionConverter.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/converter/FractionConverter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java
      - copied, changed from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractConverter.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractConverter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/ConcatenatedConverter.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ConcatenatedConverter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ConventionalUnit.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/LinearConverter.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/LinearConverter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
      - copied, changed from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitDimension.java
      - copied, changed from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitDimension.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitRegistry.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitRegistry.java
    sis/branches/JDK7/core/sis-utility/src/main/resources/org/apache/sis/measure/
      - copied from r1766500, sis/branches/JDK8/core/sis-utility/src/main/resources/org/apache/sis/measure/
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/FractionTest.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/math/FractionTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/ConventionalUnitTest.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/ConventionalUnitTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/LinearConverterTest.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/LinearConverterTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/SystemUnitTest.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/SystemUnitTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitDimensionTest.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/UnitDimensionTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java
      - copied unchanged from r1766500, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java
Removed:
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/PatchedUnitFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/application/pom.xml
    sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java
    sis/branches/JDK7/application/sis-openoffice/pom.xml
    sis/branches/JDK7/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java
    sis/branches/JDK7/core/pom.xml
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/MapProjectionParameters.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/MatrixSIS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/GeneralMatrixTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix2Test.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/Matrix4Test.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/SolverTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/UnitAdapter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/Measure.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/SexagesimalConverter.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Characters.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
    sis/branches/JDK7/core/sis-utility/src/main/resources/META-INF/services/org.apache.sis.util.ObjectConverter
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/MeasureTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/SexagesimalConverterTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
    sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties
    sis/branches/JDK7/ide-project/eclipse/classpath
    sis/branches/JDK7/pom.xml

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 25 10:45:14 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1764735
+/sis/branches/JDK8:1584960-1766500
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/application/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/pom.xml?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/application/pom.xml (original)
+++ sis/branches/JDK7/application/pom.xml Tue Oct 25 10:45:14 2016
@@ -116,6 +116,7 @@
   <modules>
     <module>sis-webapp</module>
     <module>sis-console</module>
+<!--<module>sis-openoffice</module>     Omitted for now because of the numerous warnings emitted by Pack200. -->
   </modules>
 
 </project>

Modified: sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java [UTF-8] (original)
+++ sis/branches/JDK7/application/sis-console/src/main/java/org/apache/sis/console/TransformCommand.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -52,7 +52,6 @@ import org.apache.sis.internal.referenci
 import org.apache.sis.internal.referencing.DirectPositionView;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.storage.CodeType;
-import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.CRS;
 import org.apache.sis.internal.util.X364;
@@ -476,8 +475,8 @@ final class TransformCommand extends Met
             final CoordinateSystemAxis axis = cs.getAxis(i);
             String name =  axis.getName().getCode();
             name = Transliterator.DEFAULT.toShortAxisName(cs, axis.getDirection(), name);
-            final String unit = PatchedUnitFormat.toString(axis.getUnit());
-            if (unit != null && !unit.isEmpty()) {
+            final String unit = axis.getUnit().toString();
+            if (!unit.isEmpty()) {
                 name = name + " (" + unit + ')';
             }
             printQuotedText(name, ordinateWidth, X364.FOREGROUND_CYAN);

Modified: sis/branches/JDK7/application/sis-openoffice/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-openoffice/pom.xml?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-openoffice/pom.xml (original)
+++ sis/branches/JDK7/application/sis-openoffice/pom.xml Tue Oct 25 10:45:14 2016
@@ -91,10 +91,6 @@
       <artifactId>geoapi-pending</artifactId>
     </dependency>
     <dependency>
-      <groupId>javax.measure</groupId>
-      <artifactId>jsr-275</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.sis.core</groupId>
       <artifactId>sis-referencing</artifactId>
       <version>${project.version}</version>

Modified: sis/branches/JDK7/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java [UTF-8] (original)
+++ sis/branches/JDK7/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ReferencingFunctions.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -40,7 +40,6 @@ import org.apache.sis.util.Classes;
 import org.apache.sis.util.Locales;
 import org.apache.sis.util.collection.Cache;
 import org.apache.sis.util.resources.Errors;
-import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.internal.storage.CodeType;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStores;
@@ -232,7 +231,7 @@ public class ReferencingFunctions extend
                             return Errors.getResources(getJavaLocale()).getString(Errors.Keys.IndexOutOfBounds_1, dimension);
                         }
                     }
-                    final String unit = PatchedUnitFormat.toString(axis.getUnit());
+                    final String unit = axis.getUnit().toString();
                     name = Transliterator.DEFAULT.toShortAxisName(cs, axis.getDirection(), axis.getName().getCode());
                     if (unit != null && !unit.isEmpty()) {
                         name = name + " (" + unit + ')';

Modified: sis/branches/JDK7/core/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/pom.xml?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/pom.xml (original)
+++ sis/branches/JDK7/core/pom.xml Tue Oct 25 10:45:14 2016
@@ -170,10 +170,6 @@
       <artifactId>unit-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>tec.units</groupId>
-      <artifactId>unit-ri</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.opengis</groupId>
       <artifactId>geoapi-pending</artifactId>
     </dependency>

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -24,7 +24,6 @@ import org.opengis.annotation.UML;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
-import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.util.Characters;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.iso.Types;
@@ -41,7 +40,7 @@ import static org.apache.sis.util.CharSe
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class AxisDirections extends Static {
@@ -188,8 +187,8 @@ public final class AxisDirections extend
      *   <tr align="center"><td>{@code OTHER}</td><td>{@code OTHER}</td></tr>
      * </table>
      *
-     * @param  dir The direction for which to return the absolute direction, or {@code null}.
-     * @return The direction from the above table, or {@code null} if the given direction was null.
+     * @param  dir  the direction for which to return the absolute direction, or {@code null}.
+     * @return the direction from the above table, or {@code null} if the given direction was null.
      */
     public static AxisDirection absolute(AxisDirection dir) {
         final AxisDirection opposite = opposite(dir);
@@ -212,8 +211,8 @@ public final class AxisDirections extend
      * The same applies to {@code EAST}-{@code WEST}, {@code UP}-{@code DOWN} and {@code FUTURE}-{@code PAST},
      * <i>etc.</i> If the given axis direction has no opposite, then this method returns {@code null}.
      *
-     * @param  dir The direction for which to return the opposite direction, or {@code null}.
-     * @return The opposite direction, or {@code null} if none or unknown.
+     * @param  dir  the direction for which to return the opposite direction, or {@code null}.
+     * @return the opposite direction, or {@code null} if none or unknown.
      */
     public static AxisDirection opposite(AxisDirection dir) {
         return OPPOSITES.get(dir);
@@ -224,7 +223,7 @@ public final class AxisDirections extend
      * If the given argument is {@code null} or is not a known direction, then
      * this method conservatively returns {@code false}.
      *
-     * @param  dir The direction to test, or {@code null}.
+     * @param  dir  the direction to test, or {@code null}.
      * @return {@code true} if the given direction is an "opposite".
      */
     public static boolean isOpposite(final AxisDirection dir) {
@@ -236,7 +235,7 @@ public final class AxisDirections extend
      * Returns {@code true} if the specified direction is a compass direction.
      * Compass directions are {@code NORTH}, {@code EAST}, {@code NORTH_EAST}, etc.
      *
-     * @param  dir The direction to test, or {@code null}.
+     * @param  dir  the direction to test, or {@code null}.
      * @return {@code true} if the given direction is a compass direction.
      *
      * @see #angleForCompass(AxisDirection, AxisDirection)
@@ -251,7 +250,7 @@ public final class AxisDirections extend
      * Returns {@code true} if the specified direction is an inter-cardinal direction.
      * Inter-cardinal directions are {@code NORTH_EAST}, {@code SOUTH_SOUTH_EAST}, etc.
      *
-     * @param  dir The direction to test, or {@code null}.
+     * @param  dir  the direction to test, or {@code null}.
      * @return {@code true} if the given direction is an inter-cardinal direction.
      */
     public static boolean isIntercardinal(final AxisDirection dir) {
@@ -263,7 +262,7 @@ public final class AxisDirections extend
     /**
      * Returns {@code true} if the given direction is {@code UP} or {@code DOWN}.
      *
-     * @param  dir The direction to test, or {@code null}.
+     * @param  dir  the direction to test, or {@code null}.
      * @return {@code true} if the direction is vertical, or {@code false} otherwise.
      */
     public static boolean isVertical(final AxisDirection dir) {
@@ -275,7 +274,7 @@ public final class AxisDirections extend
      * Returns {@code true} if the given direction is {@code GEOCENTRIC_X}, {@code GEOCENTRIC_Y}
      * or {@code GEOCENTRIC_Z}.
      *
-     * @param  dir The direction to test, or {@code null}.
+     * @param  dir  the direction to test, or {@code null}.
      * @return {@code true} if the given direction is one of geocentric directions.
      */
     public static boolean isGeocentric(final AxisDirection dir) {
@@ -295,8 +294,8 @@ public final class AxisDirections extend
      *
      * <p>The rules implemented by this method may change in any future SIS version.</p>
      *
-     * @param  dir The direction to test, or {@code null}.
-     * @param  image {@code true} for accepting grid and image axis directions in addition to spatial ones.
+     * @param  dir    the direction to test, or {@code null}.
+     * @param  image  {@code true} for accepting grid and image axis directions in addition to spatial ones.
      * @return {@code true} if the given direction is presumed for spatial CS.
      */
     public static boolean isSpatialOrUserDefined(final AxisDirection dir, final boolean image) {
@@ -308,7 +307,7 @@ public final class AxisDirections extend
     /**
      * Returns {@code true} if the given direction is a user-defined direction (i.e. is not defined by GeoAPI).
      *
-     * @param  dir The direction to test, or {@code null}.
+     * @param  dir  the direction to test, or {@code null}.
      * @return {@code true} if the given direction is user-defined.
      */
     public static boolean isUserDefined(final AxisDirection dir) {
@@ -319,7 +318,7 @@ public final class AxisDirections extend
      * Returns {@code true} if the given direction is {@code COLUMN_POSITIVE}, {@code COLUMN_NEGATICE},
      * {@code ROW_POSITIVE} or {@code ROW_NEGATIVE}.
      *
-     * @param  dir The direction to test, or {@code null}.
+     * @param  dir  the direction to test, or {@code null}.
      * @return {@code true} if the given direction is presumed for grid CS.
      */
     public static boolean isGrid(final AxisDirection dir) {
@@ -331,9 +330,9 @@ public final class AxisDirections extend
     /**
      * Angle between geocentric directions only.
      *
-     * @param  source The start direction.
-     * @param  target The final direction.
-     * @return The angle as a multiple of 90°, or {@link Integer#MIN_VALUE} if none.
+     * @param  source  the start direction.
+     * @param  target  the final direction.
+     * @return the angle as a multiple of 90°, or {@link Integer#MIN_VALUE} if none.
      */
     public static int angleForGeocentric(final AxisDirection source, final AxisDirection target) {
         final int base = GEOCENTRIC_X.ordinal();
@@ -352,9 +351,9 @@ public final class AxisDirections extend
     /**
      * Angle between compass directions only (not for angle between direction along meridians).
      *
-     * @param  source The start direction.
-     * @param  target The final direction.
-     * @return The arithmetic angle as a multiple of 360/{@link #COMPASS_COUNT}, or {@link Integer#MIN_VALUE} if none.
+     * @param  source  the start direction.
+     * @param  target  the final direction.
+     * @return the arithmetic angle as a multiple of 360/{@link #COMPASS_COUNT}, or {@link Integer#MIN_VALUE} if none.
      *
      * @see #isCompass(AxisDirection)
      */
@@ -379,9 +378,9 @@ public final class AxisDirections extend
     /**
      * Angle between display directions only.
      *
-     * @param  source The start direction.
-     * @param  target The final direction.
-     * @return The arithmetic angle as a multiple of 360/{@link #DISPLAY_COUNT}, or {@link Integer#MIN_VALUE} if none.
+     * @param  source  the start direction.
+     * @param  target  the final direction.
+     * @return the arithmetic angle as a multiple of 360/{@link #DISPLAY_COUNT}, or {@link Integer#MIN_VALUE} if none.
      */
     public static int angleForDisplay(final AxisDirection source, final AxisDirection target) {
         final int base = DISPLAY_RIGHT.ordinal();
@@ -415,9 +414,9 @@ public final class AxisDirections extend
      * Returns the angular unit of the specified coordinate system.
      * The preference will be given to the longitude axis, if found.
      *
-     * @param  cs The coordinate system from which to get the angular unit, or {@code null}.
-     * @param  unit The default unit to return if no angular unit is found.
-     * @return The angular unit, of {@code unit} if no angular unit was found.
+     * @param  cs    the coordinate system from which to get the angular unit, or {@code null}.
+     * @param  unit  the default unit to return if no angular unit is found.
+     * @return the angular unit, of {@code unit} if no angular unit was found.
      *
      * @since 0.6
      *
@@ -447,9 +446,9 @@ public final class AxisDirections extend
      * If both the given direction and its opposite exist, then the dimension for the given
      * direction has precedence over the opposite direction.
      *
-     * @param  cs The coordinate system to inspect, or {@code null}.
-     * @param  direction The direction of the axis to search.
-     * @return The dimension of the axis using the given direction or its opposite, or -1 if none.
+     * @param  cs         the coordinate system to inspect, or {@code null}.
+     * @param  direction  the direction of the axis to search.
+     * @return the dimension of the axis using the given direction or its opposite, or -1 if none.
      */
     public static int indexOfColinear(final CoordinateSystem cs, final AxisDirection direction) {
         int fallback = -1;
@@ -472,9 +471,9 @@ public final class AxisDirections extend
      * Returns the index of the first dimension in {@code cs} where axes are colinear with the {@code subCS} axes.
      * If no such dimension is found, returns -1.
      *
-     * @param  cs    The coordinate system which contains all axes.
-     * @param  subCS The coordinate system to search into {@code cs}.
-     * @return The first dimension of a sequence of axes colinear with {@code subCS} axes, or {@code -1} if none.
+     * @param  cs     the coordinate system which contains all axes.
+     * @param  subCS  the coordinate system to search into {@code cs}.
+     * @return the first dimension of a sequence of axes colinear with {@code subCS} axes, or {@code -1} if none.
      *
      * @since 0.5
      */
@@ -508,9 +507,9 @@ public final class AxisDirections extend
      *       then it will be considered equivalent to {@code "WEST"}.</li>
      * </ul>
      *
-     * @param  name The name of the axis direction to search.
-     * @param  directions The list of axis directions in which to search.
-     * @return The first axis direction having a name matching the given one, or {@code null} if none.
+     * @param  name        the name of the axis direction to search.
+     * @param  directions  the list of axis directions in which to search.
+     * @return the first axis direction having a name matching the given one, or {@code null} if none.
      */
     public static AxisDirection find(final String name, final AxisDirection[] directions) {
         for (final AxisDirection candidate : directions) {
@@ -533,8 +532,8 @@ public final class AxisDirections extend
      * The later is a parser which may create new directions, while this method searches only in a set
      * of predefined directions and never create new ones.</p>
      *
-     * @param  name The name of the axis direction to search.
-     * @return The first axis direction having a name matching the given one, or {@code null} if none.
+     * @param  name  the name of the axis direction to search.
+     * @return the first axis direction having a name matching the given one, or {@code null} if none.
      */
     public static AxisDirection valueOf(String name) {
         name = trimWhitespaces(name.replace('_', ' '));
@@ -615,10 +614,10 @@ public final class AxisDirections extend
      * for resolving some ambiguities like whether {@link AxisDirection#EAST} is for "x" (Easting)
      * or "λ" (Longitude).
      *
-     * @param name      The axis name for which to suggest an abbreviation.
-     * @param direction The axis direction for which to suggest an abbreviation.
-     * @param unit      The axis unit of measurement, for disambiguation.
-     * @return A suggested abbreviation.
+     * @param  name       the axis name for which to suggest an abbreviation.
+     * @param  direction  the axis direction for which to suggest an abbreviation.
+     * @param  unit       the axis unit of measurement, for disambiguation.
+     * @return a suggested abbreviation.
      *
      * @since 0.6
      */
@@ -686,9 +685,9 @@ public final class AxisDirections extend
      *   <li>Compound CS: East (km), North (km), Up (m).</li>
      * </ul>
      *
-     * @param  buffer A buffer pre-filled with the name header.
-     * @param  axes The axes to append in the given buffer.
-     * @return A name for the given coordinate system type and axes.
+     * @param  buffer  a buffer pre-filled with the name header.
+     * @param  axes    the axes to append in the given buffer.
+     * @return a name for the given coordinate system type and axes.
      *
      * @since 0.6
      */
@@ -697,9 +696,12 @@ public final class AxisDirections extend
         for (final CoordinateSystemAxis axis : axes) {
             buffer.append(separator).append(Types.getCodeLabel(axis.getDirection()));
             separator = ", ";
-            final String symbol = PatchedUnitFormat.toString(axis.getUnit());
-            if (symbol != null && !symbol.isEmpty()) {
-                buffer.append(" (").append(symbol).append(')');
+            final Unit<?> unit = axis.getUnit();
+            if (unit != null) {
+                final String symbol = unit.toString();
+                if (symbol != null && !symbol.isEmpty()) {
+                    buffer.append(" (").append(symbol).append(')');
+                }
             }
         }
         return buffer.append('.').toString();

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -46,8 +46,8 @@ public final class MetadataUtilities ext
      * Returns the milliseconds value of the given date, or {@link Long#MIN_VALUE}
      * if the date us null.
      *
-     * @param  value The date, or {@code null}.
-     * @return The time in milliseconds, or {@code Long.MIN_VALUE} if none.
+     * @param  value  the date, or {@code null}.
+     * @return the time in milliseconds, or {@code Long.MIN_VALUE} if none.
      */
     public static long toMilliseconds(final Date value) {
         return (value != null) ? value.getTime() : Long.MIN_VALUE;
@@ -57,8 +57,8 @@ public final class MetadataUtilities ext
      * Returns the given milliseconds time to a date object, or returns null
      * if the given time is {@link Long#MIN_VALUE}.
      *
-     * @param  value The time in milliseconds.
-     * @return The date for the given milliseconds value, or {@code null}.
+     * @param  value  the time in milliseconds.
+     * @return the date for the given milliseconds value, or {@code null}.
      */
     public static Date toDate(final long value) {
         return (value != Long.MIN_VALUE) ? new Date(value) : null;
@@ -69,10 +69,10 @@ public final class MetadataUtilities ext
      * then this method logs a warning if we are in process of (un)marshalling a XML document or throw an exception
      * otherwise.
      *
-     * @param  classe   The class which invoke this method.
-     * @param  property The property name. Method name will be inferred by the usual Java bean convention.
-     * @param  strict   {@code true} if the value was expected to be strictly positive, or {@code false} if 0 is accepted.
-     * @param  newValue The argument value to verify.
+     * @param  classe    the class which invoke this method.
+     * @param  property  the property name. Method name will be inferred by the usual Java bean convention.
+     * @param  strict    {@code true} if the value was expected to be strictly positive, or {@code false} if 0 is accepted.
+     * @param  newValue  the argument value to verify.
      * @return {@code true} if the value is valid.
      * @throws IllegalArgumentException if the given value is negative and the problem has not been logged.
      */
@@ -81,7 +81,7 @@ public final class MetadataUtilities ext
     {
         if (newValue != null) {
             final double value = newValue.doubleValue();
-            if (!(strict ? value > 0 : value >= 0)) {   // Use '!' for catching NaN.
+            if (!(strict ? value > 0 : value >= 0)) {                               // Use '!' for catching NaN.
                 if (NilReason.forObject(newValue) == null) {
                     final String msg = logOrFormat(classe, property, strict
                             ? Errors.Keys.ValueNotGreaterThanZero_2
@@ -101,11 +101,11 @@ public final class MetadataUtilities ext
      * If the user argument is outside the expected range of values, then this method logs a warning
      * if we are in process of (un)marshalling a XML document or throw an exception otherwise.
      *
-     * @param  classe   The class which invoke this method.
-     * @param  property Name of the property to check.
-     * @param  minimum  The minimal legal value.
-     * @param  maximum  The maximal legal value.
-     * @param  newValue The value given by the user.
+     * @param  classe    the class which invoke this method.
+     * @param  property  name of the property to check.
+     * @param  minimum   the minimal legal value.
+     * @param  maximum   the maximal legal value.
+     * @param  newValue  the value given by the user.
      * @return {@code true} if the value is valid.
      * @throws IllegalArgumentException if the given value is out of range and the problem has not been logged.
      */
@@ -115,7 +115,7 @@ public final class MetadataUtilities ext
     {
         if (newValue != null) {
             final double value = newValue.doubleValue();
-            if (!(value >= minimum.doubleValue() && value <= maximum.doubleValue())) {  // Use '!' for catching NaN.
+            if (!(value >= minimum.doubleValue() && value <= maximum.doubleValue())) {      // Use '!' for catching NaN.
                 if (NilReason.forObject(newValue) == null) {
                     final String msg = logOrFormat(classe, property,
                             Errors.Keys.ValueOutOfRange_4, property, minimum, maximum, newValue);
@@ -133,10 +133,10 @@ public final class MetadataUtilities ext
      * Formats an error message and logs it if we are (un)marshalling a document, or return the message otherwise.
      * In the later case, it is caller's responsibility to use the message for throwing an exception.
      *
-     * @param  classe    The caller class, used only in case of warning message to log.
-     * @param  property  The property name. Method name will be inferred by the usual Java bean convention.
-     * @param  key       A {@code Errors.Keys} value.
-     * @param  arguments The argument to use for formatting the error message.
+     * @param  classe     the caller class, used only in case of warning message to log.
+     * @param  property   the property name. Method name will be inferred by the usual Java bean convention.
+     * @param  key        a {@code Errors.Keys} value.
+     * @param  arguments  the argument to use for formatting the error message.
      * @return {@code null} if the message has been logged, or the message to put in an exception otherwise.
      */
     private static String logOrFormat(final Class<?> classe, final String property, final short key, final Object... arguments) {
@@ -164,9 +164,9 @@ public final class MetadataUtilities ext
      *       warning or error messages in future SIS versions.</li>
      * </ul>
      *
-     * @param  classe The caller class, used only in case of warning message to log.
-     * @param  method The caller method, used only in case of warning message to log.
-     * @param  name   The property name, used only in case of error message to format.
+     * @param  classe  the caller class, used only in case of warning message to log.
+     * @param  method  the caller method, used only in case of warning message to log.
+     * @param  name    the property name, used only in case of error message to format.
      * @throws IllegalStateException if {@code isDefined} is {@code true} and we are not unmarshalling an object.
      *
      * @since 0.7
@@ -186,8 +186,8 @@ public final class MetadataUtilities ext
      * Returns the {@code gco:id} or {@code gml:id} value to use for the given object.
      * The returned identifier will be unique in the current XML document.
      *
-     * @param  object The object for which to get the unique identifier.
-     * @return The unique XML identifier, or {@code null} if none.
+     * @param  object  the object for which to get the unique identifier.
+     * @return the unique XML identifier, or {@code null} if none.
      *
      * @since 0.7
      */
@@ -206,7 +206,7 @@ public final class MetadataUtilities ext
                     final int s = buffer.append('-').length();
                     int n = 0;
                     do {
-                        if (++n == 100) return null;    //  Arbitrary limit.
+                        if (++n == 100) return null;                        //  Arbitrary limit.
                         id = buffer.append(n).toString();
                         buffer.setLength(s);
                     } while (!Context.setObjectForID(context, object, id));
@@ -220,8 +220,8 @@ public final class MetadataUtilities ext
      * Invoked by {@code setID(String)} method implementations for assigning an identifier to an object
      * at unmarshalling time.
      *
-     * @param object The object for which to assign an identifier.
-     * @param id The {@code gco:id} or {@code gml:id} value.
+     * @param object  the object for which to assign an identifier.
+     * @param id      the {@code gco:id} or {@code gml:id} value.
      *
      * @since 0.7
      */

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -339,7 +339,8 @@ abstract class AbstractParser implements
             if (locale == Locale.ROOT) {
                 return Units.valueOf(text);             // Most common case.
             }
-            unitFormat = UnitFormat.getInstance(locale);
+            unitFormat = new UnitFormat(locale);
+            unitFormat.setStyle(UnitFormat.Style.NAME);
         }
         return unitFormat.parse(text);
     }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -70,7 +70,6 @@ import org.apache.sis.util.resources.Voc
 import org.apache.sis.internal.util.X364;
 import org.apache.sis.internal.util.Citations;
 import org.apache.sis.internal.util.Constants;
-import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.internal.util.StandardDateFormat;
 import org.apache.sis.internal.simple.SimpleExtent;
 import org.apache.sis.internal.metadata.WKTKeywords;
@@ -344,8 +343,12 @@ public class Formatter implements Locali
         this.indentation   = (byte) indentation;
         this.numberFormat  = symbols.createNumberFormat();
         this.dateFormat    = new StandardDateFormat(symbols.getLocale());
-        this.unitFormat    = UnitFormat.getInstance(symbols.getLocale());
+        this.unitFormat    = new UnitFormat(symbols.getLocale());
         this.buffer        = new StringBuffer();
+        unitFormat.setStyle(UnitFormat.Style.NAME);
+        if (convention.usesCommonUnits) {
+            unitFormat.setLocale(Locale.US);
+        }
     }
 
     /**
@@ -1236,7 +1239,7 @@ public class Formatter implements Locali
                 keyword = isSimplified ? WKTKeywords.Unit : WKTKeywords.LengthUnit;
             } else if (base.equals(Units.RADIAN)) {
                 keyword = isSimplified ? WKTKeywords.Unit : WKTKeywords.AngleUnit;
-            } else if (base.equals(Units.ONE)) {
+            } else if (base.equals(Units.UNITY)) {
                 keyword = isSimplified ? WKTKeywords.Unit : WKTKeywords.ScaleUnit;
             } else if (base.equals(Units.SECOND)) {
                 keyword = WKTKeywords.TimeUnit;  // "Unit" alone is not allowed for time units according ISO 19162.
@@ -1250,13 +1253,17 @@ public class Formatter implements Locali
             closeQuote(fromIndex);
             resetColor();
             final double conversion = Units.toStandardUnit(unit);
-            appendExact(conversion);
+            if (Double.isNaN(conversion) && Units.isAngular(unit)) {
+                appendExact(Math.PI / 180);                 // Presume that we have sexagesimal degrees (see below).
+            } else {
+                appendExact(conversion);
+            }
             /*
-             * The EPSG code in UNIT elements is generally not recommended.
-             * But we make an exception for sexagesimal units (EPSG:9108, 9110 and 9111)
-             * because they can not be represented by a simple scale factor in WKT.
+             * The EPSG code in UNIT elements is generally not recommended. But we make an exception for sexagesimal
+             * units (EPSG:9108, 9110 and 9111) because they can not be represented by a simple scale factor in WKT.
+             * Those units are identified by a conversion factor set to NaN since the conversion is non-linear.
              */
-            if (convention == Convention.INTERNAL || PatchedUnitFormat.toFormattable(unit) != unit) {
+            if (convention == Convention.INTERNAL || Double.isNaN(conversion)) {
                 final Integer code = Units.getEpsgCode(unit, getEnclosingElement(1) instanceof CoordinateSystemAxis);
                 if (code != null) {
                     openElement(false, isWKT1 ? WKTKeywords.Authority : WKTKeywords.Id);

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -2227,7 +2227,7 @@ class GeodeticObjectParser extends MathT
                 buffer.append(number);
                 axes[i] = csFactory.createCoordinateSystemAxis(
                         singletonMap(CoordinateSystemAxis.NAME_KEY, buffer.toString()),
-                        number, AxisDirection.OTHER, Units.ONE);
+                        number, AxisDirection.OTHER, Units.UNITY);
             }
             final Map<String,Object> properties = parseMetadataAndClose(element, name, baseCRS);
             final CoordinateSystem derivedCS = referencing.createAbstractCS(

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -82,7 +82,7 @@ class MathTransformParser extends Abstra
      * For each {@code UNIT_KEYWORDS[i]} element, the associated base unit is {@code BASE_UNIT[i]}.
      */
     private static final Unit<?>[] BASE_UNITS = {
-        Units.METRE, Units.RADIAN, Units.ONE, Units.SECOND
+        Units.METRE, Units.RADIAN, Units.UNITY, Units.SECOND
     };
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -241,6 +241,8 @@ public class DefaultBand extends Default
      * @return Units in which sensor wavelengths are expressed.
      *
      * @since 0.5
+     *
+     * @see org.apache.sis.measure.Units#NANOMETRE
      */
     @Override
 /// @XmlElement(name = "boundUnits")

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -49,7 +49,7 @@ public final class SecondDefiningParamet
     /**
      * The measure, which is either the polar radius or the inverse of the flattening value.
      * We distinguish those two cases by the unit: if the measure is the inverse flattening,
-     * then the unit must be {@link Unit#ONE}.
+     * then the unit must be {@link Units#UNITY}.
      *
      * @see Ellipsoid#getSemiMinorAxis()
      * @see Ellipsoid#getInverseFlattening()
@@ -73,7 +73,7 @@ public final class SecondDefiningParamet
             secondDefiningParameter = new SecondDefiningParameter(ellipsoid, false);
         } else {
             if (ellipsoid.isIvfDefinitive()) {
-                measure = new Measure(ellipsoid.getInverseFlattening(), Units.ONE);
+                measure = new Measure(ellipsoid.getInverseFlattening(), Units.UNITY);
             } else {
                 measure = new Measure(ellipsoid.getSemiMinorAxis(), ellipsoid.getAxisUnit());
             }
@@ -86,7 +86,7 @@ public final class SecondDefiningParamet
      * @return {@code true} if the measure is the inverse of the flattening value.
      */
     public boolean isIvfDefinitive() {
-        return (measure != null) && Units.ONE.equals(measure.unit);
+        return (measure != null) && Units.UNITY.equals(measure.unit);
     }
 
     /**
@@ -131,7 +131,7 @@ public final class SecondDefiningParamet
      * @param measure The inverse flattening value.
      */
     public void setInverseFlattening(final Measure measure) {
-        if (measure.setUnit(Units.ONE)) {
+        if (measure.setUnit(Units.UNITY)) {
             Context.warningOccured(Context.current(), SecondDefiningParameter.class, "setInverseFlattening",
                     Errors.class, Errors.Keys.IncompatiblePropertyValue_1, "uom");
         }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -269,7 +269,7 @@ public class GeodeticObjectBuilder exten
      *           .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)
      *           .addName("NTF (Paris) / Lambert zone II")

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -16,6 +16,9 @@
  */
 package org.apache.sis.internal.referencing;
 
+import javax.measure.Unit;
+import javax.measure.Quantity;
+import javax.measure.quantity.Angle;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.GeneralParameterValue;
@@ -39,6 +42,7 @@ import org.apache.sis.parameter.DefaultP
 import org.apache.sis.io.wkt.ElementKind;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
+import org.apache.sis.measure.Units;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.resources.Vocabulary;
@@ -54,7 +58,7 @@ import org.apache.sis.util.resources.Voc
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class WKTUtilities extends Static {
@@ -67,8 +71,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given coordinate reference system as a formattable object.
      *
-     * @param  object The coordinate reference system, or {@code null}.
-     * @return The given coordinate reference system as a formattable object, or {@code null}.
+     * @param  object  the coordinate reference system, or {@code null}.
+     * @return the given coordinate reference system as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final CoordinateReferenceSystem object) {
         if (object instanceof FormattableObject) {
@@ -81,8 +85,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given coordinate system as a formattable object.
      *
-     * @param  object The coordinate system, or {@code null}.
-     * @return The given coordinate system as a formattable object, or {@code null}.
+     * @param  object  the coordinate system, or {@code null}.
+     * @return the given coordinate system as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final CoordinateSystem object) {
         if (object instanceof FormattableObject) {
@@ -95,8 +99,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given coordinate system axis as a formattable object.
      *
-     * @param  object The coordinate system axis, or {@code null}.
-     * @return The given coordinate system axis as a formattable object, or {@code null}.
+     * @param  object  the coordinate system axis, or {@code null}.
+     * @return the given coordinate system axis as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final CoordinateSystemAxis object) {
         if (object instanceof FormattableObject) {
@@ -109,8 +113,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given datum as a formattable object.
      *
-     * @param  object The datum, or {@code null}.
-     * @return The given datum as a formattable object, or {@code null}.
+     * @param  object  the datum, or {@code null}.
+     * @return the given datum as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final Datum object) {
         if (object instanceof FormattableObject) {
@@ -123,8 +127,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given geodetic datum as a formattable object.
      *
-     * @param  object The datum, or {@code null}.
-     * @return The given datum as a formattable object, or {@code null}.
+     * @param  object  the datum, or {@code null}.
+     * @return the given datum as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final GeodeticDatum object) {
         if (object instanceof FormattableObject) {
@@ -137,8 +141,8 @@ public final class WKTUtilities extends
     /**
      * Returns the ellipsoid as a formattable object.
      *
-     * @param  object The ellipsoid, or {@code null}.
-     * @return The given ellipsoid as a formattable object, or {@code null}.
+     * @param  object  the ellipsoid, or {@code null}.
+     * @return the given ellipsoid as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final Ellipsoid object) {
         if (object instanceof FormattableObject) {
@@ -151,8 +155,8 @@ public final class WKTUtilities extends
     /**
      * Returns the given prime meridian as a formattable object.
      *
-     * @param  object The prime meridian, or {@code null}.
-     * @return The given prime meridian as a formattable object, or {@code null}.
+     * @param  object  the prime meridian, or {@code null}.
+     * @return the given prime meridian as a formattable object, or {@code null}.
      */
     public static FormattableObject toFormattable(final PrimeMeridian object) {
         if (object instanceof FormattableObject) {
@@ -163,11 +167,31 @@ public final class WKTUtilities extends
     }
 
     /**
+     * If the given unit is one of the unit that can not be formatted without ambiguity in WKT format,
+     * return a proposed replacement. Otherwise returns {@code unit} unchanged.
+     *
+     * @param  <Q>   the unit dimension.
+     * @param  unit  the unit to test.
+     * @return the replacement to format, or {@code unit} if not needed.
+     *
+     * @since 0.8
+     */
+    @SuppressWarnings("unchecked")
+    public static <Q extends Quantity<Q>> Unit<Q> toFormattable(Unit<Q> unit) {
+        if (Units.isAngular(unit)) {
+            if (!((Unit<Angle>) unit).getConverterTo(Units.RADIAN).isLinear()) {
+                unit = (Unit<Q>) Units.DEGREE;
+            }
+        }
+        return unit;
+    }
+
+    /**
      * Appends the name of the given object to the formatter.
      *
-     * @param object    The object from which to get the name.
-     * @param formatter The formatter where to append the name.
-     * @param type      The key of colors to apply if syntax colors are enabled.
+     * @param  object     the object from which to get the name.
+     * @param  formatter  the formatter where to append the name.
+     * @param  type       the key of colors to apply if syntax colors are enabled.
      */
     public static void appendName(final IdentifiedObject object, final Formatter formatter, final ElementKind type) {
         String name = IdentifiedObjects.getName(object, formatter.getNameAuthority());
@@ -183,8 +207,8 @@ public final class WKTUtilities extends
     /**
      * Appends a {@linkplain ParameterValueGroup group of parameters} in a {@code Param_MT[…]} element.
      *
-     * @param parameters The parameter to append to the WKT, or {@code null} if none.
-     * @param formatter The formatter where to append the parameter.
+     * @param  parameters  the parameter to append to the WKT, or {@code null} if none.
+     * @param  formatter   the formatter where to append the parameter.
      */
     public static void appendParamMT(final ParameterValueGroup parameters, final Formatter formatter) {
         if (parameters != null) {
@@ -198,8 +222,8 @@ public final class WKTUtilities extends
      * If the supplied parameter is actually a {@linkplain ParameterValueGroup parameter group},
      * all contained parameters will be flattened in a single list.
      *
-     * @param parameter The parameter to append to the WKT, or {@code null} if none.
-     * @param formatter The formatter where to append the parameter.
+     * @param  parameter  the parameter to append to the WKT, or {@code null} if none.
+     * @param  formatter  the formatter where to append the parameter.
      */
     public static void append(GeneralParameterValue parameter, final Formatter formatter) {
         if (parameter instanceof ParameterValueGroup) {
@@ -228,9 +252,9 @@ public final class WKTUtilities extends
      * {@code affine}, {@code Cartesian}, {@code cylindrical}, {@code ellipsoidal}, {@code linear},
      * {@code parametric}, {@code polar}, {@code spherical}, {@code temporal} or {@code vertical}.
      *
-     * @param  base The abstract base interface.
-     * @param  type The interface or classes for which to get the WKT type.
-     * @return The WKT type for the given class or interface, or {@code null} if none.
+     * @param  base  the abstract base interface.
+     * @param  type  the interface or classes for which to get the WKT type.
+     * @return the WKT type for the given class or interface, or {@code null} if none.
      *
      * @see ReferencingUtilities#toPropertyName(Class, Class)
      */

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -174,7 +174,7 @@ public abstract class AbstractProvider e
      * Creates a descriptor for a scale parameter with a default value of 1.
      */
     static ParameterDescriptor<Double> createScale(final ParameterBuilder builder) {
-        return builder.createStrictlyPositive(1.0, Units.ONE);
+        return builder.createStrictlyPositive(1.0, Units.UNITY);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -58,7 +58,7 @@ public final class LambertConformalMichi
         SCALE_FACTOR = builder
                 .addIdentifier("1051")
                 .addName("Ellipsoid scaling factor")
-                .createStrictlyPositive(Double.NaN, Units.ONE);
+                .createStrictlyPositive(Double.NaN, Units.UNITY);
 
         PARAMETERS = builder
                 .addIdentifier(IDENTIFIER)

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -82,7 +82,7 @@ public final class Molodensky extends Ge
      * The operation parameter descriptor for the <cite>Flattening difference</cite> optional
      * parameter value. This parameter is defined by the EPSG database and can be used in
      * replacement of {@link #TGT_SEMI_MINOR}.
-     * Valid values range from -1 to +1, {@linkplain Unit#ONE dimensionless}.
+     * Valid values range from -1 to +1, {@linkplain Units#UNITY dimensionless}.
      */
     public static final ParameterDescriptor<Double> FLATTENING_DIFFERENCE;
 
@@ -93,7 +93,7 @@ public final class Molodensky extends Ge
     static {
         final ParameterBuilder builder = builder();
         AXIS_LENGTH_DIFFERENCE = builder.addIdentifier("8654").addName("Semi-major axis length difference").create(Double.NaN, Units.METRE);
-        FLATTENING_DIFFERENCE  = builder.addIdentifier("8655").addName("Flattening difference").createBounded(-1, +1, Double.NaN, Units.ONE);
+        FLATTENING_DIFFERENCE  = builder.addIdentifier("8655").addName("Flattening difference").createBounded(-1, +1, Double.NaN, Units.UNITY);
         PARAMETERS = builder.setRequired(true)
                 .addIdentifier("9604")
                 .addName("Molodensky")

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -176,7 +176,7 @@ public final class TransverseMercator ex
         }
         group.parameter(Constants.LATITUDE_OF_ORIGIN).setValue(latitude,  Units.DEGREE);
         group.parameter(Constants.CENTRAL_MERIDIAN)  .setValue(longitude, Units.DEGREE);
-        group.parameter(Constants.SCALE_FACTOR)      .setValue(0.9996, Units.ONE);
+        group.parameter(Constants.SCALE_FACTOR)      .setValue(0.9996, Units.UNITY);
         group.parameter(Constants.FALSE_EASTING)     .setValue(500000, Units.METRE);
         group.parameter(Constants.FALSE_NORTHING)    .setValue(isSouth ? 10000000 : 0, Units.METRE);
         return name;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -69,7 +69,7 @@ import static org.apache.sis.util.Utilit
  *             ParameterDescriptor<?>[] parameters = {
  *                 builder.addName("Latitude of natural origin")    .createBounded( -80,  +84, 0, Units.DEGREE),
  *                 builder.addName("Longitude of natural origin")   .createBounded(-180, +180, 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/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1766508&r1=1766507&r2=1766508&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] Tue Oct 25 10:45:14 2016
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.parameter;
 
+import java.util.Objects;
+import java.nio.file.Path;
 import java.io.Serializable;
 import java.io.File;
 import java.net.URL;
@@ -43,7 +45,6 @@ import org.apache.sis.internal.referenci
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.internal.metadata.WKTKeywords;
-import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.util.Numbers;
@@ -57,10 +58,6 @@ import org.apache.sis.util.Unconvertible
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 import static org.apache.sis.util.Utilities.deepEquals;
 
-// Branch-dependent imports
-import java.util.Objects;
-import java.nio.file.Path;
-
 
 /**
  * A single parameter value used by an operation method. {@code ParameterValue} instances are elements in
@@ -117,7 +114,7 @@ import java.nio.file.Path;
  * Consequently, the above-cited methods provide single points that subclasses can override
  * for modifying the behavior of all getter and setter methods.
  *
- * @param <T> The type of the value stored in this parameter.
+ * @param  <T>  the type of the value stored in this parameter.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
@@ -172,7 +169,7 @@ public class DefaultParameterValue<T> ex
      * Creates a parameter value from the specified descriptor.
      * The value will be initialized to the default value, if any.
      *
-     * @param descriptor The abstract definition of this parameter.
+     * @param  descriptor  the abstract definition of this parameter.
      */
     public DefaultParameterValue(final ParameterDescriptor<T> descriptor) {
         ensureNonNull("descriptor", descriptor);
@@ -186,7 +183,7 @@ public class DefaultParameterValue<T> ex
      * This is a <em>shallow</em> copy constructor, since the value contained in the given
      * object is not cloned.
      *
-     * @param parameter The parameter to copy values from.
+     * @param  parameter  the parameter to copy values from.
      *
      * @see #clone()
      * @see #unmodifiable(ParameterValue)
@@ -201,7 +198,7 @@ public class DefaultParameterValue<T> ex
     /**
      * Returns the definition of this parameter.
      *
-     * @return The definition of this parameter.
+     * @return the definition of this parameter.
      */
     @Override
     @XmlElement(name = "operationParameter", required = true)
@@ -218,7 +215,7 @@ public class DefaultParameterValue<T> ex
      * All getter methods which need unit information will invoke this {@code getUnit()} method.
      * Subclasses can override this method if they need to compute the unit dynamically.
      *
-     * @return The unit of measure, or {@code null} if none.
+     * @return the unit of measure, or {@code null} if none.
      *
      * @see #doubleValue()
      * @see #doubleValueList()
@@ -238,7 +235,7 @@ public class DefaultParameterValue<T> ex
      * All getter methods will invoke this {@code getValue()} method.
      * Subclasses can override this method if they need to compute the value dynamically.
      *
-     * @return The parameter value as an object, or {@code null} if no value has been set
+     * @return the parameter value as an object, or {@code null} if no value has been set
      *         and there is no default value.
      *
      * @see #setValue(Object)
@@ -256,7 +253,7 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation invokes {@link #getValue()} and casts the result if possible,
      * or throws an exception otherwise.</p>
      *
-     * @return The boolean value represented by this parameter.
+     * @return the boolean value represented by this parameter.
      * @throws InvalidParameterTypeException if the value is not a boolean type.
      * @throws IllegalStateException if the value is not defined and there is no default value.
      *
@@ -279,7 +276,7 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation invokes {@link #getValue()} and casts the result if possible,
      * or throws an exception otherwise.</p>
      *
-     * @return The numeric value represented by this parameter after conversion to type {@code int}.
+     * @return the numeric value represented by this parameter after conversion to type {@code int}.
      * @throws InvalidParameterTypeException if the value is not an integer type.
      * @throws IllegalStateException if the value is not defined and there is no default value.
      *
@@ -306,7 +303,7 @@ public class DefaultParameterValue<T> ex
      * or throws an exception otherwise. If the value can be casted, then the array is cloned before
      * to be returned.</p>
      *
-     * @return A copy of the sequence of values represented by this parameter.
+     * @return a copy of the sequence of values represented by this parameter.
      * @throws InvalidParameterTypeException if the value is not an array of {@code int}s.
      * @throws IllegalStateException if the value is not defined and there is no default value.
      *
@@ -330,7 +327,7 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation invokes {@link #getValue()} and casts the result if possible,
      * or throws an exception otherwise.</p>
      *
-     * @return The numeric value represented by this parameter after conversion to type {@code double}.
+     * @return the numeric value represented by this parameter after conversion to type {@code double}.
      *         This method returns {@link Double#NaN} only if such "value" has been explicitely set.
      * @throws InvalidParameterTypeException if the value is not a numeric type.
      * @throws IllegalStateException if the value is not defined and there is no default value.
@@ -357,7 +354,7 @@ public class DefaultParameterValue<T> ex
      * or throws an exception otherwise. If the value can be casted, then the array is cloned before
      * to be returned.</p>
      *
-     * @return A copy of the sequence of values represented by this parameter.
+     * @return a copy of the sequence of values represented by this parameter.
      * @throws InvalidParameterTypeException if the value is not an array of {@code double}s.
      * @throws IllegalStateException if the value is not defined and there is no default value.
      *
@@ -401,8 +398,8 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation invokes {@link #doubleValue()} and {@link #getUnit()},
      * then converts the values to the given unit of measurement.</p>
      *
-     * @param  unit The unit of measure for the value to be returned.
-     * @return The numeric value represented by this parameter after conversion to type
+     * @param  unit  the unit of measure for the value to be returned.
+     * @return the numeric value represented by this parameter after conversion to type
      *         {@code double} and conversion to {@code unit}.
      * @throws IllegalArgumentException if the specified unit is invalid for this parameter.
      * @throws InvalidParameterTypeException if the value is not a numeric type.
@@ -426,7 +423,7 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation invokes {@link #doubleValueList()} and {@link #getUnit()},
      * then converts the values to the given unit of measurement.</p>
      *
-     * @param  unit The unit of measure for the value to be returned.
+     * @param  unit  the unit of measure for the value to be returned.
      * @return The sequence of values represented by this parameter after conversion to type
      *         {@code double} and conversion to {@code unit}.
      * @throws IllegalArgumentException if the specified unit is invalid for this parameter.
@@ -452,7 +449,7 @@ public class DefaultParameterValue<T> ex
      * Returns the string value of this parameter.
      * A string value does not have an associated unit of measure.
      *
-     * @return The string value represented by this parameter.
+     * @return the string value represented by this parameter.
      * @throws InvalidParameterTypeException if the value is not a string.
      * @throws IllegalStateException if the value is not defined and there is no default value.
      *
@@ -474,7 +471,7 @@ public class DefaultParameterValue<T> ex
      * The default implementation can convert the following value types:
      * {@link URI}, {@link URL}, {@link Path}, {@link File}.
      *
-     * @return The reference to a file containing parameter values.
+     * @return the reference to a file containing parameter values.
      * @throws InvalidParameterTypeException if the value is not a reference to a file or an URI.
      * @throws IllegalStateException if the value is not defined and there is no default value.
      *
@@ -558,7 +555,7 @@ public class DefaultParameterValue<T> ex
      * This implementation does not clone the given value. In particular, references to {@code int[]}
      * and {@code double[]} arrays are stored <cite>as-is</cite>.</p>
      *
-     * @param  value The parameter value, or {@code null} to restore the default.
+     * @param  value  the parameter value, or {@code null} to restore the default.
      * @throws InvalidParameterValueException if the type of {@code value} is inappropriate for this parameter,
      *         or if the value is illegal for some other reason (for example the value is numeric and out of range).
      *
@@ -592,7 +589,7 @@ public class DefaultParameterValue<T> ex
      *
      * <p>The default implementation delegates to {@link #setValue(Object, Unit)}.</p>
      *
-     * @param  value The parameter value.
+     * @param  value  the parameter value.
      * @throws InvalidParameterValueException if the boolean type is inappropriate for this parameter.
      *
      * @see #booleanValue()
@@ -610,7 +607,7 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation wraps the given integer in an object of the type specified by the
      * {@linkplain #getDescriptor() descriptor}, then delegates to {@link #setValue(Object, Unit)}.</p>
      *
-     * @param  value The parameter value.
+     * @param  value  the parameter value.
      * @throws InvalidParameterValueException if the integer type is inappropriate for this parameter,
      *         or if the value is illegal for some other reason (for example a value out of range).
      *
@@ -635,7 +632,7 @@ public class DefaultParameterValue<T> ex
     /**
      * Wraps the given value in a type compatible with the expected value class, if possible.
      *
-     * @throws IllegalArgumentException If the given value can not be converted to the given type.
+     * @throws IllegalArgumentException if the given value can not be converted to the given type.
      */
     @SuppressWarnings("unchecked")
     private static Number wrap(final double value, final Class<?> valueClass) throws IllegalArgumentException {
@@ -652,10 +649,9 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation wraps the given number in an object of the type specified by the
      * {@linkplain #getDescriptor() descriptor}, then delegates to {@link #setValue(Object, Unit)}.</p>
      *
-     * @param value The parameter value.
-     * @throws InvalidParameterValueException if the floating point type is inappropriate for this
-     *         parameter, or if the value is illegal for some other reason (for example a value out
-     *         of range).
+     * @param  value  the parameter value.
+     * @throws InvalidParameterValueException if the floating point type is inappropriate for this parameter,
+     *         or if the value is illegal for some other reason (for example a value out of range).
      *
      * @see #setValue(double,Unit)
      * @see #doubleValue()
@@ -677,8 +673,8 @@ public class DefaultParameterValue<T> ex
      * <p>The default implementation wraps the given number in an object of the type specified by the
      * {@linkplain #getDescriptor() descriptor}, then delegates to {@link #setValue(Object, Unit)}.</p>
      *
-     * @param  value The parameter value.
-     * @param  unit The unit for the specified value.
+     * @param  value  the parameter value.
+     * @param  unit   the unit for the specified value.
      * @throws InvalidParameterValueException if the floating point type is inappropriate for this parameter,
      *         or if the value is illegal for some other reason (for example a value out of range).
      *
@@ -702,8 +698,8 @@ public class DefaultParameterValue<T> ex
      *
      * <p>The default implementation delegates to {@link #setValue(Object, Unit)}.</p>
      *
-     * @param  values The parameter values.
-     * @param  unit The unit for the specified value.
+     * @param  values  the parameter values.
+     * @param  unit    the unit for the specified value.
      * @throws InvalidParameterValueException if the floating point array type is inappropriate for this parameter,
      *         or if the value is illegal for some other reason (for example a value out of range).
      */
@@ -725,8 +721,8 @@ public class DefaultParameterValue<T> ex
      * subclasses can override if they want to perform more processing on the value before its storage,
      * or to be notified about value changes.
      *
-     * @param  value The parameter value, or {@code null} to restore the default.
-     * @param  unit  The unit associated to the new parameter value, or {@code null}.
+     * @param  value  the parameter value, or {@code null} to restore the default.
+     * @param  unit   the unit associated to the new parameter value, or {@code null}.
      * @throws InvalidParameterValueException if the type of {@code value} is inappropriate for this parameter,
      *         or if the value is illegal for some other reason (for example the value is numeric and out of range).
      *
@@ -760,8 +756,8 @@ public class DefaultParameterValue<T> ex
      * {@linkplain DefaultParameterDescriptor#getValidValues() valid values} are performed
      * before this method is invoked. The default implementation of this method does nothing.
      *
-     * @param  value The value converted to the unit of measurement specified by the descriptor.
-     * @throws InvalidParameterValueException If the given value is invalid for implementation-specific reasons.
+     * @param  value  the value converted to the unit of measurement specified by the descriptor.
+     * @throws InvalidParameterValueException if the given value is invalid for implementation-specific reasons.
      */
     protected void validate(final T value) throws InvalidParameterValueException {
     }
@@ -770,8 +766,8 @@ public class DefaultParameterValue<T> ex
      * Compares the specified object with this parameter for equality.
      * The strictness level is controlled by the second argument.
      *
-     * @param  object The object to compare to {@code this}.
-     * @param  mode The strictness level of the comparison.
+     * @param  object  the object to compare to {@code this}.
+     * @param  mode    the strictness level of the comparison.
      * @return {@code true} if both objects are equal according the given comparison mode.
      */
     @Override
@@ -808,7 +804,7 @@ public class DefaultParameterValue<T> ex
      *
      * Subclasses shall override {@link #equals(Object, ComparisonMode)} instead than this method.
      *
-     * @param  object The object to compare to {@code this}.
+     * @param  object  the object to compare to {@code this}.
      * @return {@code true} if both objects are equal.
      */
     @Override
@@ -818,9 +814,9 @@ public class DefaultParameterValue<T> ex
 
     /**
      * Returns a hash value for this parameter.
+     * This value does not need to be the same in past or future versions of this class.
      *
-     * @return The hash code value. This value doesn't need to be the same
-     *         in past or future versions of this class.
+     * @return the hash code value.
      */
     @Override
     public int hashCode() {
@@ -842,7 +838,7 @@ public class DefaultParameterValue<T> ex
         try {
             return (DefaultParameterValue<T>) super.clone();
         } catch (CloneNotSupportedException exception) {
-            throw new AssertionError(exception); // Should not happen, since we are cloneable
+            throw new AssertionError(exception);                // Should not happen, since we are cloneable
         }
     }
 
@@ -871,9 +867,9 @@ public class DefaultParameterValue<T> ex
      * Transverse Mercator</cite> (UTM) projections use the same scale factor (0.9996) and false easting (500000 metres).
      * </div>
      *
-     * @param  <T> The type of the value stored in the given parameter.
-     * @param  parameter The parameter to make unmodifiable, or {@code null}.
-     * @return An unmodifiable implementation of the given parameter, or {@code null} if the given parameter was null.
+     * @param  <T>        the type of the value stored in the given parameter.
+     * @param  parameter  the parameter to make unmodifiable, or {@code null}.
+     * @return a unmodifiable implementation of the given parameter, or {@code null} if the given parameter was null.
      *
      * @since 0.6
      *
@@ -933,7 +929,7 @@ public class DefaultParameterValue<T> ex
      * }
      * </div>
      *
-     * @param  formatter The formatter where to format the inner content of this WKT element.
+     * @param  formatter  the formatter where to format the inner content of this WKT element.
      * @return {@code "Parameter"} or {@code "ParameterFile"}.
      *
      * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#119">WKT 2 specification §17.2.4</a>
@@ -974,7 +970,7 @@ public class DefaultParameterValue<T> ex
                 ignoreUnits = true;
             } else {
                 if (convention != Convention.INTERNAL) {
-                    unit = PatchedUnitFormat.toFormattable(unit);
+                    unit = WKTUtilities.toFormattable(unit);
                 }
                 ignoreUnits = unit.equals(contextualUnit);
             }
@@ -1092,7 +1088,7 @@ public class DefaultParameterValue<T> ex
         @XmlElement(name = "valueList",         type = MeasureList.class)
     })
     private Object getXmlValue() {
-        final Object value = getValue();    // Give to user a chance to override.
+        final Object value = getValue();                        // Give to user a chance to override.
         if (value != null) {
             if (value instanceof Number) {
                 final Number n = (Number) value;




Mime
View raw message