Modified: 
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- 
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java
 [UTF-8] (original)
+++ 
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java
 [UTF-8] Wed Apr 20 14:53:31 2016
@@ -45,7 +45,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.7
  * @module
  */
 public final strictfp class TestUtilities extends Static {
@@ -285,7 +285,7 @@ public final strictfp class TestUtilitie
      *   "      └─"
      * }
      *
-     * This method is used for comparing two tree having string representation 
in different locales.
+     * This method is used for comparing two trees having string 
representation in different locales.
      * In such case, we can not compare the actual text content. The best we 
can do is to compare
      * the tree structure.
      *
@@ -341,6 +341,26 @@ public final strictfp class TestUtilitie
     }
 
     /**
+     * Returns a copy of the given array with the last ordinate values dropped 
for each coordinates.
+     *
+     * @param  coordinates The source coordinates from which to drop the last 
ordinate values.
+     * @param  sourceDim   Number of dimensions of each point in the {@code 
coordinates} array.
+     * @param  targetDim   Number of dimensions to retain.
+     * @return Copy of the given {@code coordinates} array with only the 
{@code targetDim} first dimension for each point.
+     *
+     * @since 0.7
+     */
+    public static double[] dropLastDimensions(final double[] coordinates, 
final int sourceDim, final int targetDim) {
+        assertEquals("Unexpected array length.", 0, coordinates.length % 
sourceDim);
+        final int numPts = coordinates.length / sourceDim;
+        final double[] reduced = new double[numPts * targetDim];
+        for (int i=0; i<numPts; i++) {
+            System.arraycopy(coordinates, i*sourceDim, reduced, i*targetDim, 
targetDim);
+        }
+        return reduced;
+    }
+
+    /**
      * If the given failure is not null, re-thrown it as an {@link Error} or
      * {@link RuntimeException}. Otherwise do nothing.
      *

Modified: 
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- 
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
 [UTF-8] (original)
+++ 
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
 [UTF-8] Wed Apr 20 14:53:31 2016
@@ -33,10 +33,6 @@ import javax.measure.unit.Unit;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import javax.measure.quantity.Duration;
-import org.opengis.feature.Feature;
-import org.opengis.feature.FeatureType;
-import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
 import org.opengis.metadata.Metadata;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -62,6 +58,10 @@ import org.apache.sis.util.resources.Ind
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.Instant;
+import org.opengis.feature.Feature;
+import org.opengis.feature.FeatureType;
+import org.opengis.feature.PropertyType;
+import org.opengis.feature.AttributeType;
 
 
 /**

Modified: 
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- 
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java
 [UTF-8] Wed Apr 20 14:53:31 2016
@@ -18,7 +18,6 @@ package org.apache.sis.internal.storage.
 
 import java.util.Iterator;
 import java.io.StringReader;
-import org.opengis.feature.Feature;
 import org.opengis.metadata.Metadata;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.metadata.extent.SpatialTemporalExtent;
@@ -30,6 +29,9 @@ import org.junit.Test;
 import static org.junit.Assert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
+// Branch-dependent imports
+import org.opengis.feature.Feature;
+
 
 /**
  * Tests {@link Store}.


Reply via email to