You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2018/08/21 16:59:59 UTC

[sis] 01/02: Replace 'that' variable name by 'unit' for consistency with the name used in Unit API.

This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit a4af3b9ba57fb2ed2365467da98f73165f5550ea
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Tue Aug 21 11:16:13 2018 +0200

    Replace 'that' variable name by 'unit' for consistency with the name used in Unit API.
---
 .../java/org/apache/sis/measure/SystemUnit.java    | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java b/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
index 24d7827..6d51b8e 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/measure/SystemUnit.java
@@ -373,19 +373,19 @@ final class SystemUnit<Q extends Quantity<Q>> extends AbstractUnit<Q> implements
     /**
      * Returns a converter of numeric values from this unit to another unit of same type.
      *
-     * @param  that  the unit of same type to which to convert the numeric values.
+     * @param  unit  the unit of same type to which to convert the numeric values.
      * @return the converter from this unit to {@code that} unit.
      * @throws UnconvertibleException if the converter can not be constructed.
      */
     @Override
-    public UnitConverter getConverterTo(final Unit<Q> that) throws UnconvertibleException {
-        ArgumentChecks.ensureNonNull("that", that);
-        final Unit<Q> step = that.getSystemUnit();
+    public UnitConverter getConverterTo(final Unit<Q> unit) throws UnconvertibleException {
+        ArgumentChecks.ensureNonNull("unit", unit);
+        final Unit<Q> step = unit.getSystemUnit();
         if (step != this && !equalsIgnoreMetadata(step)) {
             // Should never occur unless parameterized type has been compromised.
-            throw new UnconvertibleException(incompatible(that));
+            throw new UnconvertibleException(incompatible(unit));
         }
-        if (step == that) {
+        if (step == unit) {
             return LinearConverter.IDENTITY;
         }
         /*
@@ -394,7 +394,7 @@ final class SystemUnit<Q extends Quantity<Q>> extends AbstractUnit<Q> implements
          * in Apache SIS implementation, the former returns directly ConventionalUnit.toTarget
          * while the later implies a recursive call to this method.
          */
-        return that.getConverterTo(step).inverse();
+        return unit.getConverterTo(step).inverse();
     }
 
     /**
@@ -402,24 +402,24 @@ final class SystemUnit<Q extends Quantity<Q>> extends AbstractUnit<Q> implements
      * This method can be used when the quantity type of the specified unit is unknown at compile-time
      * or when dimensional analysis allows for conversion between units of different type.
      *
-     * @param  that  the unit to which to convert the numeric values.
+     * @param  unit  the unit to which to convert the numeric values.
      * @return the converter from this unit to {@code that} unit.
      * @throws IncommensurableException if this unit is not {@linkplain #isCompatible(Unit) compatible} with {@code that} unit.
      *
      * @see #isCompatible(Unit)
      */
     @Override
-    public UnitConverter getConverterToAny(final Unit<?> that) throws IncommensurableException {
-        ArgumentChecks.ensureNonNull("that", that);
-        final Unit<?> step = that.getSystemUnit();
+    public UnitConverter getConverterToAny(final Unit<?> unit) throws IncommensurableException {
+        ArgumentChecks.ensureNonNull("unit", unit);
+        final Unit<?> step = unit.getSystemUnit();
         if (step != this && !isCompatible(step)) {
-            throw new IncommensurableException(incompatible(that));
+            throw new IncommensurableException(incompatible(unit));
         }
-        if (step == that) {
+        if (step == unit) {
             return LinearConverter.IDENTITY;
         }
         // Same remark than in getConverterTo(Unit).
-        return that.getConverterToAny(step).inverse();
+        return unit.getConverterToAny(step).inverse();
     }
 
     /**