sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1718599 [4/6] - in /sis/ip-review: ./ rev/10799/ rev/11112/ rev/12132/ rev/20874/ rev/23110/ rev/24689/ rev/25050/ rev/25916/ rev/25919/ rev/25940/ rev/26059/ rev/26212/ rev/26250/ rev/26290/ rev/29105/ rev/29125/
Date Tue, 08 Dec 2015 13:33:16 GMT
Added: sis/ip-review/rev/20874/TransformedAuthorityFactory.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/20874/TransformedAuthorityFactory.xhtml?rev=1718599&view=auto
==============================================================================
--- sis/ip-review/rev/20874/TransformedAuthorityFactory.xhtml (added)
+++ sis/ip-review/rev/20874/TransformedAuthorityFactory.xhtml Tue Dec  8 13:33:15 2015
@@ -0,0 +1,1005 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>TransformedAuthorityFactory changes for revisions 20873:20874</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>TransformedAuthorityFactory changes for revisions 20873:20874</h1>
+<p>Changes in GeoTools header. 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>In addition, this class seems to have been the subject of some automatic formatting, probably from some IDE.
+There is apparently no code change. The formatting applied in this commit has been reverted.</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/factory/TransformedAuthorityFactory.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) 2005, Geotools Project Managment Committee (PMC)</span>
+ * (C) 2005, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+<span class="del"> *    replace it under the terms of the GNU Lesser General Public</span>
+<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
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+<span class="del"> *</span>
+<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>
+ */
+package org.geotools.referencing.factory;</pre></td>
+<td><pre>/*
+<span class="add"> *    GeoTools - OpenSource mapping toolkit</span>
+<span class="add"> *    http://geotools.org</span>
+<span class="add"> *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)</span>
+ * (C) 2005, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+<span class="add"> *    modify it under the terms of the GNU Lesser General Public</span>
+<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
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ */
+package org.geotools.referencing.factory;</pre></td></tr>
+<tr><td><pre>import org.geotools.resources.i18n.Errors;
+import org.geotools.resources.Utilities;
+
+<span class="del"></span>
+/**
+<span class="del"> * An authority factory which returns modified {@linkplain CoordinateReferenceSystem CRS},</span>
+<span class="del"> * {@linkplain CoordinateSystem CS} or {@linkplain Datum datum} objects from other factory</span>
+<span class="del"> * implementations. This class provides a set of {@code replace(...)} methods to be overriden</span>
+<span class="del"> * by subclasses in order to replace some {@linkplain CoordinateReferenceSystem CRS},</span>
+<span class="del"> * {@linkplain CoordinateSystem CS} or {@linkplain Datum datum} objects by other ones.</span>
+<span class="del"> * The replacement rules are determined by the subclass being used. For example the</span>
+<span class="del"> * {@link OrderedAxisAuthorityFactory} subclass can replace {@linkplain CoordinateSystem</span>
+<span class="del"> * coordinate systems} using (&lt;var&gt;latitude&lt;/var&gt;, &lt;var&gt;longitude&lt;/var&gt;)</span>
+<span class="del"> * axis order by coordinate systems using (&lt;var&gt;longitude&lt;/var&gt;, &lt;var&gt;latitude&lt;/var&gt;) axis order.</span>
+ * &lt;p&gt;
+<span class="del"> * All constructors are protected because this class must be subclassed in order to determine</span>
+<span class="del"> * which of the {@link DatumAuthorityFactory}, {@link CSAuthorityFactory} and</span>
+<span class="del"> * {@link CRSAuthorityFactory} interfaces to implement.</span>
+ *
+ * @since 2.3
+<span class="del"> * @source $URL$</span>
+<span class="del"> * @version $Id$</span>
+ * @author Martin Desruisseaux
+ *
+<span class="del"> * @todo Use generic types for all {@code replace(...)} methods when we will be allowed</span>
+<span class="del"> *       to compile for J2SE 1.5, and remove casts in all {@code createXXX(...)} methods.</span>
+ */
+public class TransformedAuthorityFactory extends AuthorityFactoryAdapter {
+    /**
+<span class="del">     * A set of default factories to be used if none were found if {@link #datumFactory},</span>
+<span class="del">     * {@link #csFactory}, {@link #crsFactory} or {@link #operationFactory}. Will be created</span>
+<span class="del">     * only when first needed.</span>
+     */
+    private transient FactoryGroup factories;</pre></td>
+<td><pre>import org.geotools.resources.i18n.Errors;
+import org.geotools.resources.Utilities;
+
+/**
+<span class="add"> * An authority factory which returns modified</span>
+<span class="add"> * {@linkplain CoordinateReferenceSystem CRS}, {@linkplain CoordinateSystem CS}</span>
+<span class="add"> * or {@linkplain Datum datum} objects from other factory implementations. This</span>
+<span class="add"> * class provides a set of {@code replace(...)} methods to be overriden by</span>
+<span class="add"> * subclasses in order to replace some</span>
+<span class="add"> * {@linkplain CoordinateReferenceSystem CRS}, {@linkplain CoordinateSystem CS}</span>
+<span class="add"> * or {@linkplain Datum datum} objects by other ones. The replacement rules are</span>
+<span class="add"> * determined by the subclass being used. For example the</span>
+<span class="add"> * {@link OrderedAxisAuthorityFactory} subclass can replace</span>
+<span class="add"> * {@linkplain CoordinateSystem coordinate systems} using (&lt;var&gt;latitude&lt;/var&gt;,</span>
+<span class="add"> * &lt;var&gt;longitude&lt;/var&gt;) axis order by coordinate systems using (&lt;var&gt;longitude&lt;/var&gt;,</span>
+<span class="add"> * &lt;var&gt;latitude&lt;/var&gt;) axis order.</span>
+ * &lt;p&gt;
+<span class="add"> * All constructors are protected because this class must be subclassed in order</span>
+<span class="add"> * to determine which of the {@link DatumAuthorityFactory},</span>
+<span class="add"> * {@link CSAuthorityFactory} and {@link CRSAuthorityFactory} interfaces to</span>
+<span class="add"> * implement.</span>
+ *
+ * @since 2.3
+<span class="add"> * @source $URL:</span>
+<span class="add"> *         http://svn.geotools.org/geotools/trunk/gt/module/referencing/src/org/geotools/referencing/factory/TransformedAuthorityFactory.java $</span>
+<span class="add"> * @version $Id: TransformedAuthorityFactory.java 19962 2006-06-14 07:41:54Z</span>
+<span class="add"> *          desruisseaux $</span>
+ * @author Martin Desruisseaux
+ *
+<span class="add"> * @todo Use generic types for all {@code replace(...)} methods when we will be</span>
+<span class="add"> *       allowed to compile for J2SE 1.5, and remove casts in all</span>
+<span class="add"> *       {@code createXXX(...)} methods.</span>
+ */
+public class TransformedAuthorityFactory extends AuthorityFactoryAdapter {
+    /**
+<span class="add">     * A set of default factories to be used if none were found if</span>
+<span class="add">     * {@link #datumFactory}, {@link #csFactory}, {@link #crsFactory} or</span>
+<span class="add">     * {@link #operationFactory}. Will be created only when first needed.</span>
+     */
+    private transient FactoryGroup factories;</pre></td></tr>
+<tr><td><pre>/**
+ * Creates a wrapper around the specified factory.
+ *
+<span class="del"> * @param factory The factory to wrap.</span>
+ */
+protected TransformedAuthorityFactory(final AuthorityFactory factory) {
+    super(factory);</pre></td>
+<td><pre>/**
+ * Creates a wrapper around the specified factory.
+ *
+<span class="add"> * @param factory</span>
+<span class="add"> *            The factory to wrap.</span>
+ */
+protected TransformedAuthorityFactory(final AuthorityFactory factory) {
+    super(factory);</pre></td></tr>
+<tr><td><pre>/**
+ * Creates a wrapper around the specified factories.
+ *
+<span class="del"> * @param crsFactory   The {@linkplain CoordinateReferenceSystem coordinate reference system}</span>
+ *                     authority factory, or {@code null}.
+<span class="del"> * @param csFactory    The {@linkplain CoordinateSystem coordinate system} authority factory,</span>
+<span class="del"> *                     or {@code null}.</span>
+<span class="del"> * @param datumFactory The {@linkplain Datum datum} authority factory, or {@code null}.</span>
+<span class="del"> * @param opFactory    The {@linkplain CoordinateOperation coordinate operation} authority</span>
+ *                     factory, or {@code null}.
+ */
+protected TransformedAuthorityFactory(final CRSAuthorityFactory                crsFactory,
+                                      final CSAuthorityFactory                  csFactory,
+                                      final DatumAuthorityFactory            datumFactory,
+<span class="del">                                      final CoordinateOperationAuthorityFactory opFactory)</span>
+<span class="del">{</span>
+    super(crsFactory, csFactory, datumFactory, opFactory);
+}
+
+/**
+<span class="del"> * Creates a wrappers around the default factories for the specified authority.</span>
+<span class="del"> * The factories are fetched using {@link FactoryFinder}.</span>
+ * &lt;p&gt;
+<span class="del"> * &lt;strong&gt;WARNING:&lt;/strong&gt; Do not invoke this constructor from a subclass to be registered in</span>
+<span class="del"> * a {@code META-INF/services/} file for use by {@link FactoryFinder}. It may lead to recursive</span>
+<span class="del"> * calls until a {@link StackOverflowError} is thrown.</span>
+ *
+<span class="del"> * @param  authority The authority to wraps (example: {@code "EPSG"}). If {@code null},</span>
+<span class="del"> *         then all authority factories must be explicitly specified in the set of hints.</span>
+<span class="del"> * @param  hints An optional set of hints, or {@code null} if none.</span>
+<span class="del"> * @throws FactoryRegistryException if at least one factory can not be obtained.</span>
+ */
+TransformedAuthorityFactory(final String authority, final Hints hints)
+<span class="del">        throws FactoryRegistryException</span>
+<span class="del">{</span>
+    super(FactoryFinder.getCRSAuthorityFactory                (authority, hints),
+          FactoryFinder.getCSAuthorityFactory                 (authority, hints),
+          FactoryFinder.getDatumAuthorityFactory              (authority, hints),
+<span class="del">          FactoryFinder.getCoordinateOperationAuthorityFactory(authority, hints));</span>
+}
+
+/**
+<span class="del"> * Suggests a factory group to use for the specified authority factory. The {@code factory}</span>
+<span class="del"> * parameter is usually one of {@link #datumFactory}, {@link #csFactory}, {@link #crsFactory}</span>
+<span class="del"> * or {@link #operationFactory} field. It may be {@code null}.</span>
+ */
+private FactoryGroup getFactoryGroup(final AuthorityFactory factory) {
+    if (factory instanceof DirectAuthorityFactory) {</pre></td>
+<td><pre>/**
+ * Creates a wrapper around the specified factories.
+ *
+<span class="add"> * @param crsFactory</span>
+<span class="add"> *            The</span>
+<span class="add"> *            {@linkplain CoordinateReferenceSystem coordinate reference system}</span>
+ *                     authority factory, or {@code null}.
+<span class="add"> * @param csFactory</span>
+<span class="add"> *            The {@linkplain CoordinateSystem coordinate system} authority</span>
+ *                     factory, or {@code null}.
+<span class="add"> * @param datumFactory</span>
+<span class="add"> *            The {@linkplain Datum datum} authority factory, or</span>
+<span class="add"> *            {@code null}.</span>
+<span class="add"> * @param opFactory</span>
+<span class="add"> *            The {@linkplain CoordinateOperation coordinate operation}</span>
+<span class="add"> *            authority factory, or {@code null}.</span>
+ */
+protected TransformedAuthorityFactory(final CRSAuthorityFactory                crsFactory,
+                                      final CSAuthorityFactory                  csFactory,
+                                      final DatumAuthorityFactory            datumFactory,
+<span class="add">        final CoordinateOperationAuthorityFactory opFactory) {</span>
+    super(crsFactory, csFactory, datumFactory, opFactory);
+}
+
+/**
+<span class="add"> * Creates a wrappers around the default factories for the specified</span>
+<span class="add"> * authority. The factories are fetched using {@link FactoryFinder}.</span>
+ * &lt;p&gt;
+<span class="add"> * &lt;strong&gt;WARNING:&lt;/strong&gt; Do not invoke this constructor from a subclass</span>
+<span class="add"> * to be registered in a {@code META-INF/services/} file for use by</span>
+<span class="add"> * {@link FactoryFinder}. It may lead to recursive calls until a</span>
+<span class="add"> * {@link StackOverflowError} is thrown.</span>
+ *
+<span class="add"> * @param authority</span>
+<span class="add"> *            The authority to wraps (example: {@code "EPSG"}). If</span>
+<span class="add"> *            {@code null}, then all authority factories must be explicitly</span>
+<span class="add"> *            specified in the set of hints.</span>
+<span class="add"> * @param hints</span>
+<span class="add"> *            An optional set of hints, or {@code null} if none.</span>
+<span class="add"> * @throws FactoryRegistryException</span>
+<span class="add"> *             if at least one factory can not be obtained.</span>
+ */
+TransformedAuthorityFactory(final String authority, final Hints hints)
+<span class="add">        throws FactoryRegistryException {</span>
+    super(FactoryFinder.getCRSAuthorityFactory                (authority, hints),
+          FactoryFinder.getCSAuthorityFactory                 (authority, hints),
+          FactoryFinder.getDatumAuthorityFactory              (authority, hints),
+<span class="add">            FactoryFinder.getCoordinateOperationAuthorityFactory(authority,</span>
+<span class="add">                    hints));</span>
+}
+
+/**
+<span class="add"> * Suggests a factory group to use for the specified authority factory. The</span>
+<span class="add"> * {@code factory} parameter is usually one of {@link #datumFactory},</span>
+<span class="add"> * {@link #csFactory}, {@link #crsFactory} or {@link #operationFactory}</span>
+<span class="add"> * field. It may be {@code null}.</span>
+ */
+private FactoryGroup getFactoryGroup(final AuthorityFactory factory) {
+    if (factory instanceof DirectAuthorityFactory) {</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Returns the implementation hint for the specified factory, or {@code null} if none.</span>
+ */
+<span class="del">private static Object getHint(final AuthorityFactory factory, final Hints.Key key) {</span>
+    if (factory instanceof Factory) {
+        return ((Factory) factory).getImplementationHints().get(key);
+    }</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Returns the implementation hint for the specified factory, or</span>
+<span class="add"> * {@code null} if none.</span>
+ */
+<span class="add">private static Object getHint(final AuthorityFactory factory,</span>
+<span class="add">        final Hints.Key key) {</span>
+    if (factory instanceof Factory) {
+        return ((Factory) factory).getImplementationHints().get(key);
+    }</pre></td></tr>
+<tr><td><pre> */
+private final CoordinateOperationFactory getCoordinateOperationFactory() {
+    if (opFactory == null) {
+<span class="del">        final Object candidate = getHint(operationFactory, Hints.COORDINATE_OPERATION_FACTORY);</span>
+        if (candidate instanceof CoordinateOperationFactory) {
+            opFactory = (CoordinateOperationFactory) candidate;
+        } else {
+<span class="del">            opFactory = FactoryFinder.getCoordinateOperationFactory(hints());</span>
+        }
+    }
+    return opFactory;</pre></td>
+<td><pre> */
+private final CoordinateOperationFactory getCoordinateOperationFactory() {
+    if (opFactory == null) {
+<span class="add">        final Object candidate = getHint(operationFactory,</span>
+<span class="add">                Hints.COORDINATE_OPERATION_FACTORY);</span>
+        if (candidate instanceof CoordinateOperationFactory) {
+            opFactory = (CoordinateOperationFactory) candidate;
+        } else {
+<span class="add">            opFactory = FactoryFinder</span>
+<span class="add">                    .getCoordinateOperationFactory(hints());</span>
+        }
+    }
+    return opFactory;</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Returns the priority for this factory. Priorities are used by {@link FactoryFinder} for</span>
+<span class="del"> * selecting a preferred factory when many are found for the same service. The default</span>
+<span class="del"> * implementation returns &lt;code&gt;{@linkplain #priority priority} + 1&lt;/code&gt;, which implies</span>
+<span class="del"> * that this adapter has precedence over the wrapped factories. Subclasses should override</span>
+<span class="del"> * this method if they want a different priority order for this instance.</span>
+ */
+public int getPriority() {
+    return priority + 1;</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Returns the priority for this factory. Priorities are used by</span>
+<span class="add"> * {@link FactoryFinder} for selecting a preferred factory when many are</span>
+<span class="add"> * found for the same service. The default implementation returns</span>
+<span class="add"> * &lt;code&gt;{@linkplain #priority priority} + 1&lt;/code&gt;, which implies that</span>
+<span class="add"> * this adapter has precedence over the wrapped factories. Subclasses should</span>
+<span class="add"> * override this method if they want a different priority order for this</span>
+<span class="add"> * instance.</span>
+ */
+public int getPriority() {
+    return priority + 1;</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Replaces the specified unit, if applicable. This method is invoked automatically by the</span>
+<span class="del"> * {@link #replace(CoordinateSystem)} method. The default implementation returns the unit</span>
+<span class="del"> * unchanged.</span>
+ *
+<span class="del"> * @param  units The units to replace.</span>
+ * @return The new units, or {@code units} if no change were needed.
+<span class="del"> * @throws FactoryException if an error occured while creating the new units.</span>
+ */
+//@Override
+protected Unit replace(final Unit units) throws FactoryException {</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Replaces the specified unit, if applicable. This method is invoked</span>
+<span class="add"> * automatically by the {@link #replace(CoordinateSystem)} method. The</span>
+<span class="add"> * default implementation returns the unit unchanged.</span>
+ *
+<span class="add"> * @param units</span>
+<span class="add"> *            The units to replace.</span>
+ * @return The new units, or {@code units} if no change were needed.
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if an error occured while creating the new units.</span>
+ */
+//@Override
+protected Unit replace(final Unit units) throws FactoryException {</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Replaces the specified direction, if applicable. This method is invoked automatically by the</span>
+<span class="del"> * {@link #replace(CoordinateSystem)} method. The default implementation returns the axis</span>
+<span class="del"> * direction unchanged.</span>
+ *
+<span class="del"> * @param  direction The axis direction to replace.</span>
+ * @return The new direction, or {@code direction} if no change were needed.
+<span class="del"> * @throws FactoryException if an error occured while creating the new axis direction.</span>
+ */
+<span class="del">protected AxisDirection replace(final AxisDirection direction) throws FactoryException {</span>
+    return direction;
+}
+
+/**
+<span class="del"> * Replaces (if needed) the specified axis by a new one. The default implementation</span>
+<span class="del"> * invokes {@link #replace(Unit)} and {@link #replace(AxisDirection)}.</span>
+ *
+<span class="del"> * @param  axis The coordinate system axis to replace.</span>
+<span class="del"> * @return The new coordinate system axis, or {@code axis} if no change were needed.</span>
+<span class="del"> * @throws FactoryException if an error occured while creating the new coordinate system axis.</span>
+ */
+//@Override
+<span class="del">protected CoordinateSystemAxis replace(CoordinateSystemAxis axis) throws FactoryException {</span>
+    final AxisDirection oldDirection = axis.getDirection();
+    final AxisDirection newDirection = replace(oldDirection);
+    final Unit          oldUnits     = axis.getUnit();</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Replaces the specified direction, if applicable. This method is invoked</span>
+<span class="add"> * automatically by the {@link #replace(CoordinateSystem)} method. The</span>
+<span class="add"> * default implementation returns the axis direction unchanged.</span>
+ *
+<span class="add"> * @param direction</span>
+<span class="add"> *            The axis direction to replace.</span>
+ * @return The new direction, or {@code direction} if no change were needed.
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if an error occured while creating the new axis direction.</span>
+ */
+<span class="add">protected AxisDirection replace(final AxisDirection direction)</span>
+<span class="add">        throws FactoryException {</span>
+    return direction;
+}
+
+/**
+<span class="add"> * Replaces (if needed) the specified axis by a new one. The default</span>
+<span class="add"> * implementation invokes {@link #replace(Unit)} and</span>
+<span class="add"> * {@link #replace(AxisDirection)}.</span>
+ *
+<span class="add"> * @param axis</span>
+<span class="add"> *            The coordinate system axis to replace.</span>
+<span class="add"> * @return The new coordinate system axis, or {@code axis} if no change were</span>
+<span class="add"> *         needed.</span>
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if an error occured while creating the new coordinate system</span>
+<span class="add"> *             axis.</span>
+ */
+//@Override
+<span class="add">protected CoordinateSystemAxis replace(CoordinateSystemAxis axis)</span>
+<span class="add">        throws FactoryException {</span>
+    final AxisDirection oldDirection = axis.getDirection();
+    final AxisDirection newDirection = replace(oldDirection);
+    final Unit          oldUnits     = axis.getUnit();</pre></td></tr>
+<tr><td><pre>    }
+    final CSFactory csFactory = factories.getCSFactory();
+    final Map properties = getProperties(axis);
+<span class="del">    axis = csFactory.createCoordinateSystemAxis(properties,</span>
+<span class="del">            axis.getAbbreviation(), newDirection, newUnits);</span>
+    axis = (CoordinateSystemAxis) pool.canonicalize(axis);
+}
+return axis;</pre></td>
+<td><pre>    }
+    final CSFactory csFactory = factories.getCSFactory();
+    final Map properties = getProperties(axis);
+<span class="add">    axis = csFactory.createCoordinateSystemAxis(properties, axis</span>
+<span class="add">            .getAbbreviation(), newDirection, newUnits);</span>
+    axis = (CoordinateSystemAxis) pool.canonicalize(axis);
+}
+return axis;</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Replaces (if needed) the specified coordinate system by a new one. The default implementation</span>
+<span class="del"> * invokes {@link #replace(CoordinateSystemAxis) replace} for each axis. In addition, axis are</span>
+<span class="del"> * sorted if this factory implements the {@link Comparator} interface.</span>
+ *
+<span class="del"> * @param  cs The coordinate system to replace.</span>
+<span class="del"> * @return The new coordinate system, or {@code cs} if no change were needed.</span>
+<span class="del"> * @throws FactoryException if an error occured while creating the new coordinate system.</span>
+ */
+//@Override
+<span class="del">protected CoordinateSystem replace(final CoordinateSystem cs) throws FactoryException {</span>
+    final int dimension = cs.getDimension();
+    final CoordinateSystemAxis[] orderedAxis = new CoordinateSystemAxis[dimension];
+    FactoryGroup factories = null;</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Replaces (if needed) the specified coordinate system by a new one. The</span>
+<span class="add"> * default implementation invokes</span>
+<span class="add"> * {@link #replace(CoordinateSystemAxis) replace} for each axis. In</span>
+<span class="add"> * addition, axis are sorted if this factory implements the</span>
+<span class="add"> * {@link Comparator} interface.</span>
+ *
+<span class="add"> * @param cs</span>
+<span class="add"> *            The coordinate system to replace.</span>
+<span class="add"> * @return The new coordinate system, or {@code cs} if no change were</span>
+<span class="add"> *         needed.</span>
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if an error occured while creating the new coordinate system.</span>
+ */
+//@Override
+<span class="add">protected CoordinateSystem replace(final CoordinateSystem cs)</span>
+<span class="add">        throws FactoryException {</span>
+    final int dimension = cs.getDimension();
+    final CoordinateSystemAxis[] orderedAxis = new CoordinateSystemAxis[dimension];
+    FactoryGroup factories = null;</pre></td></tr>
+<tr><td><pre>}
+for (int i=0; i&lt;dimension; i++) {
+    if (!orderedAxis[i].equals(cs.getAxis(i))) {
+<span class="del">        CoordinateSystem modified = createCS(cs.getClass(), getProperties(cs), orderedAxis);</span>
+<span class="del">        assert Utilities.sameInterfaces(cs.getClass(), modified.getClass(), CoordinateSystem.class);</span>
+        modified = (CoordinateSystem) pool.canonicalize(modified);
+        return modified;
+    }</pre></td>
+<td><pre>}
+for (int i=0; i&lt;dimension; i++) {
+    if (!orderedAxis[i].equals(cs.getAxis(i))) {
+<span class="add">        CoordinateSystem modified = createCS(cs.getClass(),</span>
+<span class="add">                getProperties(cs), orderedAxis);</span>
+<span class="add">        assert Utilities.sameInterfaces(cs.getClass(), modified</span>
+<span class="add">                .getClass(), CoordinateSystem.class);</span>
+        modified = (CoordinateSystem) pool.canonicalize(modified);
+        return modified;
+    }</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Replaces (if needed) the specified datum by a new one. The default implementation returns</span>
+<span class="del"> * the datum unchanged. Subclasses should override this method if some datum replacements are</span>
+<span class="del"> * desired.</span>
+ *
+<span class="del"> * @param  datum The datum to replace.</span>
+ * @return The new datum, or {@code datum} if no change were needed.
+<span class="del"> * @throws FactoryException if an error occured while creating the new datum.</span>
+ */
+//@Override
+protected Datum replace(final Datum datum) throws FactoryException {</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Replaces (if needed) the specified datum by a new one. The default</span>
+<span class="add"> * implementation returns the datum unchanged. Subclasses should override</span>
+<span class="add"> * this method if some datum replacements are desired.</span>
+ *
+<span class="add"> * @param datum</span>
+<span class="add"> *            The datum to replace.</span>
+ * @return The new datum, or {@code datum} if no change were needed.
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if an error occured while creating the new datum.</span>
+ */
+//@Override
+protected Datum replace(final Datum datum) throws FactoryException {</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Replaces (if needed) the specified coordinate reference system. The default</span>
+<span class="del"> * implementation checks if there is a {@linkplain #replace(Datum) datum replacement} or a</span>
+<span class="del"> * {@linkplain #replace(CoordinateSystem) coordinate system replacement}. If there is at</span>
+<span class="del"> * least one of those, then this method returns a new coordinate reference system using</span>
+<span class="del"> * the new datum and coordinate system.</span>
+ *
+<span class="del"> * @param  crs The coordinate reference system to replace.</span>
+ * @return A new CRS, or {@code crs} if no change were needed.
+<span class="del"> * @throws FactoryException if an error occured while creating the new CRS object.</span>
+ */
+//@Override
+<span class="del">protected CoordinateReferenceSystem replace(final CoordinateReferenceSystem crs)</span>
+<span class="del">        throws FactoryException</span>
+<span class="del">{</span>
+    /*
+<span class="del">     * Gets the replaced coordinate system and datum, and checks if there is any change.</span>
+     */
+    final CoordinateSystem oldCS = crs.getCoordinateSystem();
+    final CoordinateSystem    cs = replace(oldCS);</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Replaces (if needed) the specified coordinate reference system. The</span>
+<span class="add"> * default implementation checks if there is a</span>
+<span class="add"> * {@linkplain #replace(Datum) datum replacement} or a</span>
+<span class="add"> * {@linkplain #replace(CoordinateSystem) coordinate system replacement}.</span>
+<span class="add"> * If there is at least one of those, then this method returns a new</span>
+<span class="add"> * coordinate reference system using the new datum and coordinate system.</span>
+ *
+<span class="add"> * @param crs</span>
+<span class="add"> *            The coordinate reference system to replace.</span>
+ * @return A new CRS, or {@code crs} if no change were needed.
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if an error occured while creating the new CRS object.</span>
+ */
+//@Override
+<span class="add">protected CoordinateReferenceSystem replace(</span>
+<span class="add">        final CoordinateReferenceSystem crs) throws FactoryException {</span>
+    /*
+<span class="add">     * Gets the replaced coordinate system and datum, and checks if there is</span>
+<span class="add">     * any change.</span>
+     */
+    final CoordinateSystem oldCS = crs.getCoordinateSystem();
+    final CoordinateSystem    cs = replace(oldCS);</pre></td></tr>
+<tr><td><pre>} else {
+    datum = oldDatum = null;
+}
+<span class="del">final boolean sameCS = Utilities.equals(cs, oldCS) &amp;&amp; Utilities.equals(datum, oldDatum);</span>
+/*
+<span class="del"> * Creates a new coordinate reference system using the same properties than the</span>
+<span class="del"> * original CRS, except for the coordinate system, datum and authority code.</span>
+ */
+CoordinateReferenceSystem modified;
+if (crs instanceof GeneralDerivedCRS) {
+    final GeneralDerivedCRS         derivedCRS = (GeneralDerivedCRS) crs;
+<span class="del">    final CoordinateReferenceSystem oldBaseCRS = derivedCRS.getBaseCRS();</span>
+    final CoordinateReferenceSystem    baseCRS = replace(oldBaseCRS);
+    if (sameCS &amp;&amp; Utilities.equals(baseCRS, oldBaseCRS)) {
+        return crs;</pre></td>
+<td><pre>} else {
+    datum = oldDatum = null;
+}
+<span class="add">final boolean sameCS = Utilities.equals(cs, oldCS)</span>
+<span class="add">        &amp;&amp; Utilities.equals(datum, oldDatum);</span>
+/*
+<span class="add"> * Creates a new coordinate reference system using the same properties</span>
+<span class="add"> * than the original CRS, except for the coordinate system, datum and</span>
+<span class="add"> * authority code.</span>
+ */
+CoordinateReferenceSystem modified;
+if (crs instanceof GeneralDerivedCRS) {
+    final GeneralDerivedCRS         derivedCRS = (GeneralDerivedCRS) crs;
+<span class="add">    final CoordinateReferenceSystem oldBaseCRS = derivedCRS</span>
+<span class="add">            .getBaseCRS();</span>
+    final CoordinateReferenceSystem    baseCRS = replace(oldBaseCRS);
+    if (sameCS &amp;&amp; Utilities.equals(baseCRS, oldBaseCRS)) {
+        return crs;</pre></td></tr>
+<tr><td><pre>    final FactoryGroup factories = getFactoryGroup(crsFactory);
+    final CRSFactory  crsFactory = factories.getCRSFactory();
+    Conversion          fromBase = derivedCRS.getConversionFromBase();
+<span class="del">    fromBase = new DefiningConversion(getProperties(fromBase),</span>
+<span class="del">                   fromBase.getMethod(), fromBase.getParameterValues());</span>
+    if (crs instanceof ProjectedCRS) {
+<span class="del">        modified = factories.createProjectedCRS(properties, (GeographicCRS) baseCRS,</span>
+<span class="del">                                            fromBase, (CartesianCS) cs);</span>
+    } else {
+        // TODO: Need a createDerivedCRS method.
+<span class="del">        throw new FactoryException(Errors.format(ErrorKeys.UNSUPPORTED_CRS_$1,</span>
+<span class="del">                                   crs.getName().getCode()));</span>
+    }
+} else if (sameCS) {
+    return crs;</pre></td>
+<td><pre>    final FactoryGroup factories = getFactoryGroup(crsFactory);
+    final CRSFactory  crsFactory = factories.getCRSFactory();
+    Conversion          fromBase = derivedCRS.getConversionFromBase();
+<span class="add">    fromBase = new DefiningConversion(getProperties(fromBase), fromBase</span>
+<span class="add">            .getMethod(), fromBase.getParameterValues());</span>
+    if (crs instanceof ProjectedCRS) {
+<span class="add">        modified = factories.createProjectedCRS(properties,</span>
+<span class="add">                (GeographicCRS) baseCRS, fromBase, (CartesianCS) cs);</span>
+    } else {
+        // TODO: Need a createDerivedCRS method.
+<span class="add">        throw new FactoryException(Errors.format(</span>
+<span class="add">                ErrorKeys.UNSUPPORTED_CRS_$1, crs.getName().getCode()));</span>
+    }
+} else if (sameCS) {
+    return crs;</pre></td></tr>
+<tr><td><pre>    final FactoryGroup factories = getFactoryGroup(crsFactory);
+    final CRSFactory  crsFactory = factories.getCRSFactory();
+    if (crs instanceof GeographicCRS) {
+<span class="del">        modified = crsFactory.createGeographicCRS(properties, (GeodeticDatum) datum, (EllipsoidalCS) cs);</span>
+    } else if (crs instanceof GeocentricCRS) {
+        final GeodeticDatum gd = (GeodeticDatum) datum;
+        if (cs instanceof CartesianCS) {
+<span class="del">            modified = crsFactory.createGeocentricCRS(properties, gd, (CartesianCS) cs);</span>
+        } else {
+<span class="del">            modified = crsFactory.createGeocentricCRS(properties, gd, (SphericalCS) cs);</span>
+        }
+    } else if (crs instanceof VerticalCRS) {
+<span class="del">        modified = crsFactory.createVerticalCRS(properties, (VerticalDatum) datum, (VerticalCS) cs);</span>
+    } else if (crs instanceof TemporalCRS) {
+<span class="del">        modified = crsFactory.createTemporalCRS(properties, (TemporalDatum) datum, (TimeCS) cs);</span>
+    } else if (crs instanceof ImageCRS) {
+<span class="del">        modified = crsFactory.createImageCRS(properties, (ImageDatum) datum, (AffineCS) cs);</span>
+    } else if (crs instanceof EngineeringCRS) {
+<span class="del">        modified = crsFactory.createEngineeringCRS(properties, (EngineeringDatum) datum, cs);</span>
+    } else if (crs instanceof CompoundCRS) {
+<span class="del">        final List/*&lt;CoordinateReferenceSystem&gt;*/ elements =</span>
+<span class="del">                ((CompoundCRS) crs).getCoordinateReferenceSystems();</span>
+<span class="del">        final CoordinateReferenceSystem[] m = new CoordinateReferenceSystem[elements.size()];</span>
+        for (int i=0; i&lt;m.length; i++) {
+            m[i] = replace((CoordinateReferenceSystem) elements.get(i));
+        }
+        modified = crsFactory.createCompoundCRS(properties, m);
+    } else {
+<span class="del">        throw new FactoryException(Errors.format(ErrorKeys.UNSUPPORTED_CRS_$1,</span>
+<span class="del">                                                 crs.getName().getCode()));</span>
+    }
+}
+modified = (CoordinateReferenceSystem) pool.canonicalize(modified);</pre></td>
+<td><pre>    final FactoryGroup factories = getFactoryGroup(crsFactory);
+    final CRSFactory  crsFactory = factories.getCRSFactory();
+    if (crs instanceof GeographicCRS) {
+<span class="add">        modified = crsFactory.createGeographicCRS(properties,</span>
+<span class="add">                (GeodeticDatum) datum, (EllipsoidalCS) cs);</span>
+    } else if (crs instanceof GeocentricCRS) {
+        final GeodeticDatum gd = (GeodeticDatum) datum;
+        if (cs instanceof CartesianCS) {
+<span class="add">            modified = crsFactory.createGeocentricCRS(properties, gd,</span>
+<span class="add">                    (CartesianCS) cs);</span>
+        } else {
+<span class="add">            modified = crsFactory.createGeocentricCRS(properties, gd,</span>
+<span class="add">                    (SphericalCS) cs);</span>
+        }
+    } else if (crs instanceof VerticalCRS) {
+<span class="add">        modified = crsFactory.createVerticalCRS(properties,</span>
+<span class="add">                (VerticalDatum) datum, (VerticalCS) cs);</span>
+    } else if (crs instanceof TemporalCRS) {
+<span class="add">        modified = crsFactory.createTemporalCRS(properties,</span>
+<span class="add">                (TemporalDatum) datum, (TimeCS) cs);</span>
+    } else if (crs instanceof ImageCRS) {
+<span class="add">        modified = crsFactory.createImageCRS(properties,</span>
+<span class="add">                (ImageDatum) datum, (AffineCS) cs);</span>
+    } else if (crs instanceof EngineeringCRS) {
+<span class="add">        modified = crsFactory.createEngineeringCRS(properties,</span>
+<span class="add">                (EngineeringDatum) datum, cs);</span>
+    } else if (crs instanceof CompoundCRS) {
+<span class="add">        final List/* &lt;CoordinateReferenceSystem&gt; */elements = ((CompoundCRS) crs)</span>
+<span class="add">                .getCoordinateReferenceSystems();</span>
+<span class="add">        final CoordinateReferenceSystem[] m = new CoordinateReferenceSystem[elements</span>
+<span class="add">                .size()];</span>
+        for (int i=0; i&lt;m.length; i++) {
+            m[i] = replace((CoordinateReferenceSystem) elements.get(i));
+        }
+        modified = crsFactory.createCompoundCRS(properties, m);
+    } else {
+<span class="add">        throw new FactoryException(Errors.format(</span>
+<span class="add">                ErrorKeys.UNSUPPORTED_CRS_$1, crs.getName().getCode()));</span>
+    }
+}
+modified = (CoordinateReferenceSystem) pool.canonicalize(modified);</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Replaces (if needed) the specified coordinate operation. The default implementation checks if</span>
+<span class="del"> * there is a source or target {@linkplain #replace(CoordinateReferenceSystem) CRS replacement}.</span>
+<span class="del"> * If there is at least one of those, then this method returns a new coordinate operation using</span>
+<span class="del"> * the new CRS.</span>
+ *
+<span class="del"> * @param  operation The coordinate operation to replace.</span>
+ * @return A new operation, or {@code operation} if no change were needed.
+<span class="del"> * @throws FactoryException if an error occured while creating the new operation object.</span>
+ */
+//@Override
+protected CoordinateOperation replace(final CoordinateOperation operation)
+<span class="del">        throws FactoryException</span>
+<span class="del">{</span>
+    final CoordinateReferenceSystem oldSrcCRS = operation.getSourceCRS();
+    final CoordinateReferenceSystem oldTgtCRS = operation.getTargetCRS();
+    final CoordinateReferenceSystem sourceCRS = replace(oldSrcCRS);
+    final CoordinateReferenceSystem targetCRS = replace(oldTgtCRS);
+<span class="del">    if (Utilities.equals(oldSrcCRS, sourceCRS) &amp;&amp; Utilities.equals(oldTgtCRS, targetCRS)) {</span>
+        return operation;
+    }
+    CoordinateOperation modified;
+<span class="del">    modified = getCoordinateOperationFactory().createOperation(sourceCRS, targetCRS);</span>
+    modified = (CoordinateOperation) pool.canonicalize(modified);
+    return modified;
+}
+
+/**
+<span class="del"> * Creates a new coordinate system of the specified kind. This method is invoked automatically</span>
+<span class="del"> * by {@link #replace(CoordinateSystem)} after it determined that the axis need to be changed.</span>
+ *
+<span class="del"> * @param  type The coordinate system type to create.</span>
+<span class="del"> * @param  properties The properties to gives to the new coordinate system.</span>
+<span class="del"> * @param  axis The axis to give to the new coordinate system. Subclasses are allowed to write</span>
+<span class="del"> *              directly in this array (no need to copy it).</span>
+<span class="del"> * @return A new coordinate system of the specified kind with the specified axis.</span>
+<span class="del"> * @throws FactoryException if the coordinate system can't be created.</span>
+ */
+private CoordinateSystem createCS(final Class/*&lt;CoordinateSystem&gt;*/ type,
+<span class="del">                                  final Map properties,</span>
+<span class="del">                                  final CoordinateSystemAxis[] axis)</span>
+<span class="del">        throws FactoryException</span>
+<span class="del">{</span>
+    final int          dimension = axis.length;
+    final FactoryGroup factories = getFactoryGroup(csFactory);
+    final CSFactory    csFactory = factories.getCSFactory();
+    if (CartesianCS.class.isAssignableFrom(type)) {
+        switch (dimension) {
+<span class="del">            case 2: return csFactory.createCartesianCS(properties, axis[0], axis[1]);</span>
+<span class="del">            case 3: return csFactory.createCartesianCS(properties, axis[0], axis[1], axis[2]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (EllipsoidalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 2: return csFactory.createEllipsoidalCS(properties, axis[0], axis[1]);</span>
+<span class="del">            case 3: return csFactory.createEllipsoidalCS(properties, axis[0], axis[1], axis[2]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (SphericalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 3: return csFactory.createSphericalCS(properties, axis[0], axis[1], axis[2]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (CylindricalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 3: return csFactory.createCylindricalCS(properties, axis[0], axis[1], axis[2]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (PolarCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 2: return csFactory.createPolarCS(properties, axis[0], axis[1]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (VerticalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 1: return csFactory.createVerticalCS(properties, axis[0]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (TimeCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 1: return csFactory.createTimeCS(properties, axis[0]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (LinearCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 1: return csFactory.createLinearCS(properties, axis[0]);</span>
+        }
+<span class="del">    } else</span>
+<span class="del">    if (UserDefinedCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="del">            case 2: return csFactory.createUserDefinedCS(properties, axis[0], axis[1]);</span>
+<span class="del">            case 3: return csFactory.createUserDefinedCS(properties, axis[0], axis[1], axis[2]);</span>
+        }
+    }
+<span class="del">    throw new FactoryException(Errors.format(ErrorKeys.UNSUPPORTED_COORDINATE_SYSTEM_$1,</span>
+<span class="del">                               Utilities.getShortName(type)));</span>
+}
+
+/**
+<span class="del"> * Returns the properties to be given to an object replacing an original one. If the new object</span>
+<span class="del"> * keep the same authority, then all metadata are preserved. Otherwise (i.e. if a new authority</span>
+<span class="del"> * is given to the new object), then the old identifiers will be removed from the new object</span>
+ * metadata.
+ *
+<span class="del"> * @param  object The original object.</span>
+<span class="del"> * @return The properties to be given to the object created as a substitute of {@code object}.</span>
+ */
+private Map getProperties(final IdentifiedObject object) {
+    final Citation authority = getAuthority();</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Replaces (if needed) the specified coordinate operation. The default</span>
+<span class="add"> * implementation checks if there is a source or target</span>
+<span class="add"> * {@linkplain #replace(CoordinateReferenceSystem) CRS replacement}. If</span>
+<span class="add"> * there is at least one of those, then this method returns a new coordinate</span>
+<span class="add"> * operation using the new CRS.</span>
+ *
+<span class="add"> * @param operation</span>
+<span class="add"> *            The coordinate operation to replace.</span>
+ * @return A new operation, or {@code operation} if no change were needed.
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if an error occured while creating the new operation object.</span>
+ */
+//@Override
+protected CoordinateOperation replace(final CoordinateOperation operation)
+<span class="add">        throws FactoryException {</span>
+    final CoordinateReferenceSystem oldSrcCRS = operation.getSourceCRS();
+    final CoordinateReferenceSystem oldTgtCRS = operation.getTargetCRS();
+    final CoordinateReferenceSystem sourceCRS = replace(oldSrcCRS);
+    final CoordinateReferenceSystem targetCRS = replace(oldTgtCRS);
+<span class="add">    if (Utilities.equals(oldSrcCRS, sourceCRS)</span>
+<span class="add">            &amp;&amp; Utilities.equals(oldTgtCRS, targetCRS)) {</span>
+        return operation;
+    }
+    CoordinateOperation modified;
+<span class="add">    modified = getCoordinateOperationFactory().createOperation(sourceCRS,</span>
+<span class="add">            targetCRS);</span>
+    modified = (CoordinateOperation) pool.canonicalize(modified);
+    return modified;
+}
+
+/**
+<span class="add"> * Creates a new coordinate system of the specified kind. This method is</span>
+<span class="add"> * invoked automatically by {@link #replace(CoordinateSystem)} after it</span>
+<span class="add"> * determined that the axis need to be changed.</span>
+ *
+<span class="add"> * @param type</span>
+<span class="add"> *            The coordinate system type to create.</span>
+<span class="add"> * @param properties</span>
+<span class="add"> *            The properties to gives to the new coordinate system.</span>
+<span class="add"> * @param axis</span>
+<span class="add"> *            The axis to give to the new coordinate system. Subclasses are</span>
+<span class="add"> *            allowed to write directly in this array (no need to copy it).</span>
+<span class="add"> * @return A new coordinate system of the specified kind with the specified</span>
+<span class="add"> *         axis.</span>
+<span class="add"> * @throws FactoryException</span>
+<span class="add"> *             if the coordinate system can't be created.</span>
+ */
+private CoordinateSystem createCS(final Class/*&lt;CoordinateSystem&gt;*/ type,
+<span class="add">        final Map properties, final CoordinateSystemAxis[] axis)</span>
+<span class="add">        throws FactoryException {</span>
+    final int          dimension = axis.length;
+    final FactoryGroup factories = getFactoryGroup(csFactory);
+    final CSFactory    csFactory = factories.getCSFactory();
+    if (CartesianCS.class.isAssignableFrom(type)) {
+        switch (dimension) {
+<span class="add">        case 2:</span>
+<span class="add">            return csFactory</span>
+<span class="add">                    .createCartesianCS(properties, axis[0], axis[1]);</span>
+<span class="add">        case 3:</span>
+<span class="add">            return csFactory.createCartesianCS(properties, axis[0],</span>
+<span class="add">                    axis[1], axis[2]);</span>
+        }
+<span class="add">    } else if (EllipsoidalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 2:</span>
+<span class="add">            return csFactory.createEllipsoidalCS(properties, axis[0],</span>
+<span class="add">                    axis[1]);</span>
+<span class="add">        case 3:</span>
+<span class="add">            return csFactory.createEllipsoidalCS(properties, axis[0],</span>
+<span class="add">                    axis[1], axis[2]);</span>
+        }
+<span class="add">    } else if (SphericalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 3:</span>
+<span class="add">            return csFactory.createSphericalCS(properties, axis[0],</span>
+<span class="add">                    axis[1], axis[2]);</span>
+        }
+<span class="add">    } else if (CylindricalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 3:</span>
+<span class="add">            return csFactory.createCylindricalCS(properties, axis[0],</span>
+<span class="add">                    axis[1], axis[2]);</span>
+        }
+<span class="add">    } else if (PolarCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 2:</span>
+<span class="add">            return csFactory.createPolarCS(properties, axis[0], axis[1]);</span>
+        }
+<span class="add">    } else if (VerticalCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 1:</span>
+<span class="add">            return csFactory.createVerticalCS(properties, axis[0]);</span>
+        }
+<span class="add">    } else if (TimeCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 1:</span>
+<span class="add">            return csFactory.createTimeCS(properties, axis[0]);</span>
+        }
+<span class="add">    } else if (LinearCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 1:</span>
+<span class="add">            return csFactory.createLinearCS(properties, axis[0]);</span>
+        }
+<span class="add">    } else if (UserDefinedCS.class.isAssignableFrom(type)) {</span>
+        switch (dimension) {
+<span class="add">        case 2:</span>
+<span class="add">            return csFactory.createUserDefinedCS(properties, axis[0],</span>
+<span class="add">                    axis[1]);</span>
+<span class="add">        case 3:</span>
+<span class="add">            return csFactory.createUserDefinedCS(properties, axis[0],</span>
+<span class="add">                    axis[1], axis[2]);</span>
+        }
+    }
+<span class="add">    throw new FactoryException(Errors.format(</span>
+<span class="add">            ErrorKeys.UNSUPPORTED_COORDINATE_SYSTEM_$1, Utilities</span>
+<span class="add">                    .getShortName(type)));</span>
+}
+
+/**
+<span class="add"> * Returns the properties to be given to an object replacing an original</span>
+<span class="add"> * one. If the new object keep the same authority, then all metadata are</span>
+<span class="add"> * preserved. Otherwise (i.e. if a new authority is given to the new</span>
+<span class="add"> * object), then the old identifiers will be removed from the new object</span>
+ * metadata.
+ *
+<span class="add"> * @param object</span>
+<span class="add"> *            The original object.</span>
+<span class="add"> * @return The properties to be given to the object created as a substitute</span>
+<span class="add"> *         of {@code object}.</span>
+ */
+private Map getProperties(final IdentifiedObject object) {
+    final Citation authority = getAuthority();</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Creates an operation from coordinate reference system codes.</span>
+<span class="del"> * The default implementation first invokes the same method from the</span>
+<span class="del"> * {@linkplain #operationFactory underlying operation factory}, and next invokes</span>
+<span class="del"> * {@link #replace(CoordinateOperation) replace} for each operations.</span>
+ */
+public Set/*&lt;CoordinateOperation&gt;*/ createFromCoordinateReferenceSystemCodes(
+                                    final String sourceCode, final String targetCode)
+<span class="del">        throws FactoryException</span>
+<span class="del">{</span>
+    final Set/*&lt;CoordinateOperation&gt;*/ operations, modified;
+<span class="del">    operations = operationFactory.createFromCoordinateReferenceSystemCodes(sourceCode, targetCode);</span>
+    modified   = new LinkedHashSet((int) (operations.size()/0.75f) + 1);
+    for (final Iterator it=operations.iterator(); it.hasNext();) {
+        final CoordinateOperation operation;</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Creates an operation from coordinate reference system codes. The default</span>
+<span class="add"> * implementation first invokes the same method from the</span>
+<span class="add"> * {@linkplain #operationFactory underlying operation factory}, and next</span>
+<span class="add"> * invokes {@link #replace(CoordinateOperation) replace} for each</span>
+<span class="add"> * operations.</span>
+ */
+public Set/*&lt;CoordinateOperation&gt;*/ createFromCoordinateReferenceSystemCodes(
+                                    final String sourceCode, final String targetCode)
+<span class="add">        throws FactoryException {</span>
+    final Set/*&lt;CoordinateOperation&gt;*/ operations, modified;
+<span class="add">    operations = operationFactory.createFromCoordinateReferenceSystemCodes(</span>
+<span class="add">            sourceCode, targetCode);</span>
+    modified   = new LinkedHashSet((int) (operations.size()/0.75f) + 1);
+    for (final Iterator it=operations.iterator(); it.hasNext();) {
+        final CoordinateOperation operation;</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Releases resources immediately instead of waiting for the garbage collector. This method do</span>
+<span class="del"> * &lt;strong&gt;not&lt;/strong&gt; dispose the resources of wrapped factories (e.g. {@link #crsFactory</span>
+<span class="del"> * crsFactory}), because they may still in use by other classes.</span>
+ */
+public synchronized void dispose() throws FactoryException {
+    pool.clear();</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Releases resources immediately instead of waiting for the garbage</span>
+<span class="add"> * collector. This method do &lt;strong&gt;not&lt;/strong&gt; dispose the resources of</span>
+<span class="add"> * wrapped factories (e.g. {@link #crsFactory crsFactory}), because they may</span>
+<span class="add"> * still in use by other classes.</span>
+ */
+public synchronized void dispose() throws FactoryException {
+    pool.clear();</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

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

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

Added: sis/ip-review/rev/20874/UnavailableFactoryException.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/20874/UnavailableFactoryException.xhtml?rev=1718599&view=auto
==============================================================================
--- sis/ip-review/rev/20874/UnavailableFactoryException.xhtml (added)
+++ sis/ip-review/rev/20874/UnavailableFactoryException.xhtml Tue Dec  8 13:33:15 2015
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>UnavailableFactoryException changes for revisions 20873:20874</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>UnavailableFactoryException 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/factory/FactoryNotFoundException.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) 2006, Geotools Project Managment Committee (PMC)</span>
+ * (C) 2006, 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
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+<span class="del"> *</span>
+<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>
+ */
+package org.geotools.referencing.factory;</pre></td>
+<td><pre>/*
+<span class="add"> *    GeoTools - OpenSource mapping toolkit</span>
+<span class="add"> *    http://geotools.org</span>
+<span class="add"> *    (C) 2006, GeoTools Project Managment Committee (PMC)</span>
+ * (C) 2006, 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
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ */
+package org.geotools.referencing.factory;</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

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

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

Added: sis/ip-review/rev/23110/HEADER.html
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/23110/HEADER.html?rev=1718599&view=auto
==============================================================================
--- sis/ip-review/rev/23110/HEADER.html (added)
+++ sis/ip-review/rev/23110/HEADER.html Tue Dec  8 13:33:15 2015
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Revision 23110</title>
+  </head>
+  <body>
+    <div>
+      <h1>Revision 23110</h1>
+<table>
+  <tr><td><b>Author:</b></td><td>jdeolive</td></tr>
+  <tr><td><b>Date:</b></td><td>2006-11-29</td></tr>
+  <tr><td><b>Message:</b></td><td>added an adapter factory for GEOT-859</td></tr>
+</table>
+    </div>
+  </body>
+</html>

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

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

Added: sis/ip-review/rev/23110/URN_AuthorityFactory.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/23110/URN_AuthorityFactory.xhtml?rev=1718599&view=auto
==============================================================================
--- sis/ip-review/rev/23110/URN_AuthorityFactory.xhtml (added)
+++ sis/ip-review/rev/23110/URN_AuthorityFactory.xhtml Tue Dec  8 13:33:15 2015
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>URN_AuthorityFactory changes for revisions 23109:23110</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>URN_AuthorityFactory changes for revisions 23109:23110</h1>
+      <p>This class will not be ported to SIS. Experience has shown that attempts to handle HTTP and URN factories
+        as <code>AuthorityFactory</code> was more a source of complications than conveniences.</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r23109:23110 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/factory/URN_AuthorityFactory.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 23110</th></tr>
+<tr>
+<td><pre><span class="add">package org.geotools.referencing.crs;</span>
+<span class="add"></span>
+<span class="add">import org.geotools.metadata.iso.citation.CitationImpl;</span>
+<span class="add">import org.geotools.metadata.iso.citation.ResponsiblePartyImpl;</span>
+<span class="add">import org.geotools.referencing.factory.AuthorityFactoryAdapter;</span>
+<span class="add">import org.geotools.util.SimpleInternationalString;</span>
+<span class="add">import org.opengis.metadata.citation.Citation;</span>
+<span class="add">import org.opengis.metadata.citation.PresentationForm;</span>
+<span class="add">import org.opengis.referencing.FactoryException;</span>
+<span class="add">import org.opengis.referencing.crs.CRSAuthorityFactory;</span>
+<span class="add">import org.opengis.referencing.crs.CoordinateReferenceSystem;</span>
+<span class="add"></span>
+<span class="add"></span>
+<span class="add">public class URNEPSGCRSAuthorityFactoryAdapter extends AuthorityFactoryAdapter</span>
+<span class="add">    implements CRSAuthorityFactory {</span>
+<span class="add"></span>
+<span class="add">    private static final Citation EPSG;</span>
+<span class="add">    static {</span>
+<span class="add">       final CitationImpl c = new CitationImpl(ResponsiblePartyImpl.EPSG);</span>
+<span class="add">       c.setTitle( new SimpleInternationalString( "URN" ) );</span>
+<span class="add">       c.getPresentationForm().add(PresentationForm.TABLE_DIGITAL);</span>
+<span class="add">       EPSG = c;</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    public URNEPSGCRSAuthorityFactoryAdapter() {</span>
+<span class="add">       super( new EPSGCRSAuthorityFactory(),null,null,null);</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    public Citation getAuthority() {</span>
+<span class="add">       return EPSG;</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException {</span>
+<span class="add">       if ( code.startsWith( "URN:X-OGC:DEF:CRS:EPSG:6.11.2:" ) ) {</span>
+<span class="add">         code = "EPSG:" + code.substring( "URN:X-OGC:DEF:CRS:EPSG:6.11.2:".length() );</span>
+<span class="add">       }</span>
+<span class="add"></span>
+<span class="add">       return crsFactory.createCoordinateReferenceSystem( code );</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add"></span>
+<span class="add">}</span></pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/23110/URN_AuthorityFactory.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

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



Mime
View raw message