sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1652872 - in /sis: branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/ branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ branches/JDK8/core/sis-referencing/s...
Date Sun, 18 Jan 2015 23:20:46 GMT
Author: desruisseaux
Date: Sun Jan 18 23:20:45 2015
New Revision: 1652872

URL: http://svn.apache.org/r1652872
Log:
Ported DefaultOperationMethod.

Added:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java   (with props)
    sis/ip-review/DefaultOperationMethod.xhtml   (with props)
    sis/ip-review/rev/07845/
    sis/ip-review/rev/07845/DefaultOperationMethod.xhtml   (with props)
    sis/ip-review/rev/07845/HEADER.html   (with props)
    sis/ip-review/rev/10796/DefaultOperationMethod.xhtml   (with props)
    sis/ip-review/rev/20874/DefaultOperationMethod.xhtml   (with props)
    sis/ip-review/rev/24925/DefaultOperationMethod.xhtml   (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java?rev=1652872&r1=1652871&r2=1652872&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java [UTF-8] Sun Jan 18 23:20:45 2015
@@ -20,15 +20,15 @@ import java.io.Serializable;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.operation.Formula;
+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.util.iso.Types;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
 // Branch-dependent imports
 import java.util.Objects;
-import org.apache.sis.io.wkt.ElementKind;
-import org.apache.sis.io.wkt.Formatter;
 
 
 /**
@@ -78,6 +78,38 @@ public class DefaultFormula extends Form
     }
 
     /**
+     * Creates a new formula with the same values than the specified one.
+     * This copy constructor provides a way to convert an arbitrary implementation into a SIS one
+     * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.
+     *
+     * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p>
+     *
+     * @param formula The formula to copy.
+     *
+     * @see #castOrCopy(Formula)
+     */
+    protected DefaultFormula(final Formula formula) {
+        ensureNonNull("formula", formula);
+        this.citation = formula.getCitation();
+        this.formula  = formula.getFormula();
+    }
+
+    /**
+     * Returns a SIS formula implementation with the same values than the given arbitrary implementation.
+     * If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
+     * Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.
+     *
+     * @param  object The object to get as a SIS implementation, or {@code null} if none.
+     * @return A SIS implementation containing the values of the given object (may be the
+     *         given object itself), or {@code null} if the argument was null.
+     */
+    public static DefaultFormula castOrCopy(final Formula object) {
+        return (object == null) || (object instanceof DefaultFormula)
+               ? (DefaultFormula) object : new DefaultFormula(object);
+    }
+
+    /**
      * Returns the formula(s) or procedure used by the operation method, or {@code null} if none.
      */
     @Override
@@ -129,8 +161,9 @@ public class DefaultFormula extends Form
      *
      * <div class="note"><b>Compatibility note:</b>
      * ISO 19162 does not define a WKT representation for {@code Formula} objects.
-     * The text formatted by this method is SIS-specific and causes the text to be flagged as
-     * {@linkplain Formatter#setInvalidWKT(Class, Exception) invalid WKT}.</div>
+     * The text formatted by this method is SIS-specific and causes the text to be
+     * flagged as {@linkplain Formatter#setInvalidWKT(Class, Exception) invalid WKT}.
+     * The WKT content of this element may change in any future SIS version.</div>
      *
      * @return {@code "Formula"}.
      */

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java?rev=1652872&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java (added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java [UTF-8] Sun Jan 18 23:20:45 2015
@@ -0,0 +1,418 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.referencing.operation;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.referencing.IdentifiedObject;
+import org.opengis.referencing.operation.Formula;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.OperationMethod;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.apache.sis.util.Utilities;
+import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.resources.Vocabulary;
+import org.apache.sis.parameter.Parameterized;
+import org.apache.sis.referencing.NamedIdentifier;
+import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.referencing.AbstractIdentifiedObject;
+import org.apache.sis.io.wkt.Formatter;
+
+import static org.apache.sis.util.ArgumentChecks.*;
+
+// Branch-dependent imports
+import java.util.Objects;
+
+
+/**
+ * Defines the algorithm and describes the parameters used to perform a coordinate operation. An {@code OperationMethod}
+ * 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}.
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @version 0.5
+ * @since   0.5 (derived from geotk-2.0)
+ * @module
+ *
+ * @see DefaultSingleOperation
+ */
+public class DefaultOperationMethod extends AbstractIdentifiedObject implements OperationMethod {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -8181774670648793964L;
+
+    /**
+     * 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.
+     */
+    private final Formula formula;
+
+    /**
+     * Number of dimensions in the source CRS of this operation method.
+     * May be {@code null} if this method can work with any number of
+     * source dimensions (e.g. <cite>Affine Transform</cite>).
+     */
+    private final Integer sourceDimension;
+
+    /**
+     * Number of dimensions in the target CRS of this operation method.
+     * May be {@code null} if this method can work with any number of
+     * target dimensions (e.g. <cite>Affine Transform</cite>).
+     */
+    private final Integer targetDimension;
+
+    /**
+     * The set of parameters, or {@code null} if none.
+     */
+    private final ParameterDescriptorGroup parameters;
+
+    /**
+     * Constructs an operation method from a set of properties and a descriptor group. The properties map is given
+     * unchanged to the {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
+     * In addition to the properties documented in the parent constructor,
+     * the following properties are understood by this constructor:
+     *
+     * <table class="sis">
+     *   <caption>Recognized properties (non exhaustive list)</caption>
+     *   <tr>
+     *     <th>Property name</th>
+     *     <th>Value type</th>
+     *     <th>Returned by</th>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.operation.OperationMethod#FORMULA_KEY}</td>
+     *     <td>{@link Formula}, {@link Citation} or {@link CharSequence}</td>
+     *     <td>{@link #getFormula()}</td>
+     *   </tr>
+     *   <tr>
+     *     <th colspan="3" class="hsep">Defined in parent classes (reminder)</th>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td>
+     *     <td>{@link Identifier} or {@link String}</td>
+     *     <td>{@link #getName()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#ALIAS_KEY}</td>
+     *     <td>{@link GenericName} or {@link CharSequence} (optionally as array)</td>
+     *     <td>{@link #getAlias()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#IDENTIFIERS_KEY}</td>
+     *     <td>{@link Identifier} (optionally as array)</td>
+     *     <td>{@link #getIdentifiers()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#REMARKS_KEY}</td>
+     *     <td>{@link InternationalString} or {@link String}</td>
+     *     <td>{@link #getRemarks()}</td>
+     *   </tr>
+     * </table>
+     *
+     * The source and target dimensions may be {@code null} if this method can work
+     * with any number of dimensions (e.g. <cite>Affine Transform</cite>).
+     *
+     * @param properties      Set of properties. Shall contain at least {@code "name"}.
+     * @param sourceDimension Number of dimensions in the source CRS of this operation method.
+     * @param targetDimension Number of dimensions in the target CRS of this operation method.
+     * @param parameters      The set of parameters.
+     */
+    public DefaultOperationMethod(final Map<String,?> properties,
+                                  final Integer sourceDimension,
+                                  final Integer targetDimension,
+                                  final ParameterDescriptorGroup parameters)
+    {
+        super(properties);
+        if (sourceDimension != null) ensurePositive("sourceDimension", sourceDimension);
+        if (targetDimension != null) ensurePositive("targetDimension", targetDimension);
+        ensureNonNull("parameters", parameters);
+
+        Object value = properties.get(FORMULA_KEY);
+        if (value == null || value instanceof Formula) {
+            formula = (Formula) value;
+        } else if (value instanceof Citation) {
+            formula = new DefaultFormula((Citation) value);
+        } else if (value instanceof CharSequence) {
+            formula = new DefaultFormula((CharSequence) value);
+        } else {
+            throw new IllegalArgumentException(Errors.getResources(properties)
+                    .getString(Errors.Keys.IllegalPropertyClass_2, FORMULA_KEY, value.getClass()));
+        }
+        this.parameters      = parameters;
+        this.sourceDimension = sourceDimension;
+        this.targetDimension = targetDimension;
+    }
+
+    /**
+     * Convenience constructor that creates an operation method from a math transform.
+     * The information provided in the newly created object are approximative, and
+     * usually acceptable only as a fallback when no other information are available.
+     *
+     * @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);
+    }
+
+    /**
+     * Work around for RFE #4093999 in Sun's bug database
+     * ("Relax constraint on placement of this()/super() call in constructors").
+     */
+    private static Map<String,?> getProperties(final MathTransform transform) {
+        ensureNonNull("transform", transform);
+        if (transform instanceof Parameterized) {
+            final ParameterDescriptorGroup parameters = ((Parameterized) transform).getParameterDescriptors();
+            if (parameters != null) {
+                return getProperties(parameters, null);
+            }
+        }
+        return Collections.singletonMap(NAME_KEY, Vocabulary.format(Vocabulary.Keys.Unnamed));
+    }
+
+    /**
+     * Returns the properties to be given to an identified object derived from the specified one.
+     * This method returns the same properties than the supplied argument (as of
+     * <code>{@linkplain IdentifiedObjects#getProperties(IdentifiedObject) getProperties}(info)</code>),
+     * except for the following:
+     *
+     * <ul>
+     *   <li>The {@linkplain IdentifiedObject#getName() name}'s authority is replaced by the specified one.</li>
+     *   <li>All {@linkplain IdentifiedObject#getIdentifiers identifiers} are removed, because the new object
+     *       to be created is probably not endorsed by the original authority.</li>
+     * </ul>
+     *
+     * This method returns a mutable map. Consequently, callers can add their own identifiers
+     * directly to this map if they wish.
+     *
+     * @param  info The identified object to view as a properties map.
+     * @param  authority The new authority for the object to be created,
+     *         or {@code null} if it is not going to have any declared authority.
+     * @return The identified object properties in a mutable map.
+     */
+    static Map<String,Object> getProperties(final IdentifiedObject info, final Citation authority) {
+        final Map<String,Object> properties = new HashMap<>(IdentifiedObjects.getProperties(info));
+        properties.put(NAME_KEY, new NamedIdentifier(authority, info.getName().getCode()));
+        properties.remove(IDENTIFIERS_KEY);
+        return properties;
+    }
+
+    /**
+     * Creates a new operation method with the same values than the specified one.
+     * This copy constructor provides a way to convert an arbitrary implementation into a SIS one
+     * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.
+     *
+     * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p>
+     *
+     * @param method The operation method to copy.
+     *
+     * @see #castOrCopy(OperationMethod)
+     */
+    protected DefaultOperationMethod(final OperationMethod method) {
+        super(method);
+        formula         = method.getFormula();
+        parameters      = method.getParameters();
+        sourceDimension = method.getSourceDimensions();
+        targetDimension = method.getTargetDimensions();
+    }
+
+    /**
+     * Returns a SIS operation method implementation with the same values than the given arbitrary implementation.
+     * If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
+     * Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.
+     *
+     * @param  object The object to get as a SIS implementation, or {@code null} if none.
+     * @return A SIS implementation containing the values of the given object (may be the
+     *         given object itself), or {@code null} if the argument was null.
+     */
+    public static DefaultOperationMethod castOrCopy(final OperationMethod object) {
+        return (object == null) || (object instanceof DefaultOperationMethod)
+               ? (DefaultOperationMethod) object : new DefaultOperationMethod(object);
+    }
+
+    /**
+     * Constructs a new operation method with the same values than the specified one except the dimensions.
+     * The source and target dimensions may be {@code null} if this method can work with any number of dimensions
+     * (e.g. <cite>Affine Transform</cite>).
+     *
+     * @param method The operation method to copy.
+     * @param sourceDimension Number of dimensions in the source CRS of this operation method.
+     * @param targetDimension Number of dimensions in the target CRS of this operation method.
+     */
+    private DefaultOperationMethod(final OperationMethod method,
+                                   final Integer sourceDimension,
+                                   final Integer targetDimension)
+    {
+        super(method);
+        this.formula    = method.getFormula();
+        this.parameters = method.getParameters();
+        this.sourceDimension = sourceDimension;
+        this.targetDimension = targetDimension;
+    }
+
+    /**
+     * Returns an operation method with the same values than the specified one except the dimensions.
+     * The source and target dimensions may be {@code null} if this method can work with any number of dimensions
+     * (e.g. <cite>Affine Transform</cite>).
+     *
+     * @param  method The operation method to redimension, or {@code null}.
+     * @param  sourceDimension Number of dimensions in the source CRS of this operation method.
+     * @param  targetDimension Number of dimensions in the target CRS of this operation method.
+     * @return The redimensioned operation method, or {@code method} if the given method was {@code null}
+     *         or already had th given dimensions.
+     */
+    public static OperationMethod redimension(OperationMethod method,
+                                        final Integer sourceDimension,
+                                        final Integer targetDimension)
+    {
+        if (sourceDimension != null) ensurePositive("sourceDimension", sourceDimension);
+        if (targetDimension != null) ensurePositive("targetDimension", targetDimension);
+        if (method != null && !(Objects.equals(sourceDimension, method.getSourceDimensions())
+                             && Objects.equals(targetDimension, method.getTargetDimensions())))
+        {
+            method = new DefaultOperationMethod(method, sourceDimension, targetDimension);
+        }
+        return method;
+    }
+
+    /**
+     * Returns the GeoAPI interface implemented by this class.
+     * The SIS implementation returns {@code OperationMethod.class}.
+     *
+     * {@note Subclasses usually do not need to override this method since GeoAPI does not define
+     *        <code>OperationMethod</code> sub-interface. Overriding possibility is left mostly for
+     *        implementors who wish to extend GeoAPI with their own set of interfaces.}
+     *
+     * @return {@code OperationMethod.class} or a user-defined sub-interface.
+     */
+    @Override
+    public Class<? extends OperationMethod> getInterface() {
+        return OperationMethod.class;
+    }
+
+    /**
+     * 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.
+     */
+    @Override
+    public Formula getFormula() {
+        return formula;
+    }
+
+    /**
+     * Number of dimensions in the source CRS of this operation method.
+     * May be null if unknown, as in an <cite>Affine Transform</cite>.
+     */
+    @Override
+    public Integer getSourceDimensions() {
+        return sourceDimension;
+    }
+
+    /**
+     * Number of dimensions in the target CRS of this operation method.
+     * May be null if unknown, as in an <cite>Affine Transform</cite>.
+     */
+    @Override
+    public Integer getTargetDimensions() {
+        return targetDimension;
+    }
+
+    /**
+     * Returns the set of parameters.
+     */
+    @Override
+    public ParameterDescriptorGroup getParameters() {
+        return parameters;
+    }
+
+    /**
+     * Compares this operation method with the specified object for equality.
+     * If the {@code mode} argument value is {@link ComparisonMode#STRICT STRICT} or
+     * {@link ComparisonMode#BY_CONTRACT BY_CONTRACT}, then all available properties
+     * are compared including the {@linkplain #getFormula() formula}.
+     *
+     * @param  object The object to compare to {@code this}.
+     * @param  mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or
+     *         {@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only properties
+     *         relevant to transformations.
+     * @return {@code true} if both objects are equal.
+     */
+    @Override
+    @SuppressWarnings("fallthrough")
+    public boolean equals(final Object object, final ComparisonMode mode) {
+        if (object == this) {
+            return true; // Slight optimization.
+        }
+        if (super.equals(object, mode)) {
+            switch (mode) {
+                case STRICT: {
+                    final DefaultOperationMethod that = (DefaultOperationMethod) object;
+                    return Objects.equals(this.formula,         that.formula) &&
+                           Objects.equals(this.sourceDimension, that.sourceDimension) &&
+                           Objects.equals(this.targetDimension, that.targetDimension) &&
+                           Objects.equals(this.parameters,      that.parameters);
+                }
+                case BY_CONTRACT: {
+                    if (!Objects.equals(getFormula(), ((OperationMethod) object).getFormula())) {
+                        return false;
+                    }
+                    // Fall through
+                }
+                default: {
+                    final OperationMethod that = (OperationMethod) object;
+                    return Objects.equals(getSourceDimensions(), that.getSourceDimensions()) &&
+                           Objects.equals(getTargetDimensions(), that.getTargetDimensions()) &&
+                           Utilities.deepEquals(getParameters(), that.getParameters(), mode);
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Invoked by {@code hashCode()} for computing the hash code when first needed.
+     * See {@link org.apache.sis.referencing.AbstractIdentifiedObject#computeHashCode()}
+     * for more information.
+     *
+     * @return The hash code value. This value may change in any future Apache SIS version.
+     */
+    @Override
+    protected long computeHashCode() {
+        return super.computeHashCode() + Objects.hash(sourceDimension, targetDimension, parameters);
+    }
+
+    /**
+     * Formats this operation as a <cite>Well Known Text</cite> {@code Method[…]} element.
+     *
+     * @return {@code "Method"} (WKT 2) or {@code "Projection"} (WKT 1).
+     */
+    @Override
+    protected String formatTo(final Formatter formatter) {
+        super.formatTo(formatter);
+        formatter.newLine();
+        return (formatter.getConvention().majorVersion() == 1) ? "Projection" : "Method";
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java?rev=1652872&r1=1652871&r2=1652872&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java [UTF-8] Sun Jan 18 23:20:45 2015
@@ -283,6 +283,71 @@ public final class MathTransforms extend
     }
 
     /**
+     * Returns what seems to be the "core" of the given math transform. This method should be used only
+     * for information purpose, since the definition of "core" is imprecise and may be adjusted in future
+     * SIS versions. The current algorithm is as below:
+     *
+     * <ul>
+     *   <li>If the given transform can be decomposed in {@linkplain #getSteps(MathTransform) steps}, then the steps for
+     *       {@linkplain org.apache.sis.referencing.cs.CoordinateSystems#swapAndScaleAxes axis swapping and scaling} are
+     *       ignored.</li>
+     *   <li>If the given transform or one of its steps is a {@link PassThroughTransform}, then its sub-transform
+     *       it taken.</li>
+     * </ul>
+     *
+     * @param  transform The math transform from which to get the "core" transform, or {@code null}.
+     * @return The "core" (may be the whole math transform), or {@code null} if the given argument was null.
+     */
+    public static MathTransform getCore(final MathTransform transform) {
+        MathTransform step = transform;
+        while (!isIgnorable(step)) {
+            if (step instanceof ConcatenatedTransform) {
+                // Ignore axis switch and scaling (usually unit conversions).
+                final ConcatenatedTransform c = (ConcatenatedTransform) step;
+                if (isIgnorable(c.transform1)) {
+                    step = c.transform2;
+                } else if (isIgnorable(c.transform2)) {
+                    step = c.transform1;
+                } else {
+                    return c; // Both components are non-ignorable: return the ConcatenatedTransform as a whole.
+                }
+            } else if (step instanceof PassThroughTransform) {
+                step = ((PassThroughTransform) step).subTransform;
+            } else {
+                return step;
+            }
+        }
+        return transform; // The full MathTransform is ignorable. Do not try to decompose it.
+    }
+
+    /**
+     * Returns {@code true} if the specified transform is likely to exists only for axis swapping
+     * and/or unit conversions. The heuristic rule checks if the transform is backed by a square
+     * matrix with exactly one non-null value in each row and each column. This method is used for
+     * implementation of the {@link #getCore(MathTransform)} method only.
+     */
+    private static boolean isIgnorable(final MathTransform transform) {
+        final Matrix matrix = getMatrix(transform);
+        if (matrix != null) {
+            final int size = matrix.getNumRow();
+            if (matrix.getNumCol() == size) {
+                for (int j=0; j<size; j++) {
+                    int n1=0, n2=0;
+                    for (int i=0; i<size; i++) {
+                        if (matrix.getElement(j,i) != 0) n1++;
+                        if (matrix.getElement(i,j) != 0) n2++;
+                    }
+                    if (n1 != 1 || n2 != 1) {
+                        return false;
+                    }
+                }
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
      * If the given transform is linear, returns its coefficients as a matrix.
      * More specifically:
      *

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java?rev=1652872&r1=1652871&r2=1652872&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransformTest.java [UTF-8] Sun Jan 18 23:20:45 2015
@@ -136,7 +136,7 @@ public final strictfp class Concatenated
         matrix.m13 = 2;
         transform = ConcatenatedTransform.create(MathTransforms.linear(matrix), passth);
         assertInstanceOf("Expected a new passthrough transform.", PassThroughTransform.class, transform);
-        final MathTransform subTransform = ((PassThroughTransform) transform).getSubTransform();
+        final MathTransform subTransform = ((PassThroughTransform) transform).subTransform;
         assertInstanceOf("Expected a new concatenated transform.", ConcatenatedTransform.class, subTransform);
         assertSame(kernel, ((ConcatenatedTransform) subTransform).transform2);
         assertEquals("Source dimensions", 3, transform.getSourceDimensions());

Added: sis/ip-review/DefaultOperationMethod.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/DefaultOperationMethod.xhtml?rev=1652872&view=auto
==============================================================================
--- sis/ip-review/DefaultOperationMethod.xhtml (added)
+++ sis/ip-review/DefaultOperationMethod.xhtml Sun Jan 18 23:20:45 2015
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultOperationMethod history</title>
+    <style type="text/css" media="all">
+      @import url("./reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultOperationMethod history</h1>
+  <p>Click on the commit message for inspecting the <code>diff</code> and how the code has been rewritten.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn log -r31996:1 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/DefaultOperationMethod.java</code></blockquote>
+<table>
+  <tr>
+    <th>Rev.</th>
+    <th>Date</th>
+    <th>Author</th>
+    <th class="last">Message</th>
+  </tr>
+<tr><td class="rev">31000</td><td>2008-07-10</td><td>desruisseaux</td><td>Avoid usage of 2 deprecated constructors from CRSFactory. Their replacement were tricky and required more sophesticated code in ReferencingFactoryContainer.toGeodetic3D.</td></tr>
+<tr><td class="rev">30641</td><td>2008-06-12</td><td>acuster</td><td>Copyright headers: lib/referencing, this time with feeling (and the el in Toolkit)</td></tr>
+<tr><td class="rev">30521</td><td>2008-06-05</td><td>acuster</td><td>Copyright: Update referencing headers</td></tr>
+<tr><td class="rev">30313</td><td>2008-05-16</td><td>desruisseaux</td><td>Changed my mind about Utilities.shallowEquals(Object,Object) and renamed it as equals, since a few tests show that the compiler always select the best overloaded flavor working on primitive types (except if an argument is a boolean and the other a different primitive type). Updated a few references. Fixed a few javadoc warnings by explicit declaration of parameter and return values.</td></tr>
+<tr><td class="rev">30258</td><td>2008-05-08</td><td>acuster</td><td>Reshuffle the top level repo: drop uDig, move up trunk, tags, and branches.</td></tr>
+<tr><td class="rev">30257</td><td>2008-05-08</td><td>acuster</td><td>Move trunk/gt/ directory contents up to trunk/ and drop gt</td></tr>
+<tr><td class="rev">30037</td><td>2008-04-24</td><td>desruisseaux</td><td>Fixed a UnsupportedOperationException when formatting in WKT a ProjectedCRS which contains a PassthroughTransform. Added two convenience constructors in PaletteFactory.</td></tr>
+<tr><td class="rev">28922</td><td>2008-01-24</td><td>acuster</td><td>Bump the (at)since version to 2.5 since WKTParser was cut from 2.4</td></tr>
+<tr><td class="rev">28540</td><td>2007-12-29</td><td>acuster</td><td>Hide buttons which are not yet used</td></tr>
+<tr><td class="rev">28393</td><td>2007-12-17</td><td>desruisseaux</td><td>WKT formatting now includes the semi-major and semi-minor axis length if they differ from the datum. Applied Java 5 features. Uses WarpAffine when applicable during Raster reprojection.</td></tr>
+<tr><td class="rev">28081</td><td>2007-11-27</td><td>desruisseaux</td><td>Java 5 constructs: replaced some StringBuffer by StringBuilder in order to avoid unecessary synchronisation; rely on auto-boxing in order to give a chance to the JVM to reuse its cached values.</td></tr>
+<tr><td class="rev">27995</td><td>2007-11-22</td><td>desruisseaux</td><td>More generics type, and moved two methods from ReferencingFactoryContainer to GeoAPI MathTransformFactory interface. Note that the build fails in the arcsde module for a reason that seems unrelated to this work.</td></tr>
+<tr><td class="rev">27575</td><td>2007-10-22</td><td>desruisseaux</td><td>Converted Java source files from ISO-LATIN-1 encoding to UTF-8 (GEOT-1516).</td></tr>
+<tr><td class="rev">24925</td><td>2007-03-27</td><td class="unav">jgarnett</td><td><a href="rev/24925/DefaultOperationMethod.xhtml">change to org.opengis.geometry</a></td></tr>
+<tr><td class="rev">22327</td><td>2006-10-23</td><td>desruisseaux</td><td>GEOT-982: regroup 'module', 'plugin', 'ext' and 'unsupported' in a common directory.</td></tr>
+<tr><td class="rev">22315</td><td>2006-10-22</td><td>desruisseaux</td><td>Reorganisation of directory tree structure (GEOT-982) phase 1: moved 'src' to 'src/main/java'.</td></tr>
+<tr><td class="rev">20874</td><td>2006-08-07</td><td class="unav">jgarnett</td><td><a href="rev/20874/DefaultOperationMethod.xhtml">ip review</a></td></tr>
+<tr><td class="rev">19676</td><td>2006-05-25</td><td>desruisseaux</td><td>Removed deprecated classes and methods from the referencing module</td></tr>
+<tr><td class="rev">17672</td><td>2006-01-19</td><td>desruisseaux</td><td>Added @source tag.</td></tr>
+<tr><td class="rev">17660</td><td>2006-01-18</td><td>desruisseaux</td><td>Fixed SVN attributes, including the addition of URL attribute.</td></tr>
+<tr><td class="rev">15350</td><td>2005-08-16</td><td>desruisseaux</td><td>Merged the 'split-main' branch to trunk (GEOT-662)</td></tr>
+<tr><td class="rev">15256</td><td>2005-08-09</td><td>desruisseaux</td><td>Extraction of referencing module from main</td></tr>
+<tr><td class="rev">15255</td><td>2005-08-09</td><td>desruisseaux</td><td>Prepare branch for splitting main</td></tr>
+<tr><td class="rev">14935</td><td>2005-07-27</td><td>desruisseaux</td><td>Added tests for 3D ProjectedCRS case, using custom axis orientations</td></tr>
+<tr><td class="rev">14934</td><td>2005-07-27</td><td>desruisseaux</td><td>Transformations between 3D ProjectedCRS should propagate the height (GEOT-637, 638 and 639)</td></tr>
+<tr><td class="rev">14834</td><td>2005-07-20</td><td>desruisseaux</td><td>Reorganized I18N resources</td></tr>
+<tr><td class="rev">14602</td><td>2005-06-24</td><td>desruisseaux</td><td>EPSG factory now have a standalone (and buffered) createOperationMethod (GEOT-596)</td></tr>
+<tr><td class="rev">14593</td><td>2005-06-23</td><td>desruisseaux</td><td>First JUnit test for 'createCoordinateOperation' (GEOT-589)</td></tr>
+<tr><td class="rev">14550</td><td>2005-06-16</td><td>desruisseaux</td><td>Removed deprecated fields and methods</td></tr>
+<tr><td class="rev">14545</td><td>2005-06-15</td><td>desruisseaux</td><td>Initial port of coverage I/O helper classes (work in progress)</td></tr>
+<tr><td class="rev">14235</td><td>2005-06-10</td><td>desruisseaux</td><td>Replaced _PROPERTY suffix by _KEY as of GEOT-577</td></tr>
+<tr><td class="rev">13925</td><td>2005-05-30</td><td>desruisseaux</td><td>Added @since javadoc tag</td></tr>
+<tr><td class="rev">13922</td><td>2005-05-29</td><td>desruisseaux</td><td>Renaming of remainding GeoAPI implementations. Renaming is now finished.</td></tr>
+<tr><td class="rev">13906</td><td>2005-05-28</td><td>desruisseaux</td><td>Renamed some 'Default' prefix as 'Abstract'</td></tr>
+<tr><td class="rev">13836</td><td>2005-05-26</td><td>desruisseaux</td><td>Added 'Default' suffix to some CRS implementations: partial work</td></tr>
+<tr><td class="rev">11371</td><td>2005-02-14</td><td>desruisseaux</td><td>Renamed DefaultObjectFactory as GeotoolsFactory (GEOT-420, now closed)</td></tr>
+<tr><td class="rev">11366</td><td>2005-02-12</td><td>desruisseaux</td><td>Almost fully functional EPSG factory (remaining bug in ProjectedCRS parameter names)</td></tr>
+<tr><td class="rev">11144</td><td>2005-02-07</td><td>desruisseaux</td><td>Fixed GEOT-400 (create appropriate instance of Operation subclasses)</td></tr>
+<tr><td class="rev">11100</td><td>2005-02-04</td><td>desruisseaux</td><td>More tests and bug fixes in CRS</td></tr>
+<tr><td class="rev">11008</td><td>2005-02-02</td><td>desruisseaux</td><td>Ask OperationMethod to be specified explicitly</td></tr>
+<tr><td class="rev">11001</td><td>2005-02-02</td><td>desruisseaux</td><td>Fixed wrong encoding in main/src</td></tr>
+<tr><td class="rev">10796</td><td>2005-01-28</td><td class="unav">dzwiers</td><td><a href="rev/10796/DefaultOperationMethod.xhtml">imports cleaned</a></td></tr>
+<tr><td class="rev">10469</td><td>2005-01-11</td><td>desruisseaux</td><td>Replaced calls to 'getDim[Source|Target]' by 'get[Source|Target]Dimensions</td></tr>
+<tr><td class="rev">9203</td><td>2004-11-19</td><td>desruisseaux</td><td>WKT debugging / cleaning</td></tr>
+<tr><td class="rev">8796</td><td>2004-10-22</td><td>desruisseaux</td><td>Cleaning referencing's operation basic package</td></tr>
+<tr><td class="rev">8518</td><td>2004-10-11</td><td>desruisseaux</td><td>Apply changes voted in OGC meeting at Southampton: use of Identifier and GenericName</td></tr>
+<tr><td class="rev">7845</td><td>2004-09-08</td><td class="unav">jgarnett</td><td><a href="rev/07845/DefaultOperationMethod.xhtml">First round of resync with geoapi</a></td></tr>
+<tr><td class="rev">6888</td><td>2004-07-14</td><td>desruisseaux</td><td>Update for GeoAPI changes (Info -->  IdentifiedObject)</td></tr>
+<tr><td class="rev">6362</td><td>2004-06-08</td><td>desruisseaux</td><td>Initial work for an OperationProvider</td></tr>
+<tr><td class="rev">6343</td><td>2004-06-07</td><td>desruisseaux</td><td>More ports of legacy CTS to new CRS</td></tr>
+<tr><td class="rev">6257</td><td>2004-05-31</td><td>desruisseaux</td><td>First set of operation classes</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/07845/DefaultOperationMethod.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/07845/DefaultOperationMethod.xhtml?rev=1652872&view=auto
==============================================================================
--- sis/ip-review/rev/07845/DefaultOperationMethod.xhtml (added)
+++ sis/ip-review/rev/07845/DefaultOperationMethod.xhtml Sun Jan 18 23:20:45 2015
@@ -0,0 +1,265 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultOperationMethod changes for revisions 7844:7845</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultOperationMethod changes for revisions 7844:7845</h1>
+<p>Changes forced by GeoAPI changes.
+Reverting those changes causes compilation errors, which can be fixed only be re-applying the same changes:</p>
+<ul>
+  <li>Changes for renaming of GeoAPI interface: <code>GeneralOperationParameter</code> → <code>GeneralParameterDescriptor</code>.</li>
+  <li>Replacement of <code>GeneralOperationParameter[]</code> by <code>ParameterGroupDescriptor</code>.</li>
+</ul>
+<p>Changed omitted in Apache SIS:</p>
+<ul>
+  <li><code>FEEDBACK</code> comment.</li>
+  <li>Replacement of null value by <code>Parameters.EMPTY_GROUP</code>.</li>
+  <li>The two new constructors, and consequently the <code>group</code> utility method.</li>
+</ul>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r7844:7845 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/DefaultOperationMethod.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 7844</th><th>Revision 7845</th></tr>
+<tr><td><pre>import java.util.HashMap;
+
+// OpenGIS dependencies
+<span class="del">import org.opengis.parameter.GeneralOperationParameter;</span>
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.spatialschema.geometry.MismatchedDimensionException;</pre></td>
+<td><pre>import java.util.HashMap;
+
+// OpenGIS dependencies
+<span class="add">import org.opengis.parameter.GeneralParameterDescriptor;</span>
+<span class="add">import org.opengis.parameter.ParameterDescriptorGroup;</span>
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.spatialschema.geometry.MismatchedDimensionException;</pre></td></tr>
+<tr><td><pre>import org.geotools.referencing.wkt.Formatter;
+import org.geotools.resources.cts.Resources;
+import org.geotools.resources.cts.ResourceKeys;
+
+<span class="del"></span>
+/**
+ * Definition of an algorithm used to perform a coordinate operation. Most operation
+ * methods use a number of operation parameters, although some coordinate conversions
+ * use none. Each coordinate operation using the method assigns values to these parameters.
+ *
+ * @version $Id$
+ * @author Martin Desruisseaux
+ *</pre></td>
+<td><pre>import org.geotools.referencing.wkt.Formatter;
+import org.geotools.resources.cts.Resources;
+import org.geotools.resources.cts.ResourceKeys;
+<span class="add">import org.geotools.parameter.ParameterGroupDescriptor;</span>
+
+/**
+ * Definition of an algorithm used to perform a coordinate operation. Most operation
+ * methods use a number of operation parameters, although some coordinate conversions
+ * use none. Each coordinate operation using the method assigns values to these parameters.
+ *
+<span class="add"> * &lt;p&gt;</span>
+<span class="add"> * FEEDBACK: This really looks like a ParameterDescriptorGroup with formula, sourceDimensions, targetDimensions</span>
+ * @version $Id$
+ * @author Martin Desruisseaux
+ *</pre></td></tr>
+<tr><td><pre>private static final long serialVersionUID = -98032729598205972L;
+
+/**
+<span class="del"> * An empty array of parameters.</span>
+<span class="del"> */</span>
+<span class="del">private static final GeneralOperationParameter[] EMPTY_PARAMETER = new GeneralOperationParameter[0];</span>
+<span class="del"></span>
+<span class="del">/**</span>
+ * List of localizable properties. To be given to {@link IdentifiedObject} constructor.
+ */
+private static final String[] LOCALIZABLES = {"formula"};</pre></td>
+<td><pre>private static final long serialVersionUID = -98032729598205972L;
+
+/**
+ * List of localizable properties. To be given to {@link IdentifiedObject} constructor.
+ */
+private static final String[] LOCALIZABLES = {"formula"};</pre></td></tr>
+<tr><td><pre>/**
+ * The set of parameters, or &lt;code&gt;null&lt;/code&gt; if none.
+ */
+<span class="del">private final GeneralOperationParameter[] parameters;</span>
+
+/**
+ * Construct an operation method from a set of properties. The properties given in argument</pre></td>
+<td><pre>/**
+ * The set of parameters, or &lt;code&gt;null&lt;/code&gt; if none.
+ */
+<span class="add">private final ParameterDescriptorGroup parameters;</span>
+<span class="add">//private final GeneralParameterDescriptor[] parameters;</span>
+
+/**
+ * Construct an operation method from a set of properties. The properties given in argument</pre></td></tr>
+<tr><td><pre>public OperationMethod(final Map properties,
+                       final int sourceDimensions,
+                       final int targetDimensions,
+<span class="del">                       final GeneralOperationParameter[] parameters)</span>
+{
+    this(properties, new HashMap(), sourceDimensions, targetDimensions, parameters);
+}
+<span class="del"></span>
+/**
+ * Work around for RFE #4093999 in Sun's bug database
+ * ("Relax constraint on placement of this()/super() call in constructors").
+ */
+<span class="del">private OperationMethod(final Map properties, final Map subProperties,</span>
+                        final int sourceDimensions,
+                        final int targetDimensions,
+<span class="del">                        GeneralOperationParameter[] parameters)</span>
+{
+    super(properties, subProperties, LOCALIZABLES);
+    formula = (Map)    subProperties.get("formula");
+<span class="del">    if (parameters==null || parameters.length==0) {</span>
+<span class="del">        parameters = null;</span>
+    } else {
+<span class="del">        parameters = (GeneralOperationParameter[]) parameters.clone();</span>
+<span class="del">        for (int i=0; i&lt;parameters.length; i++) {</span>
+<span class="del">            ensureNonNull("parameters", parameters, i);</span>
+        }
+<span class="del">    }</span>
+<span class="del">    this.parameters       = parameters;</span>
+    this.sourceDimensions = sourceDimensions;
+    this.targetDimensions = targetDimensions;
+}</pre></td>
+<td><pre>public OperationMethod(final Map properties,
+                       final int sourceDimensions,
+                       final int targetDimensions,
+<span class="add">                       final ParameterDescriptorGroup parameters)</span>
+{
+    this(properties, new HashMap(), sourceDimensions, targetDimensions, parameters);
+}
+/**
+<span class="add"> * Construct an operation method from a set of properties. The properties given in argument</span>
+<span class="add"> * follow the same rules than for the {@linkplain IdentifiedObject#IdentifiedObject(Map)</span>
+<span class="add"> * super-class constructor}. Additionally, the following properties are understood by this</span>
+<span class="add"> * construtor:</span>
+<span class="add"> * &lt;br&gt;&lt;br&gt;</span>
+<span class="add"> * &lt;table border='1'&gt;</span>
+<span class="add"> *   &lt;tr bgcolor="#CCCCFF" class="TableHeadingColor"&gt;</span>
+<span class="add"> *     &lt;th nowrap&gt;Property name&lt;/th&gt;</span>
+<span class="add"> *     &lt;th nowrap&gt;Value type&lt;/th&gt;</span>
+<span class="add"> *     &lt;th nowrap&gt;Value given to&lt;/th&gt;</span>
+<span class="add"> *   &lt;/tr&gt;</span>
+<span class="add"> *   &lt;tr&gt;</span>
+<span class="add"> *     &lt;td nowrap&gt;&amp;nbsp;&lt;code&gt;"formula"&lt;/code&gt;&amp;nbsp;&lt;/td&gt;</span>
+<span class="add"> *     &lt;td nowrap&gt;&amp;nbsp;{@link String}&amp;nbsp;&lt;/td&gt;</span>
+<span class="add"> *     &lt;td nowrap&gt;&amp;nbsp;{@link #getFormula}&lt;/td&gt;</span>
+<span class="add"> *   &lt;/tr&gt;</span>
+<span class="add"> * &lt;/table&gt;</span>
+<span class="add"> *</span>
+<span class="add"> * @param properties Set of properties. Should contains at least &lt;code&gt;"name"&lt;/code&gt;.</span>
+<span class="add"> * @param sourceDimensions Number of dimensions in the source CRS of this operation method.</span>
+<span class="add"> * @param targetDimensions Number of dimensions in the target CRS of this operation method.</span>
+<span class="add"> * @param parameters The set of parameters, or &lt;code&gt;null&lt;/code&gt; or an empty array if none.</span>
+<span class="add"> */</span>
+<span class="add">public OperationMethod(final Map properties,</span>
+<span class="add">                       final int sourceDimensions,</span>
+<span class="add">                       final int targetDimensions,</span>
+<span class="add">                       final GeneralParameterDescriptor[] parameters)</span>
+<span class="add">{</span>
+<span class="add">    this(properties, new HashMap(), sourceDimensions, targetDimensions, parameters);</span>
+<span class="add">}</span>
+<span class="add">/**</span>
+<span class="add"> * Construct an operation method from a set of properties. The properties given in argument</span>
+<span class="add"> * follow the same rules than for the {@linkplain IdentifiedObject#IdentifiedObject(Map)</span>
+<span class="add"> * super-class constructor}. Additionally, the following properties are understood by this</span>
+<span class="add"> * construtor:</span>
+<span class="add"> * &lt;br&gt;&lt;br&gt;</span>
+<span class="add"> * &lt;table border='1'&gt;</span>
+<span class="add"> *   &lt;tr bgcolor="#CCCCFF" class="TableHeadingColor"&gt;</span>
+<span class="add"> *     &lt;th nowrap&gt;Property name&lt;/th&gt;</span>
+<span class="add"> *     &lt;th nowrap&gt;Value type&lt;/th&gt;</span>
+<span class="add"> *     &lt;th nowrap&gt;Value given to&lt;/th&gt;</span>
+<span class="add"> *   &lt;/tr&gt;</span>
+<span class="add"> *   &lt;tr&gt;</span>
+<span class="add"> *     &lt;td nowrap&gt;&amp;nbsp;&lt;code&gt;"formula"&lt;/code&gt;&amp;nbsp;&lt;/td&gt;</span>
+<span class="add"> *     &lt;td nowrap&gt;&amp;nbsp;{@link String}&amp;nbsp;&lt;/td&gt;</span>
+<span class="add"> *     &lt;td nowrap&gt;&amp;nbsp;{@link #getFormula}&lt;/td&gt;</span>
+<span class="add"> *   &lt;/tr&gt;</span>
+<span class="add"> * &lt;/table&gt;</span>
+<span class="add"> *</span>
+<span class="add"> * @param properties Set of properties. Should contains at least &lt;code&gt;"name"&lt;/code&gt;.</span>
+<span class="add"> * @param sourceDimensions Number of dimensions in the source CRS of this operation method.</span>
+<span class="add"> * @param targetDimensions Number of dimensions in the target CRS of this operation method.</span>
+<span class="add"> * @param parameters Parameter set, or &lt;code&gt;null&lt;/code&gt;if none.</span>
+<span class="add"> */</span>
+<span class="add">public OperationMethod(final Map properties,</span>
+<span class="add">                 final Map subProperties,</span>
+<span class="add">                 final int sourceDimensions,</span>
+<span class="add">                 final int targetDimensions,</span>
+<span class="add">                 GeneralParameterDescriptor[] parameters)</span>
+<span class="add">{</span>
+<span class="add">    this(properties, subProperties, sourceDimensions, targetDimensions, group( properties, parameters ));</span>
+<span class="add">}</span>
+<span class="add">/** Utility method used to kludge GeneralParameterDescriptor[] into a ParameterDescriptorGroup */</span>
+<span class="add">private static ParameterDescriptorGroup group( Map properties, GeneralParameterDescriptor[] parameters ){</span>
+<span class="add">    return parameters == null ? org.geotools.parameter.Parameters.EMPTY_GROUP</span>
+<span class="add">            : new ParameterGroupDescriptor( properties, parameters );</span>
+<span class="add">}</span>
+<span class="add">/**</span>
+ * Work around for RFE #4093999 in Sun's bug database
+ * ("Relax constraint on placement of this()/super() call in constructors").
+<span class="add"> * @param parameters Parameter group, or &lt;code&gt;null&lt;/code&gt;if none.</span>
+ */
+<span class="add">private OperationMethod(final Map properties,</span>
+<span class="add">                        final Map subProperties,</span>
+                        final int sourceDimensions,
+                        final int targetDimensions,
+<span class="add">                        ParameterDescriptorGroup parameters)</span>
+{
+    super(properties, subProperties, LOCALIZABLES);
+    formula = (Map)    subProperties.get("formula");
+<span class="add">    if (parameters==null ) {</span>
+<span class="add">        this.parameters = org.geotools.parameter.Parameters.EMPTY_GROUP;</span>
+    } else {
+<span class="add">        this.parameters = parameters; // can I not clone this?</span>
+        }
+    this.sourceDimensions = sourceDimensions;
+    this.targetDimensions = targetDimensions;
+}</pre></td></tr>
+<tr><td><pre> *
+ * @return The parameters, or an empty array if none.
+ */
+<span class="del">public GeneralOperationParameter[] getParameters() {</span>
+<span class="del">    return (parameters!=null) ? (GeneralOperationParameter[]) parameters.clone()</span>
+<span class="del">                              : EMPTY_PARAMETER;</span>
+}
+
+/**</pre></td>
+<td><pre> *
+ * @return The parameters, or an empty array if none.
+ */
+<span class="add">public ParameterDescriptorGroup getParameters() {</span>
+<span class="add">    return parameters;</span>
+}
+
+/**</pre></td></tr>
+<tr><td><pre> */
+public int hashCode() {
+    int code = (int)serialVersionUID + sourceDimensions + 37*targetDimensions;
+<span class="del">    if (parameters != null) {</span>
+<span class="del">        for (int i=parameters.length; --i&gt;=0;) {</span>
+<span class="del">            code = code*37 + parameters[i].hashCode();</span>
+<span class="del">        }</span>
+<span class="del">    }</span>
+    return code;
+}</pre></td>
+<td><pre> */
+public int hashCode() {
+    int code = (int)serialVersionUID + sourceDimensions + 37*targetDimensions;
+<span class="add">    code = code * 37 + parameters.hashCode();</span>
+    return code;
+}</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/07845/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/07845/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/07845/HEADER.html
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/07845/HEADER.html?rev=1652872&view=auto
==============================================================================
--- sis/ip-review/rev/07845/HEADER.html (added)
+++ sis/ip-review/rev/07845/HEADER.html Sun Jan 18 23:20:45 2015
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Revision 7845</title>
+  </head>
+  <body>
+    <div>
+      <h1>Revision 7845</h1>
+<table>
+  <tr><td><b>Author:</b></td><td>jgarnett</td></tr>
+  <tr><td><b>Date:</b></td><td>2004-09-08</td></tr>
+  <tr><td><b>Message:</b></td><td>First round of resync with geoapi</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/07845/HEADER.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/07845/HEADER.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/10796/DefaultOperationMethod.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/DefaultOperationMethod.xhtml?rev=1652872&view=auto
==============================================================================
--- sis/ip-review/rev/10796/DefaultOperationMethod.xhtml (added)
+++ sis/ip-review/rev/10796/DefaultOperationMethod.xhtml Sun Jan 18 23:20:45 2015
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultOperationMethod changes for revisions 10795:10796</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultOperationMethod changes for revisions 10795:10796</h1>
+<p>Changes in this commit seem to be the result of some "<cite>auto reformat</cite>" tool execution.
+The <cite>Java</cite> - <cite>GeoAPI</cite> - <cite>GeoTools</cite> import ordering is altered,
+imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken.
+This commit has been reverted, except for the removal of really unused imports which are keep removed.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/DefaultOperationMethod.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 10795</th><th>Revision 10796</th></tr>
+<tr><td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="del"> * (C) 2001, Institut de Recherche pour le Développement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td>
+<td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="add"> * (C) 2001, Institut de Recherche pour le D�veloppement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td></tr>
+<tr><td><pre>package org.geotools.referencing.operation;
+
+// J2SE dependencies
+import java.util.Map;
+<span class="del">import java.util.Locale;</span>
+<span class="del">import java.util.HashMap;</span>
+
+<span class="del">// OpenGIS dependencies</span>
+<span class="del">import org.opengis.util.InternationalString;</span>
+import org.opengis.parameter.GeneralParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.spatialschema.geometry.MismatchedDimensionException;
+
+<span class="del">// Geotools dependencies</span>
+<span class="del">import org.geotools.parameter.Parameters;</span>
+<span class="del">import org.geotools.referencing.IdentifiedObject;</span>
+<span class="del">import org.geotools.referencing.wkt.Formatter;</span>
+<span class="del">import org.geotools.resources.cts.Resources;</span>
+<span class="del">import org.geotools.resources.cts.ResourceKeys;</span>
+<span class="del">import org.geotools.resources.Utilities;</span>
+
+<span class="del"></span>
+/**
+ * Definition of an algorithm used to perform a coordinate operation. Most operation
+ * methods use a number of operation parameters, although some coordinate conversions</pre></td>
+<td><pre>package org.geotools.referencing.operation;
+
+// J2SE dependencies
+<span class="add">import java.util.HashMap;</span>
+import java.util.Map;
+
+<span class="add">import org.geotools.parameter.Parameters;</span>
+<span class="add">import org.geotools.referencing.IdentifiedObject;</span>
+<span class="add">import org.geotools.referencing.wkt.Formatter;</span>
+<span class="add">import org.geotools.resources.Utilities;</span>
+<span class="add">import org.geotools.resources.cts.ResourceKeys;</span>
+<span class="add">import org.geotools.resources.cts.Resources;</span>
+import org.opengis.parameter.GeneralParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.spatialschema.geometry.MismatchedDimensionException;
+<span class="add">import org.opengis.util.InternationalString;</span>
+
+
+/**
+ * Definition of an algorithm used to perform a coordinate operation. Most operation
+ * methods use a number of operation parameters, although some coordinate conversions</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/10796/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/10796/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/20874/DefaultOperationMethod.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/20874/DefaultOperationMethod.xhtml?rev=1652872&view=auto
==============================================================================
--- sis/ip-review/rev/20874/DefaultOperationMethod.xhtml (added)
+++ sis/ip-review/rev/20874/DefaultOperationMethod.xhtml Sun Jan 18 23:20:45 2015
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultOperationMethod changes for revisions 20873:20874</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultOperationMethod changes for revisions 20873:20874</h1>
+<p>Changes in GeoTools header only. The removal of the "<cite>or (at your option) any later version</cite>" clause
+must be keep in Geotk for every classes having contribution from a developer other than those who accepted re-licensing.
+This header does not apply to Apache SIS, since the above-cited contributions are omitted.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r20873:20874 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/DefaultOperationMethod.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 20873</th><th>Revision 20874</th></tr>
+<tr><td><pre>/*
+<span class="del"> * Geotools 2 - OpenSource mapping toolkit</span>
+<span class="del"> * (C) 2003, Geotools Project Managment Committee (PMC)</span>
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+<span class="del"> *    License as published by the Free Software Foundation; either</span>
+<span class="del"> *    version 2.1 of the License, or (at your option) any later version.</span>
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of</pre></td>
+<td><pre>/*
+<span class="add"> *    GeoTools - OpenSource mapping toolkit</span>
+<span class="add"> *    http://geotools.org</span>
+<span class="add"> *    (C) 2003-2006, GeoTools Project Managment Committee (PMC)</span>
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+<span class="add"> *    License as published by the Free Software Foundation;</span>
+<span class="add"> *    version 2.1 of the License.</span>
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of</pre></td></tr>
+<tr><td><pre>*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+<span class="del">*    You should have received a copy of the GNU Lesser General Public</span>
+<span class="del">*    License along with this library; if not, write to the Free Software</span>
+<span class="del">*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
+<span class="del">*</span>
+<span class="del">*</span>
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/</pre></td>
+<td><pre>*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/20874/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/20874/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/24925/DefaultOperationMethod.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/24925/DefaultOperationMethod.xhtml?rev=1652872&view=auto
==============================================================================
--- sis/ip-review/rev/24925/DefaultOperationMethod.xhtml (added)
+++ sis/ip-review/rev/24925/DefaultOperationMethod.xhtml Sun Jan 18 23:20:45 2015
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultOperationMethod changes for revisions 24924:24925</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultOperationMethod changes for revisions 24924:24925</h1>
+<p>This commit propagates the package names change which was done in GeoAPI.
+There is no way such change could be done differently,
+since not renaming the packages cause a compilation error.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r24924:24925 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/DefaultOperationMethod.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 24924</th><th>Revision 24925</th></tr>
+<tr><td><pre>import org.opengis.referencing.operation.Projection;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.OperationMethod;
+<span class="del">import org.opengis.spatialschema.geometry.MismatchedDimensionException;</span>
+import org.opengis.util.InternationalString;
+
+// Geotools dependencies</pre></td>
+<td><pre>import org.opengis.referencing.operation.Projection;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.OperationMethod;
+<span class="add">import org.opengis.geometry.MismatchedDimensionException;</span>
+import org.opengis.util.InternationalString;
+
+// Geotools dependencies</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/24925/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/24925/DefaultOperationMethod.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message