sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1585007 - in /sis/branches/JDK8: core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/ core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/ core/sis-utility/src/main/java/org/apache/sis/internal/util/ core/sis-utility...
Date Sat, 05 Apr 2014 06:45:08 GMT
Author: desruisseaux
Date: Sat Apr  5 06:45:07 2014
New Revision: 1585007

URL: http://svn.apache.org/r1585007
Log:
First round of replacement of JDK7 placeholders by JDK8 API.

Removed:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/DoubleConsumer.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/Function.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/LongConsumer.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/Supplier.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/EmptySortedSet.java
Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/JDK8.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
    sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java
    sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -289,7 +289,7 @@ public final class Extents extends Stati
         if (min == null) return max;
         if (max == null) return min;
         final long startTime = min.getTime();
-        return new Date(startTime + Math.round((max.getTime() - startTime) * location));
// addExact on JDK8 branch.
+        return new Date(Math.addExact(startTime, Math.round((max.getTime() - startTime) *
location)));
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/JDK8.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/JDK8.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/JDK8.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/JDK8.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -50,18 +50,6 @@ public final class JDK8 {
     }
 
     /**
-     * Returns the floating-point value adjacent to {@code value} in the direction of negative
infinity.
-     *
-     * @param  value The value for which to get the adjacent value.
-     * @return The adjacent value in the direction of negative infinity.
-     *
-     * @since 0.4
-     */
-    public static double nextDown(final double value) {
-        return Math.nextAfter(value, Double.NEGATIVE_INFINITY);
-    }
-
-    /**
      * Parses a date from a string in ISO 8601 format. More specifically, this method expects
the
      * format defined by <cite>XML Schema Part 2: Datatypes for {@code xsd:dateTime}</cite>,
with
      * some additional flexibility (e.g. missing minutes or seconds fields are automatically
added).

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -27,7 +27,7 @@ import org.opengis.parameter.InvalidPara
 import static org.apache.sis.util.collection.Containers.hashMapCapacity;
 
 // Related to JDK8
-import org.apache.sis.internal.jdk8.Function;
+import java.util.function.Function;
 
 
 /**
@@ -76,24 +76,6 @@ public final class CollectionsExt extend
     }
 
     /**
-     * Returns a {@linkplain SortedSet sorted set} which is always empty and accepts no element.
-     *
-     * <div class="note"><b>Note:</b>
-     * This method exists only on the JDK6 and JDK7 branches. This method will
-     * be removed from the JDK8 branch, since it has been added to the JDK.</div>
-     *
-     * @param <E> The type of elements in the empty collection.
-     * @return An empty collection.
-     *
-     * @see Collections#emptyList()
-     * @see Collections#emptySet()
-     */
-    @SuppressWarnings({"unchecked","rawtype"})
-    public static <E> SortedSet<E> emptySortedSet() {
-        return EmptySortedSet.INSTANCE;
-    }
-
-    /**
      * Returns the given array if non-empty, or {@code null} if the given array is null or
empty.
      * This method is generally not recommended, since public API should prefer empty array
instead of null.
      * However this method is occasionally useful for managing private fields.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java [UTF-8]
Sat Apr  5 06:45:07 2014
@@ -28,8 +28,8 @@ import static java.lang.Double.doubleToL
 
 // Related to JDK7 and JDK8
 import java.util.Objects;
-import org.apache.sis.internal.jdk8.LongConsumer;
-import org.apache.sis.internal.jdk8.DoubleConsumer;
+import java.util.function.LongConsumer;
+import java.util.function.DoubleConsumer;
 
 
 /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8]
Sat Apr  5 06:45:07 2014
@@ -678,7 +678,7 @@ public final class Numbers extends Stati
             if (type == Map      .class) return (T) Collections.EMPTY_MAP;
             if (type == List     .class) return (T) Collections.EMPTY_LIST;
             if (type == Queue    .class) return (T) CollectionsExt.emptyQueue();
-            if (type == SortedSet.class) return (T) CollectionsExt.emptySortedSet();
+            if (type == SortedSet.class) return (T) Collections.emptySortedSet();
             if (type.isAssignableFrom(Set.class)) {
                 return (T) Collections.EMPTY_SET;
             }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -20,7 +20,7 @@ import java.util.Set;
 import org.apache.sis.math.FunctionProperty;
 
 // Related to JDK8
-import org.apache.sis.internal.jdk8.Function;
+import java.util.function.Function;
 
 
 /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -37,7 +37,7 @@ import org.apache.sis.internal.system.Re
 import static org.apache.sis.internal.system.DelayedExecutor.executeDaemonTask;
 
 // Related to JDK8
-import org.apache.sis.internal.jdk8.Supplier;
+import java.util.function.Supplier;
 
 
 /**

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -35,7 +35,7 @@ import org.junit.Test;
 import static org.apache.sis.test.Assert.*;
 
 // Related to JDK8
-import org.apache.sis.internal.jdk8.Function;
+import java.util.function.Function;
 
 
 /**

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -27,9 +27,6 @@ import static org.apache.sis.math.MathFu
 import static org.apache.sis.util.ArraysExt.isSorted;
 import static org.apache.sis.internal.util.Numerics.SIGNIFICAND_SIZE;
 
-// Related to JDK8
-import org.apache.sis.internal.jdk8.JDK8;
-
 
 /**
  * Tests the {@link MathFunctions} static methods.
@@ -135,7 +132,7 @@ public final strictfp class MathFunction
         for (int i=0; i<=SIGNIFICAND_SIZE; i++) {
             assertEquals(MIN_EXPONENT - i, getExponent(MIN_NORMAL / (1L << i)));
         }
-        assertEquals(MIN_EXPONENT - 1,                    getExponent(JDK8.nextDown(MIN_NORMAL)));
+        assertEquals(MIN_EXPONENT - 1,                    getExponent(StrictMath.nextDown(MIN_NORMAL)));
         assertEquals(MIN_EXPONENT - SIGNIFICAND_SIZE,     getExponent(MIN_VALUE));
         assertEquals(MIN_EXPONENT - SIGNIFICAND_SIZE - 1, getExponent(0));
         /*

Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -19,7 +19,9 @@ package org.apache.sis.internal.netcdf.i
 import java.lang.reflect.Array;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Utilities;
-import org.apache.sis.internal.jdk8.Function;
+
+// Related to JDK8
+import java.util.function.Function;
 
 
 /**
@@ -35,11 +37,7 @@ final class Attribute {
     /**
      * The function for obtaining the name of an attribute.
      */
-    static final Function<Attribute,String> NAME_FUNCTION = new Function<Attribute,String>()
{
-        @Override public String apply(final Attribute value) {
-            return value.name;
-        }
-    };
+    static final Function<Attribute,String> NAME_FUNCTION = (Attribute value1) ->
value1.name;
 
     /**
      * The attribute name.

Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1585007&r1=1585006&r2=1585007&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
[UTF-8] Sat Apr  5 06:45:07 2014
@@ -33,7 +33,6 @@ import java.lang.reflect.Array;
 import javax.measure.converter.UnitConverter;
 import javax.measure.converter.ConversionException;
 import org.opengis.parameter.InvalidParameterCardinalityException;
-import org.apache.sis.internal.jdk8.Function;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.internal.netcdf.Variable;
 import org.apache.sis.internal.netcdf.GridGeometry;
@@ -49,6 +48,9 @@ import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.Debug;
 import org.apache.sis.measure.Units;
 
+// Related to JDK8
+import java.util.function.Function;
+
 
 /**
  * Provides NetCDF decoding services as a standalone library.



Mime
View raw message