sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1832159 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/internal/jaxb/ sis-metadata/src/main/java/org/apache/sis/internal/metadata/ sis-referencing/src/test/java/org/apache/sis/referencing/ sis-utility/src/main/java...
Date Thu, 24 May 2018 12:51:46 GMT
Author: desruisseaux
Date: Thu May 24 12:51:46 2018
New Revision: 1832159

URL: http://svn.apache.org/viewvc?rev=1832159&view=rev
Log:
Simplify some calls to Collections.emptySet(). Those simplifications are possible in Java
8 (the more complicated form was necessary in Java 7).

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.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/util/collection/DefaultTreeTable.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java?rev=1832159&r1=1832158&r2=1832159&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
[UTF-8] Thu May 24 12:51:46 2018
@@ -98,7 +98,7 @@ public class IdentifierMapAdapter extend
     /**
      * An immutable empty instance.
      */
-    public static final IdentifierMap EMPTY = new IdentifierMapAdapter(Collections.<Identifier>emptySet());
+    public static final IdentifierMap EMPTY = new IdentifierMapAdapter(Collections.emptySet());
 
     /**
      * The identifiers to wrap in a map view.

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java?rev=1832159&r1=1832158&r2=1832159&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
[UTF-8] Thu May 24 12:51:46 2018
@@ -49,8 +49,7 @@ public final class TransformationAccurac
      * The type of record instances which will hold coordinate transformation accuracy values.
      */
     private static final RecordType TYPE = RecordSchemaSIS.INSTANCE.createRecordType("Real",
-            Collections.<CharSequence,Class<?>>singletonMap(
-                    Vocabulary.formatInternational(Vocabulary.Keys.Value), Double.class));
+            Collections.singletonMap(Vocabulary.formatInternational(Vocabulary.Keys.Value),
Double.class));
 
     /**
      * Cache the positional accuracies. Most coordinate operation use a small set of accuracy
values.

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java?rev=1832159&r1=1832158&r2=1832159&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
[UTF-8] Thu May 24 12:51:46 2018
@@ -134,7 +134,7 @@ public final strictfp class AbstractIden
      */
     @Test
     public void testWithoutIdentifier() {
-        final Set<Identifier>          identifiers = Collections.<Identifier>emptySet();
+        final Set<Identifier>          identifiers = Collections.emptySet();
         final AbstractIdentifiedObject object      = new AbstractIdentifiedObject(properties(identifiers));
         final Identifier               gmlId       = validate(object, identifiers, "GRS1980");
         assertNull("gmlId", gmlId);

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=1832159&r1=1832158&r2=1832159&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] Thu May 24 12:51:46 2018
@@ -217,7 +217,7 @@ public final class CollectionsExt extend
      * @return the given collection, or an empty set if the given collection was null.
      */
     public static <E> Collection<E> nonNull(final Collection<E> c) {
-        return (c != null) ? c : Collections.<E>emptySet();
+        return (c != null) ? c : Collections.emptySet();
     }
 
     /**
@@ -228,7 +228,7 @@ public final class CollectionsExt extend
      * @return the given collection, or an empty set if the given collection was null.
      */
     public static <E> Set<E> nonNull(final Set<E> c) {
-        return (c != null) ? c : Collections.<E>emptySet();
+        return (c != null) ? c : Collections.emptySet();
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java?rev=1832159&r1=1832158&r2=1832159&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
[UTF-8] Thu May 24 12:51:46 2018
@@ -166,7 +166,7 @@ public class DefaultTreeTable implements
             ArgumentChecks.ensureNonNullElement("columns", i, column);
             final Integer pos = i;
             if (map == null) {
-                map = Collections.<TableColumn<?>,Integer>singletonMap(column,
pos);
+                map = Collections.singletonMap(column, pos);
             } else if (map.put(column, pos) != null) {
                 throw new IllegalArgumentException(Errors.format(Errors.Keys.DuplicatedIdentifier_1,
column));
             }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java?rev=1832159&r1=1832158&r2=1832159&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
[UTF-8] Thu May 24 12:51:46 2018
@@ -164,8 +164,7 @@ public class TableColumn<V> implements C
      * A map containing only the {@link #NAME} column.
      * This is the default set of columns when parsing a tree table.
      */
-    static final Map<TableColumn<?>,Integer> NAME_MAP =
-            Collections.<TableColumn<?>,Integer>singletonMap(NAME, 0);
+    static final Map<TableColumn<?>,Integer> NAME_MAP = Collections.singletonMap(NAME,
0);
 
     /**
      * Base type of all values in the column identified by this {@code ColumnTable} instance.



Mime
View raw message