sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1684639 - /sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
Date Wed, 10 Jun 2015 11:01:38 GMT
Author: desruisseaux
Date: Wed Jun 10 11:01:38 2015
New Revision: 1684639

URL: http://svn.apache.org/r1684639
Log:
Referencing: removed the parameter checks in MathTransformFactory.createFromParameterized(...)
since it duplicates the check done by the actual MathTransform implementations.
The check done in createFromParameterized was not efficient anyway, since it was implemented
by a copy of all parameter values in an implementation known to perform some checks.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1684639&r1=1684638&r2=1684639&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
[UTF-8] Wed Jun 10 11:01:38 2015
@@ -53,7 +53,6 @@ import org.apache.sis.internal.referenci
 import org.apache.sis.internal.metadata.ReferencingServices;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.referencing.j2d.ParameterizedAffine;
-import org.apache.sis.parameter.Parameters;
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.cs.CoordinateSystems;
 import org.apache.sis.referencing.operation.DefaultOperationMethod;
@@ -670,7 +669,7 @@ public class DefaultMathTransformFactory
      * @see #getLastMethodUsed()
      */
     @Override
-    public MathTransform createParameterizedTransform(ParameterValueGroup parameters)
+    public MathTransform createParameterizedTransform(final ParameterValueGroup parameters)
             throws NoSuchIdentifierException, FactoryException
     {
         final String methodName = parameters.getDescriptor().getName().getCode();
@@ -681,26 +680,8 @@ public class DefaultMathTransformFactory
                 throw new NoSuchIdentifierException(Errors.format( // For now, handle like
an unknown operation.
                         Errors.Keys.UnsupportedImplementation_1, Classes.getClass(method)),
methodName);
             }
-            /*
-             * If the "official" parameter descriptor was used, that descriptor should have
already
-             * enforced argument validity. Consequently, there is no need to performs the
check and
-             * we will avoid it as a performance enhancement.
-             */
-            final ParameterDescriptorGroup expected = method.getParameters();
-            final boolean isConform = expected.equals(parameters.getDescriptor());
             MathTransform transform;
             try {
-                if (!isConform) {
-                    /*
-                     * Copies all values from the user-supplied group to the provider-supplied
group.
-                     * The later should perform all needed checks. It is supplier's responsibility
to
-                     * know about alias (e.g. OGC, EPSG, ESRI),  since the caller probably
used names
-                     * from only one authority.
-                     */
-                    final ParameterValueGroup copy = expected.createValue();
-                    Parameters.copy(parameters, copy);
-                    parameters = copy;
-                }
                 transform  = ((MathTransformProvider) method).createMathTransform(this, parameters);
             } catch (IllegalArgumentException | IllegalStateException exception) {
                 /*



Mime
View raw message