Return-Path:
X-Original-To: apmail-sis-commits-archive@www.apache.org
Delivered-To: apmail-sis-commits-archive@www.apache.org
Received: from mail.apache.org (hermes.apache.org [140.211.11.3])
by minotaur.apache.org (Postfix) with SMTP id F2806117E9
for ;
Tue, 24 Jun 2014 15:25:38 +0000 (UTC)
Received: (qmail 75073 invoked by uid 500); 24 Jun 2014 15:25:38 -0000
Delivered-To: apmail-sis-commits-archive@sis.apache.org
Received: (qmail 75042 invoked by uid 500); 24 Jun 2014 15:25:38 -0000
Mailing-List: contact commits-help@sis.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: sis-dev@sis.apache.org
Delivered-To: mailing list commits@sis.apache.org
Received: (qmail 75033 invoked by uid 99); 24 Jun 2014 15:25:38 -0000
Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230)
by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2014 15:25:38 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=5.0
tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4)
by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2014 15:25:36 +0000
Received: from eris.apache.org (localhost [127.0.0.1])
by eris.apache.org (Postfix) with ESMTP id 48EDB238889B;
Tue, 24 Jun 2014 15:25:10 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: svn commit: r1605109 - in /sis/branches/JDK7: ./
core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/
core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/
core/sis-referencing/src/test/java/or...
Date: Tue, 24 Jun 2014 15:25:09 -0000
To: commits@sis.apache.org
From: desruisseaux@apache.org
X-Mailer: svnmailer-1.0.9
Message-Id: <20140624152510.48EDB238889B@eris.apache.org>
X-Virus-Checked: Checked by ClamAV on apache.org
Author: desruisseaux
Date: Tue Jun 24 15:25:08 2014
New Revision: 1605109
URL: http://svn.apache.org/r1605109
Log:
Merge from the JDK8 branch.
Added:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1D.java
- copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1D.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LogarithmicTransform1D.java
- copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LogarithmicTransform1D.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransferFunction.java
- copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransferFunction.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomainTest.java
- copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomainTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1DTest.java
- copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ExponentialTransform1DTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java
- copied unchanged from r1605107, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java
Modified:
sis/branches/JDK7/ (props changed)
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PowerTransform1D.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
Merged /sis/branches/JDK8:r1600998-1605107
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -818,7 +818,7 @@ public abstract class AbstractMathTransf
public final boolean equals(final Object object) {
final boolean eq = equals(object, ComparisonMode.STRICT);
// If objects are equal, then they must have the same hash code value.
- assert !eq || hashCode() == object.hashCode() : this;
+ assert !eq || computeHashCode() == ((AbstractMathTransform) object).computeHashCode() : this;
return eq;
}
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConstantTransform1D.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -37,6 +37,16 @@ final class ConstantTransform1D extends
private static final long serialVersionUID = -1583675681650985947L;
/**
+ * A transform for the positive zero constant.
+ */
+ static final ConstantTransform1D ZERO = new ConstantTransform1D(0);
+
+ /**
+ * A transform for the one constant.
+ */
+ static final ConstantTransform1D ONE = new ConstantTransform1D(1);
+
+ /**
* Constructs a new constant transform.
*
* @param offset The {@code offset} term in the linear equation.
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -103,6 +103,8 @@ class LinearTransform1D extends Abstract
return IdentityTransform1D.INSTANCE;
}
if (scale == 0) {
+ if (offset == 0) return ConstantTransform1D.ZERO;
+ if (offset == 1) return ConstantTransform1D.ONE;
return new ConstantTransform1D(offset);
}
return new LinearTransform1D(scale, offset);
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -69,11 +69,15 @@ public class PassThroughTransform extend
/**
* Index of the first affected ordinate.
+ *
+ * @see #getModifiedCoordinates()
*/
final int firstAffectedOrdinate;
/**
* Number of unaffected ordinates after the affected ones.
+ *
+ * @see #getModifiedCoordinates()
*/
final int numTrailingOrdinates;
@@ -253,9 +257,16 @@ public class PassThroughTransform extend
* Returns the ordered sequence of positive integers defining the positions in a source
* coordinate tuple of the coordinates affected by this pass-through operation.
*
+ * API note: this method is final for now because most of Apache SIS code do
+ * not use the {@code modifiedCoordinates} array. Instead, SIS uses the {@code firstAffectedOrdinate}
+ * and {@code numTrailingOrdinates} information provided to the constructor. Consequently overriding
+ * this method may be misleading since it would be ignored by SIS. We do not want to make the "really
+ * used" fields public in order to keep the flexibility to replace them by a {@code modifiedCoordinates}
+ * array in a future SIS version.
+ *
* @return Indices of the modified source coordinates.
*/
- public int[] getModifiedCoordinates() {
+ public final int[] getModifiedCoordinates() {
final int[] index = new int[subTransform.getSourceDimensions()];
for (int i=0; iBefore to make this class public (if we do), we need to revisit the class name, define
* parameters and improve the {@link #concatenate(MathTransform, boolean)} method.
*
+ * {@section Serialization}
+ * Serialized instances of this class are not guaranteed to be compatible with future SIS versions.
+ * Serialization should be used only for short term storage or RMI between applications running the
+ * same SIS version.
+ *
* @author Martin Desruisseaux (Geomatys)
* @since 0.5 (derived from geotk-3.17)
* @version 0.5
@@ -73,7 +78,7 @@ final class PowerTransform1D extends Abs
*/
public static MathTransform1D create(final double power) {
if (power == 1) return IdentityTransform1D.INSTANCE;
- if (power == 0) return new ConstantTransform1D(1);
+ if (power == 0) return ConstantTransform1D.ONE;
return new PowerTransform1D(power);
}
@@ -192,7 +197,7 @@ final class PowerTransform1D extends Abs
@Override
public boolean equals(final Object object, final ComparisonMode mode) {
if (object == this) {
- return true; // Slight optimization
+ return true; // Optimization for a common case.
}
if (super.equals(object, mode)) {
return Numerics.equals(power, ((PowerTransform1D) object).power);
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/package-info.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -34,15 +34,18 @@
* In the 2D case, Apache SIS provides instances of the standard {@link java.awt.geom.AffineTransform}
* class when possible.
*
- * {@code MathTransform} usually performs conversions or transformations from points given in a
+ *
This package does not include map projections, which are a special kind of transforms defined
+ * in their own {@linkplain org.apache.sis.referencing.operation.projection projection} package.
+ *
+ * {@section Non-spatial coordinates}
+ * {@code MathTransform} usually performs conversions or transformations from points given in a
* {@linkplain org.apache.sis.referencing.operation.DefaultCoordinateOperation#getSourceCRS()
* source coordinate reference system} to coordinate values for the same points in the
* {@linkplain org.apache.sis.referencing.operation.DefaultCoordinateOperation#getTargetCRS()
* target coordinate reference system}. However the conversions are not necessarily between CRS;
- * a {@code MathTransform} can also be used for converting the sample values in a raster for example.
- *
- * This package does not include map projections, which are a special kind of transforms defined
- * in their own {@linkplain org.apache.sis.referencing.operation.projection projection} package.
+ * a {@code MathTransform} can also be used for converting the sample values in a raster for example.
+ * Such kind of transforms are named {@linkplain org.apache.sis.referencing.operation.transform.TransferFunction
+ * transfer functions}.
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.5 (derived from geotk-1.2)
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbstractMathTransformTest.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -19,17 +19,16 @@ package org.apache.sis.referencing.opera
import java.util.Arrays;
import java.util.Random;
import org.opengis.referencing.operation.TransformException;
+import static java.lang.StrictMath.*;
+import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_FAILURES;
+import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_BUFFER_SIZE;
// Test imports
import org.junit.Test;
import org.apache.sis.test.TestCase;
import org.apache.sis.test.DependsOn;
import org.apache.sis.test.DependsOnMethod;
-
import static org.junit.Assert.*;
-import static java.lang.StrictMath.*;
-import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_FAILURES;
-import static org.apache.sis.referencing.operation.transform.AbstractMathTransform.MAXIMUM_BUFFER_SIZE;
/**
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -19,12 +19,11 @@ package org.apache.sis.referencing.opera
import java.util.Random;
import org.apache.sis.measure.Latitude;
import org.apache.sis.measure.Longitude;
+import static java.lang.StrictMath.*;
// Test imports
import org.apache.sis.test.mock.GeodeticDatumMock;
-import static java.lang.StrictMath.*;
-
/**
* The domain of input coordinates.
@@ -144,7 +143,7 @@ public strictfp enum CoordinateDomain {
* Geographic input coordinates with angles in radians and only half of the longitude range.
* Ordinates are in (lambda, phi, height) order.
*/
- GEOGRAPHIC_RADIANS_HALF {
+ GEOGRAPHIC_RADIANS_HALF_λ {
@Override
double generate(final Random random, final int dimension) {
final double range;
@@ -249,7 +248,17 @@ public strictfp enum CoordinateDomain {
},
/**
- * Gaussian numbers: can be positives or negatives, mostly close to zero but some
+ * Values in the -10 to 10 range.
+ */
+ RANGE_10 {
+ @Override
+ double generate(final Random random, final int dimension) {
+ return random.nextDouble() * 20 - 10;
+ }
+ },
+
+ /**
+ * Gaussian distribution. Numbers can be positives or negatives, mostly close to zero but some
* numbers can be arbitrarily large.
*/
GAUSSIAN;
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CopyTransformTest.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -32,7 +32,10 @@ import org.apache.sis.test.DependsOn;
* @version 0.5
* @module
*/
-@DependsOn(ProjectiveTransformTest.class)
+@DependsOn({
+ CoordinateDomainTest.class,
+ ProjectiveTransformTest.class
+})
public final strictfp class CopyTransformTest extends MathTransformTestCase {
/**
* Generates random ordinates with approximatively 5% of NaN values in the array.
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/IterationStrategyTest.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -19,15 +19,14 @@ package org.apache.sis.referencing.opera
import java.util.Arrays;
import java.util.Random;
import org.opengis.referencing.operation.TransformException;
+import static java.lang.StrictMath.*;
+import static org.apache.sis.referencing.operation.transform.IterationStrategy.*;
// Test imports
import org.junit.Test;
import org.apache.sis.test.TestCase;
import org.apache.sis.test.DependsOnMethod;
-
import static org.junit.Assert.*;
-import static java.lang.StrictMath.*;
-import static org.apache.sis.referencing.operation.transform.IterationStrategy.*;
/**
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearTransformTest.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -26,7 +26,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.apache.sis.test.DependsOn;
-
import static org.opengis.test.Assert.*;
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -29,6 +29,8 @@ import org.opengis.referencing.operation
import org.opengis.referencing.operation.SingleOperation;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.MathTransformFactory;
+
+// Test imports
import org.apache.sis.metadata.iso.citation.HardCodedCitations;
Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java?rev=1605109&r1=1605108&r2=1605109&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java [UTF-8] Tue Jun 24 15:25:08 2014
@@ -18,7 +18,6 @@ package org.apache.sis.referencing.opera
import java.util.Random;
import java.io.IOException;
-import java.io.PrintStream;
import org.opengis.referencing.operation.Matrix;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.MathTransform1D;
@@ -31,24 +30,22 @@ import org.opengis.metadata.Identifier;
import org.apache.sis.parameter.Parameterized;
import org.apache.sis.util.Debug;
import org.apache.sis.util.Classes;
-import org.apache.sis.math.Statistics;
-import org.apache.sis.math.StatisticsFormat;
import org.apache.sis.io.TableAppender;
import org.apache.sis.io.wkt.Convention;
import org.apache.sis.io.wkt.FormattableObject;
import org.apache.sis.internal.util.Numerics;
+import static java.lang.StrictMath.*;
// Test imports
import org.opengis.test.Validators;
-import org.opengis.test.CalculationType;
-import org.opengis.test.ToleranceModifier;
import org.opengis.test.referencing.TransformTestCase;
-import org.apache.sis.test.TestCase;
import org.apache.sis.test.TestUtilities;
-
-import static java.lang.StrictMath.*;
import static org.apache.sis.test.ReferencingAssert.*;
+// Branch-dependent imports
+import org.opengis.test.CalculationType;
+import org.opengis.test.ToleranceModifier;
+
/**
* Base class for tests of {@link AbstractMathTransform} implementations.
@@ -315,30 +312,9 @@ public abstract strictfp class MathTrans
final int numPts = ORDINATE_COUNT / dimension;
final Random random = TestUtilities.createRandomNumberGenerator();
final double[] coordinates = domain.generateRandomInput(random, dimension, numPts);
- for (int i = Math.round(coordinates.length * propNaN); --i >= 0;) {
+ for (int i = round(coordinates.length * propNaN); --i >= 0;) {
coordinates[random.nextInt(coordinates.length)] = Double.NaN;
}
- if (TestCase.verbose) {
- final PrintStream out = out();
- out.print("Random input coordinates for ");
- out.print(domain); out.println(" domain:");
- final Statistics[] stats = new Statistics[dimension];
- for (int i=0; i