sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1723785 - in /sis/branches/JDK7: ./ core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
Date Fri, 08 Jan 2016 19:41:11 GMT
Author: desruisseaux
Date: Fri Jan  8 19:41:11 2016
New Revision: 1723785

URL: http://svn.apache.org/viewvc?rev=1723785&view=rev
Log:
Merge NullPointerException fix from the JDK8 branch.

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

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan  8 19:41:11 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1723735
+/sis/branches/JDK8:1584960-1723784
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java?rev=1723785&r1=1723784&r2=1723785&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
[UTF-8] Fri Jan  8 19:41:11 2016
@@ -159,9 +159,9 @@ public final class ReferencingUtilities
     }
 
     /**
-     * Returns the ellipsoid used by the specified coordinate reference system, providing
that
-     * the two first dimensions use an instance of {@link GeographicCRS}. Otherwise (i.e.
if the
-     * two first dimensions are not geographic), returns {@code null}.
+     * Returns the ellipsoid used by the specified coordinate reference system, provided
that the two first dimensions
+     * use an instance of {@link GeographicCRS}. Otherwise (i.e. if the two first dimensions
are not geographic),
+     * returns {@code null}.
      *
      * <p>This method excludes geocentric CRS on intend. Some callers needs this exclusion
as a way to identify
      * which CRS in a Geographic/Geocentric conversion is the geographic one. An other point
of view is to said

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1723785&r1=1723784&r2=1723785&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] Fri Jan  8 19:41:11 2016
@@ -256,7 +256,11 @@ public class DefaultConversion extends A
                  */
                 final DefaultMathTransformFactory.Context context = new DefaultMathTransformFactory.Context();
                 context.setSource(source);
-                context.setTarget(target.getCoordinateSystem());
+                if (target instanceof GeneralDerivedCRS) {
+                    context.setTarget(target.getCoordinateSystem());    // Using 'target'
would be unsafe here.
+                } else {
+                    context.setTarget(target);
+                }
                 transform = ((DefaultMathTransformFactory) factory).createParameterizedTransform(parameters,
context);
                 parameters = Parameters.unmodifiable(context.getCompletedParameters());
             } else {
@@ -275,12 +279,10 @@ public class DefaultConversion extends A
              * ProjectedCRS), then DefaultMathTransformFactory has a specialized createBaseToDerived(…)
              * method for this job.
              */
-            final CoordinateReferenceSystem sourceCRS = super.getSourceCRS();
-            final CoordinateReferenceSystem targetCRS = super.getTargetCRS();
             if (sourceCRS == null && targetCRS == null && factory instanceof
DefaultMathTransformFactory) {
                 final DefaultMathTransformFactory.Context context = new DefaultMathTransformFactory.Context();
-                context.setSource(source);
-                context.setTarget(target);
+                context.setSource(source.getCoordinateSystem());
+                context.setTarget(target.getCoordinateSystem());    // See comment on the
other setTarget(…) call.
                 transform = ((DefaultMathTransformFactory) factory).swapAndScaleAxes(transform,
context);
             } else {
                 /*



Mime
View raw message