sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1653101 - in /sis/branches/JDK7: ./ core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
Date Mon, 19 Jan 2015 20:10:44 GMT
Author: desruisseaux
Date: Mon Jan 19 20:10:43 2015
New Revision: 1653101

URL: http://svn.apache.org/r1653101
Log:
Merge the fix for NullArgumentException in DefaultOperationMethod(MathTransform) constructor.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 19 20:10:43 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1653076
+/sis/branches/JDK8:1584960-1653100
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java?rev=1653101&r1=1653100&r2=1653101&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
[UTF-8] Mon Jan 19 20:10:43 2015
@@ -46,6 +46,17 @@ import java.util.Objects;
  * contains an arbitrary amount of {@linkplain org.apache.sis.parameter.DefaultParameterDescriptor
parameter descriptors}.
  * Values for those parameters will be assigned by {@linkplain DefaultSingleOperation coordinate
operations}.
  *
+ * <div class="note"><b>Departure from the ISO 19111 standard:</b>
+ * the following properties are mandatory according ISO 19111,
+ * but may be missing under some conditions in Apache SIS:
+ * <ul>
+ *   <li>The {@linkplain #getFormula() formula} if it has not been provided to the
+ *     {@linkplain #DefaultOperationMethod(Map, Integer, Integer, ParameterDescriptorGroup)
constructor}, or if it
+ *     can not be {@linkplain #DefaultOperationMethod(MathTransform) inferred from the given
math transform}.</li>
+ *   <li>The {@linkplain #getParameters() parameters} if the {@link #DefaultOperationMethod(MathTransform)}
+ *     constructor can not infer them.</li>
+ * </ul></div>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @version 0.5
  * @since   0.5 (derived from geotk-2.0)
@@ -170,10 +181,15 @@ public class DefaultOperationMethod exte
      * @param transform The math transform to describe.
      */
     public DefaultOperationMethod(final MathTransform transform) {
-        this(getProperties(transform),
-             transform.getSourceDimensions(),
-             transform.getTargetDimensions(),
-             (transform instanceof Parameterized) ? ((Parameterized) transform).getParameterDescriptors()
: null);
+        super(getProperties(transform));
+        sourceDimension = transform.getSourceDimensions();
+        targetDimension = transform.getTargetDimensions();
+        if (transform instanceof Parameterized) {
+            parameters = ((Parameterized) transform).getParameterDescriptors();
+        } else {
+            parameters = null;
+        }
+        formula = null;
     }
 
     /**
@@ -317,6 +333,11 @@ public class DefaultOperationMethod exte
      * Formula(s) or procedure used by this operation method. This may be a reference to
a
      * publication. Note that the operation method may not be analytic, in which case this
      * attribute references or contains the procedure, not an analytic formula.
+     *
+     * <div class="note"><b>Departure from the ISO 19111 standard:</b>
+     * this property is mandatory according ISO 19111, but optional in Apache SIS.</div>
+     *
+     * @return The formula used by this method, or {@code null} if unknown.
      */
     @Override
     public Formula getFormula() {
@@ -326,6 +347,8 @@ public class DefaultOperationMethod exte
     /**
      * Number of dimensions in the source CRS of this operation method.
      * May be null if unknown, as in an <cite>Affine Transform</cite>.
+     *
+     * @return The dimension of source CRS, or {@code null} if unknown.
      */
     @Override
     public Integer getSourceDimensions() {
@@ -335,6 +358,8 @@ public class DefaultOperationMethod exte
     /**
      * Number of dimensions in the target CRS of this operation method.
      * May be null if unknown, as in an <cite>Affine Transform</cite>.
+     *
+     * @return The dimension of target CRS, or {@code null} if unknown.
      */
     @Override
     public Integer getTargetDimensions() {
@@ -343,6 +368,12 @@ public class DefaultOperationMethod exte
 
     /**
      * Returns the set of parameters.
+     *
+     * <div class="note"><b>Departure from the ISO 19111 standard:</b>
+     * this property is mandatory according ISO 19111, but may be null in Apache SIS if the
+     * {@linkplain #DefaultOperationMethod(MathTransform)} constructor has been unable to
infer it.</div>
+     *
+     * @return The parameters, or {@code null} if unknown.
      */
     @Override
     public ParameterDescriptorGroup getParameters() {



Mime
View raw message