sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762629 [3/15] - in /sis/trunk: ./ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-console/src/test/java/org/apache/sis/console/ application/sis-openoffice/src/main/java/org/apache/sis/openoffice/ application/...
Date Wed, 28 Sep 2016 09:59:48 GMT
Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -55,7 +55,7 @@ public final strictfp class DefaultFeatu
      * @return The feature for a city.
      */
     public static DefaultFeatureType city() {
-        final Map<String,Object> identification = new HashMap<String,Object>();
+        final Map<String,Object> identification = new HashMap<>();
         final DefaultAttributeType<String>  city       = DefaultAttributeTypeTest.city(identification);
         final DefaultAttributeType<Integer> population = DefaultAttributeTypeTest.population(identification);
 
@@ -112,14 +112,14 @@ public final strictfp class DefaultFeatu
      * @return The feature for a metropolis.
      */
     public static DefaultFeatureType metropolis() {
-        final Map<String,Object> identification = new HashMap<String,Object>(4);
+        final Map<String,Object> identification = new HashMap<>(4);
         assertNull(identification.put(DefaultFeatureType.NAME_KEY,         "Metropolis"));
         assertNull(identification.put(DefaultFeatureType.NAME_KEY + "_fr", "Métropole"));
         return new DefaultFeatureType(identification, false,
                 new DefaultFeatureType[] {city()},
-                new DefaultAttributeType<CharSequence>(singletonMap(DefaultAttributeType.NAME_KEY, "region"),
+                new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "region"),
                         CharSequence.class, 1, 1, null),
-                new DefaultAttributeType<Boolean>(singletonMap(DefaultAttributeType.NAME_KEY, "isGlobal"),
+                new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "isGlobal"),
                         Boolean.class, 1, 1, null));
     }
 
@@ -135,8 +135,8 @@ public final strictfp class DefaultFeatu
      * Creates a sub-type of the "metropolis" type with the "region" attribute overridden to the given type.
      * The given type should be {@link InternationalString}, but we allow other types for testing argument checks.
      */
-    private static <T> DefaultFeatureType worldMetropolis(final DefaultFeatureType metropolis,
-            final DefaultFeatureType universityCity, final DefaultAttributeType<?> temperature, final Class<T> regionType)
+    private static DefaultFeatureType worldMetropolis(final DefaultFeatureType metropolis,
+            final DefaultFeatureType universityCity, final DefaultAttributeType<?> temperature, final Class<?> regionType)
     {
         return new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, "World metropolis"), false,
                 new DefaultFeatureType[] {          // Super types
@@ -144,7 +144,7 @@ public final strictfp class DefaultFeatu
                     universityCity
                 },
                 new DefaultAttributeType<?>[] {     // Properties
-                    new DefaultAttributeType<T>(singletonMap(DefaultAttributeType.NAME_KEY, "region"), regionType, 1, 1, null),
+                    new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "region"), regionType, 1, 1, null),
                     temperature
                 });
     }
@@ -244,7 +244,7 @@ public final strictfp class DefaultFeatu
     @Test
     @DependsOnMethod("testSimple")
     public void testComplex() {
-        final Map<String,Object> identification = new HashMap<String,Object>();
+        final Map<String,Object> identification = new HashMap<>();
         final DefaultAttributeType<String>  city       = DefaultAttributeTypeTest.city(identification);
         final DefaultAttributeType<Integer> population = DefaultAttributeTypeTest.population(identification);
         testComplex(city, population, 0, 0);    // Simple
@@ -262,7 +262,7 @@ public final strictfp class DefaultFeatu
             final DefaultAttributeType<Integer> population,
             final int minimumOccurs, final int maximumOccurs)
     {
-        final DefaultAttributeType<String> festival = new DefaultAttributeType<String>(
+        final DefaultAttributeType<String> festival = new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, "festival"),
                 String.class, minimumOccurs, maximumOccurs, null);
 
@@ -296,11 +296,11 @@ public final strictfp class DefaultFeatu
     @Test
     @DependsOnMethod("testSimple")
     public void testNameCollision() {
-        final DefaultAttributeType<String> city = new DefaultAttributeType<String>(
+        final DefaultAttributeType<String> city = new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, "name"), String.class, 1, 1, null);
-        final DefaultAttributeType<Integer> cityId = new DefaultAttributeType<Integer>(
+        final DefaultAttributeType<Integer> cityId = new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, "name"), Integer.class, 1, 1, null);
-        final DefaultAttributeType<Integer> population = new DefaultAttributeType<Integer>(
+        final DefaultAttributeType<Integer> population = new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, "population"), Integer.class, 1, 1, null);
 
         final Map<String,String> identification = singletonMap(DefaultAttributeType.NAME_KEY, "City");
@@ -324,13 +324,13 @@ public final strictfp class DefaultFeatu
     @DependsOnMethod("testNameCollision")
     public void testQualifiedNames() {
         final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
-        final DefaultAttributeType<String> city = new DefaultAttributeType<String>(
+        final DefaultAttributeType<String> city = new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, factory.createGenericName(null, "ns1", "name")),
                 String.class, 1, 1, null);
-        final DefaultAttributeType<Integer> cityId = new DefaultAttributeType<Integer>(
+        final DefaultAttributeType<Integer> cityId = new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, factory.createGenericName(null, "ns2", "name")),
                 Integer.class, 1, 1, null);
-        final DefaultAttributeType<Integer> population = new DefaultAttributeType<Integer>(
+        final DefaultAttributeType<Integer> population = new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, factory.createGenericName(null, "ns1", "population")),
                 Integer.class, 1, 1, null);
         final DefaultFeatureType feature = new DefaultFeatureType(
@@ -426,7 +426,7 @@ public final strictfp class DefaultFeatu
         final DefaultFeatureType metroCapital = new DefaultFeatureType(
                 singletonMap(DefaultFeatureType.NAME_KEY, "Metropolis and capital"), false,
                 new DefaultFeatureType[] {metropolis, capital},
-                new DefaultAttributeType<String>(singletonMap(DefaultAttributeType.NAME_KEY, "country"),
+                new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "country"),
                         String.class, 1, 1, null));
 
         assertUnmodifiable(metroCapital);

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -64,17 +64,17 @@ public final strictfp class EnvelopeOper
      * @return the feature for a school.
      */
     private static DefaultFeatureType school(final int defaultGeometry) throws FactoryException {
-        final DefaultAttributeType<?> standardCRS = new DefaultAttributeType<CoordinateReferenceSystem>(
+        final DefaultAttributeType<?> standardCRS = new DefaultAttributeType<>(
                 name(AttributeConvention.CRS_CHARACTERISTIC), CoordinateReferenceSystem.class, 1, 1, HardCodedCRS.WGS84_φλ);
 
-        final DefaultAttributeType<?> normalizedCRS = new DefaultAttributeType<CoordinateReferenceSystem>(
+        final DefaultAttributeType<?> normalizedCRS = new DefaultAttributeType<>(
                 name(AttributeConvention.CRS_CHARACTERISTIC), CoordinateReferenceSystem.class, 1, 1, HardCodedCRS.WGS84);
 
         final AbstractIdentifiedType[] attributes = {
-            new DefaultAttributeType<String> (name("name"),          String.class,  1, 1, null),
-            new DefaultAttributeType<Polygon>(name("classes"),       Polygon.class, 1, 1, null, standardCRS),
-            new DefaultAttributeType<Point>  (name("climbing wall"), Point.class,   1, 1, null, standardCRS),
-            new DefaultAttributeType<Polygon>(name("gymnasium"),     Polygon.class, 1, 1, null, normalizedCRS),
+            new DefaultAttributeType<>(name("name"),          String.class,  1, 1, null),
+            new DefaultAttributeType<>(name("classes"),       Polygon.class, 1, 1, null, standardCRS),
+            new DefaultAttributeType<>(name("climbing wall"), Point.class,   1, 1, null, standardCRS),
+            new DefaultAttributeType<>(name("gymnasium"),     Polygon.class, 1, 1, null, normalizedCRS),
             null,
             null
         };

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureMemoryBenchmark.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureMemoryBenchmark.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureMemoryBenchmark.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureMemoryBenchmark.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -68,13 +68,13 @@ public final class FeatureMemoryBenchmar
      * @param isSimple In the case of non-SIS implementation, whether we use simple features or complex features.
      */
     private FeatureMemoryBenchmark(final boolean useSIS, final boolean isSimple) {
-        features = new ArrayList<Object>(100000);
+        features = new ArrayList<>(100000);
         this.isSimple = isSimple;
         if (useSIS) {
-            type = new DefaultFeatureType           (singletonMap("name", "City"), false, null,
-                    new DefaultAttributeType<String>(singletonMap("name", "city"),     String.class, 1, 1, null),
-                    new DefaultAttributeType<Float> (singletonMap("name", "longitude"), Float.class, 1, 1, null),
-                    new DefaultAttributeType<Float> (singletonMap("name", "latitude"),  Float.class, 1, 1, null));
+            type = new DefaultFeatureType     (singletonMap("name", "City"), false, null,
+                    new DefaultAttributeType<>(singletonMap("name", "city"),     String.class, 1, 1, null),
+                    new DefaultAttributeType<>(singletonMap("name", "longitude"), Float.class, 1, 1, null),
+                    new DefaultAttributeType<>(singletonMap("name", "latitude"),  Float.class, 1, 1, null));
         } else {
             type = null;
         }
@@ -86,14 +86,14 @@ public final class FeatureMemoryBenchmar
      * The old feature implementation.
      */
     private static final class SimpleFeature {
-        final HashMap<String,Object> attributes = new HashMap<String,Object>(8);
+        final HashMap<String, Object> attributes = new HashMap<>(8);
     }
 
     /**
      * A more complete feature implementation.
      */
     private static final class ComplexFeature {
-        final HashMap<String, List<Property>> properties = new HashMap<String, List<Property>>(8);
+        final HashMap<String, List<Property>> properties = new HashMap<>(8);
     }
 
     /**
@@ -107,7 +107,7 @@ public final class FeatureMemoryBenchmar
         }
 
         static List<Property> asList(final Object value) {
-            final List<Property> list = new ArrayList<Property>(2);
+            final List<Property> list = new ArrayList<>(2);
             list.add(new Property(value));
             return list;
         }

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeatureTestCase.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -303,7 +303,7 @@ public abstract strictfp class FeatureTe
     public void testCustomAttribute() {
         feature = createFeature(DefaultFeatureTypeTest.city());
         final AbstractAttribute<String> wrong = SingletonAttributeTest.parliament();
-        final CustomAttribute<String> city = new CustomAttribute<String>(Features.cast(
+        final CustomAttribute<String> city = new CustomAttribute<>(Features.cast(
                 (DefaultAttributeType<?>) feature.getType().getProperty("city"), String.class));
 
         feature.setProperty(city);

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -41,7 +41,7 @@ public final strictfp class MultiValuedA
      * The cardinality is [0 … ∞].
      */
     static MultiValuedAttribute<String> universities() {
-        return new MultiValuedAttribute<String>(DefaultAttributeTypeTest.universities());
+        return new MultiValuedAttribute<>(DefaultAttributeTypeTest.universities());
     }
 
     /**
@@ -49,7 +49,7 @@ public final strictfp class MultiValuedA
      * This attribute has no default value.
      */
     private static MultiValuedAttribute<Integer> population() {
-        return new MultiValuedAttribute<Integer>(DefaultAttributeTypeTest.population(new HashMap<String,Object>(4)));
+        return new MultiValuedAttribute<>(DefaultAttributeTypeTest.population(new HashMap<String,Object>(4)));
     }
 
     /**
@@ -106,7 +106,7 @@ public final strictfp class MultiValuedA
     @Test
     @DependsOnMethod("testValue")
     public void testDefaultValue() {
-        final AbstractAttribute<String> attribute = new MultiValuedAttribute<String>(DefaultAttributeTypeTest.city());
+        final AbstractAttribute<String> attribute = new MultiValuedAttribute<>(DefaultAttributeTypeTest.city());
         assertEquals     ("value",                "Utopia",  attribute.getValue());
         assertArrayEquals("values", new String[] {"Utopia"}, attribute.getValues().toArray());
 

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/PropertySingletonTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/PropertySingletonTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/PropertySingletonTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/PropertySingletonTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -50,9 +50,9 @@ public final strictfp class PropertySing
      * Creates a new test case.
      */
     public PropertySingletonTest() {
-        attribute = new SingletonAttribute<Integer>(new DefaultAttributeType<Integer>(
+        attribute = new SingletonAttribute<>(new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, "test"), Integer.class, 0, 1, null));
-        singleton = new PropertySingleton<Integer>(attribute);
+        singleton = new PropertySingleton<>(attribute);
     }
 
     /**

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -49,7 +49,7 @@ public final strictfp class SingletonAtt
      * This attribute has a default value.
      */
     static SingletonAttribute<String> city() {
-        return new SingletonAttribute<String>(DefaultAttributeTypeTest.city());
+        return new SingletonAttribute<>(DefaultAttributeTypeTest.city());
     }
 
     /**
@@ -57,7 +57,7 @@ public final strictfp class SingletonAtt
      * This attribute has no default value.
      */
     static SingletonAttribute<Integer> population() {
-        return new SingletonAttribute<Integer>(DefaultAttributeTypeTest.population(new HashMap<String,Object>(4)));
+        return new SingletonAttribute<>(DefaultAttributeTypeTest.population(new HashMap<String,Object>(4)));
     }
 
     /**
@@ -65,7 +65,7 @@ public final strictfp class SingletonAtt
      * This applies only to features of type "Capital".
      */
     static SingletonAttribute<String> parliament() {
-        return new SingletonAttribute<String>(DefaultAttributeTypeTest.parliament());
+        return new SingletonAttribute<>(DefaultAttributeTypeTest.parliament());
     }
 
     /**

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/StringJoinOperationTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/StringJoinOperationTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/StringJoinOperationTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/StringJoinOperationTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -54,8 +54,8 @@ public final strictfp class StringJoinOp
      * @return The feature for a person.
      */
     private static DefaultFeatureType person() {
-        final AbstractIdentifiedType nameType = new DefaultAttributeType<String> (name("name"), String.class, 1, 1, null);
-        final AbstractIdentifiedType ageType  = new DefaultAttributeType<Integer>(name("age"), Integer.class, 1, 1, null);
+        final AbstractIdentifiedType nameType = new DefaultAttributeType<>(name("name"), String.class, 1, 1, null);
+        final AbstractIdentifiedType ageType  = new DefaultAttributeType<>(name("age"), Integer.class, 1, 1, null);
         final AbstractIdentifiedType cmpType  = FeatureOperations.compound(name("concat"), "/", "<<:", ":>>", nameType, ageType);
         return new DefaultFeatureType(name("person"), false, null, nameType, ageType, cmpType);
     }

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/internal/feature/AttributeConventionTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/internal/feature/AttributeConventionTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/internal/feature/AttributeConventionTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/internal/feature/AttributeConventionTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -57,10 +57,10 @@ public final strictfp class AttributeCon
         final Map<String,?> properties = Collections.singletonMap(DefaultAttributeType.NAME_KEY, "geometry");
 
         assertFalse("AttributeType<Integer>", AttributeConvention.isGeometryAttribute(
-                new DefaultAttributeType<Integer>(properties, Integer.class, 1, 1, null)));
+                new DefaultAttributeType<>(properties, Integer.class, 1, 1, null)));
 
         assertTrue("AttributeType<Point>", AttributeConvention.isGeometryAttribute(
-                new DefaultAttributeType<Point>(properties, Point.class, 1, 1, null)));
+                new DefaultAttributeType<>(properties, Point.class, 1, 1, null)));
     }
 
     /**
@@ -70,18 +70,18 @@ public final strictfp class AttributeCon
     @Test
     public void testGetCrsCharacteristic() {
         final Map<String,?> properties = Collections.singletonMap(DefaultAttributeType.NAME_KEY, "geometry");
-        DefaultAttributeType<Point> type = new DefaultAttributeType<Point>(properties, Point.class, 1, 1, null);
+        DefaultAttributeType<Point> type = new DefaultAttributeType<>(properties, Point.class, 1, 1, null);
         assertFalse("characterizedByCRS",  AttributeConvention.characterizedByCRS(type));
         assertNull("getCRSCharacteristic", AttributeConvention.getCRSCharacteristic(type.newInstance()));
         /*
          * Creates an attribute associated to an attribute (i.e. a "characteristic") for storing
          * the Coordinate Reference System of the "geometry" attribute. Then test again.
          */
-        final DefaultAttributeType<CoordinateReferenceSystem> characteristic = new DefaultAttributeType<CoordinateReferenceSystem>(
+        final DefaultAttributeType<CoordinateReferenceSystem> characteristic = new DefaultAttributeType<>(
                 Collections.singletonMap(DefaultAttributeType.NAME_KEY, AttributeConvention.CRS_CHARACTERISTIC),
                 CoordinateReferenceSystem.class, 1, 1, HardCodedCRS.WGS84);
 
-        type = new DefaultAttributeType<Point>(properties, Point.class, 1, 1, null, characteristic);
+        type = new DefaultAttributeType<>(properties, Point.class, 1, 1, null, characteristic);
         assertTrue("characterizedByCRS", AttributeConvention.characterizedByCRS(type));
         assertEquals(HardCodedCRS.WGS84, AttributeConvention.getCRSCharacteristic(type.newInstance()));
     }
@@ -93,18 +93,18 @@ public final strictfp class AttributeCon
     @Test
     public void testGetMaximalLengthCharacteristic() {
         final Map<String,?> properties = Collections.singletonMap(DefaultAttributeType.NAME_KEY, "name");
-        DefaultAttributeType<String> type = new DefaultAttributeType<String>(properties, String.class, 1, 1, null);
+        DefaultAttributeType<String> type = new DefaultAttributeType<>(properties, String.class, 1, 1, null);
         assertFalse("characterizedByMaximalLength",  AttributeConvention.characterizedByMaximalLength(type));
         assertNull("getMaximalLengthCharacteristic", AttributeConvention.getMaximalLengthCharacteristic(type.newInstance()));
         /*
          * Creates an attribute associated to an attribute (i.e. a "characteristic") for storing
          * the maximal length of the "name" attribute. Then test again.
          */
-        final DefaultAttributeType<Integer> characteristic = new DefaultAttributeType<Integer>(
+        final DefaultAttributeType<Integer> characteristic = new DefaultAttributeType<>(
                 Collections.singletonMap(DefaultAttributeType.NAME_KEY, AttributeConvention.MAXIMAL_LENGTH_CHARACTERISTIC),
                 Integer.class, 1, 1, 120);
 
-        type = new DefaultAttributeType<String>(properties, String.class, 1, 1, null, characteristic);
+        type = new DefaultAttributeType<>(properties, String.class, 1, 1, null, characteristic);
         assertTrue("characterizedByMaximalLength", AttributeConvention.characterizedByMaximalLength(type));
         assertEquals(Integer.valueOf(120), AttributeConvention.getMaximalLengthCharacteristic(type.newInstance()));
     }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/PT_Locale.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -134,7 +134,7 @@ public final class PT_Locale extends Xml
             final String encoding;
             try {
                 encoding = (String) marshaller.getProperty(Marshaller.JAXB_ENCODING);
-            } catch (Exception e) { // (PropertyException | ClassCastException) on the JDK7 branch.
+            } catch (PropertyException | ClassCastException e) {
                 // Should never happen. But if it happen anyway, just let the
                 // characterEncoding unitialized: it will not be marshalled.
                 Context.warningOccured(Context.current(), PT_Locale.class, "beforeMarshal", e, true);

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/geometry/ObjectFactory.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -59,7 +59,7 @@ public class ObjectFactory {
      */
     @XmlElementDecl(name = "AbstractObject", namespace = Namespaces.GML)
     public JAXBElement<Object> createObject(final Object value) {
-        return new JAXBElement<Object>(AbstractObject_QNAME, Object.class, null, value);
+        return new JAXBElement<>(AbstractObject_QNAME, Object.class, null, value);
     }
 
     /**
@@ -77,7 +77,7 @@ public class ObjectFactory {
             substitutionHeadName = "AbstractObject",
             substitutionHeadNamespace = Namespaces.GML) // Not necessary according javadoc, but appears to be in practice (JAXB 2.1 bug?)
     public JAXBElement<Object> createAbstractGML(final Object value) {
-        return new JAXBElement<Object>(AbstractGML_QNAME, Object.class, null, value);
+        return new JAXBElement<>(AbstractGML_QNAME, Object.class, null, value);
     }
 
     /**
@@ -95,6 +95,6 @@ public class ObjectFactory {
             substitutionHeadName = "AbstractGML",
             substitutionHeadNamespace = Namespaces.GML) // Not necessary according javadoc, but appears to be in practice (JAXB 2.1 bug?)
     public JAXBElement<Object> createAbstractGeometry(final Object value) {
-        return new JAXBElement<Object>(AbstractGeometry_QNAME, Object.class, null, value);
+        return new JAXBElement<>(AbstractGeometry_QNAME, Object.class, null, value);
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -24,7 +24,7 @@ import org.apache.sis.internal.simple.Si
 import org.apache.sis.util.ComparisonMode;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -42,7 +42,7 @@ import static org.apache.sis.internal.ut
 import static org.apache.sis.internal.jaxb.gco.PropertyType.LEGACY_XML;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -100,7 +100,7 @@ public final class AxisDirections extend
      * For each direction, the opposite direction.
      * This map shall be immutable after construction.
      */
-    private static final Map<AxisDirection,AxisDirection> OPPOSITES = new HashMap<AxisDirection,AxisDirection>(20);
+    private static final Map<AxisDirection,AxisDirection> OPPOSITES = new HashMap<>(20);
     static {
         put(OTHER,             OTHER);
         put(NORTH,             SOUTH);
@@ -132,7 +132,7 @@ public final class AxisDirections extend
      * Proposed abbreviations for some axis directions.
      * This map shall be immutable after construction.
      */
-    private static final Map<AxisDirection,String> ABBREVIATIONS = new HashMap<AxisDirection,String>(12);
+    private static final Map<AxisDirection,String> ABBREVIATIONS = new HashMap<>(12);
     static {
         final Map<AxisDirection,String> m = ABBREVIATIONS;
         m.put(FUTURE,            "t");

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -145,7 +145,7 @@ public final class AxisNames {
      */
     private static final Map<String,String> VALUES;
     static {
-        final Map<String,String> values = new HashMap<String,String>(22);
+        final Map<String,String> values = new HashMap<>(22);    // 18 elements + 25%, rounded to highest integer.
         final StringBuilder buffer = new StringBuilder(22);     // Length of the longuest string: "Gravity-related height"
         try {
             for (final Field f : AxisNames.class.getFields()) {

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ExcludedSet.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ExcludedSet.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ExcludedSet.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ExcludedSet.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -86,7 +86,7 @@ public final class ExcludedSet<E> extend
      */
     @Override
     public Iterator<E> iterator() {
-        return Collections.<E>emptySet().iterator();
+        return Collections.emptyIterator();
     }
 
     /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -27,7 +27,7 @@ import org.apache.sis.util.resources.Mes
 import org.apache.sis.util.ArgumentChecks;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -114,7 +114,7 @@ public final class NameMeaning extends S
      *
      * @since 0.7
      */
-    private static final Map<String,String> AUTHORITIES = new HashMap<String,String>(12);
+    private static final Map<String,String> AUTHORITIES = new HashMap<>(12);
     static {
         add(Constants.EPSG);    // IOGP
         add(Constants.OGC);     // Open Geospatial Consortium

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameToIdentifier.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -32,7 +32,7 @@ import static org.apache.sis.util.Argume
 import static org.apache.sis.util.Characters.Filter.LETTERS_AND_DIGITS;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/OtherLocales.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -133,7 +133,7 @@ public final class OtherLocales extends
         if (Containers.isNullOrEmpty(otherLocales)) {
             merged = LegacyPropertyAdapter.asCollection(defaultLocale);
         } else {
-            merged = new ArrayList<Locale>(otherLocales.size() + 1);
+            merged = new ArrayList<>(otherLocales.size() + 1);
             if (defaultLocale == null) {
                 defaultLocale = Locale.getDefault();
                 if (otherLocales.contains(defaultLocale)) {
@@ -180,7 +180,7 @@ public final class OtherLocales extends
             values.add(newValue);
         } else {
             if (!(values instanceof List<?>)) {
-                values = new ArrayList<T>(values);
+                values = new ArrayList<>(values);
             }
             ((List<T>) values).set(0, newValue);
         }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/SensorType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/SensorType.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/SensorType.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/SensorType.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -44,7 +44,7 @@ public final class SensorType extends Co
      * List of all enumerations of this type.
      * Must be declared before any enum declaration.
      */
-    private static final List<SensorType> VALUES = new ArrayList<SensorType>();
+    private static final List<SensorType> VALUES = new ArrayList<>();
 
     /**
      * The sensor is a radiometer.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -93,8 +93,8 @@ public final class ServicesForUtility ex
         CharSequence     citedResponsibleParty = null;
         PresentationForm presentationForm      = null;
         Citation[]       copyFrom              = null;      // Copy citedResponsibleParty from those citations.
-        { // This is a switch(String) on the JDK7 branch
-            if (key.equals("ISO 19115-1")) {
+        switch (key) {
+            case "ISO 19115-1": {
                 title     = "Geographic Information — Metadata Part 1: Fundamentals";
                 edition   = "ISO 19115-1:2014(E)";
                 code      = "19115-1";
@@ -102,7 +102,9 @@ public final class ServicesForUtility ex
                 version   = "2014(E)";
                 citedResponsibleParty = "International Organization for Standardization";
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
-            } else if (key.equals("ISO 19115-2")) {
+                break;
+            }
+            case "ISO 19115-2": {
                 title     = "Geographic Information — Metadata Part 2: Extensions for imagery and gridded data";
                 edition   = "ISO 19115-2:2009(E)";
                 code      = "19115-2";
@@ -110,7 +112,9 @@ public final class ServicesForUtility ex
                 version   = "2009(E)";
                 copyFrom  = new Citation[] {Citations.ISO_19115.get(0)};
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
-            } else if (key.equals("WMS")) {
+                break;
+            }
+            case "WMS": {
                 title                = "Web Map Server";                                      // OGC title
                 alternateTitle       = "Geographic Information — Web map server interface";   // ISO title
                 alternateIdentifiers = new Identifier[] {
@@ -122,17 +126,23 @@ public final class ServicesForUtility ex
                 codeSpace        = "OGC";
                 copyFrom         = new Citation[] {Citations.OGC, Citations.ISO_19115.get(0)};
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
-            } else if (key.equals(Constants.OGC)) {
+                break;
+            }
+            case Constants.OGC: {
                 title = "Identifiers in OGC namespace";
                 code = Constants.OGC;
                 citedResponsibleParty = "Open Geospatial Consortium";
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
-            } else if (key.equals(Constants.IOGP)) {                    // Not in public API (see Citations.IOGP javadoc)
+                break;
+            }
+            case Constants.IOGP: {                                      // Not in public API (see Citations.IOGP javadoc)
                 title = "Using the EPSG Geodetic Parameter Dataset";    // Geomatics Guidance Note number 7, part 1
                 code = Constants.IOGP;
                 copyFrom = new Citation[] {Citations.EPSG};
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
-            } else if (key.equals(Constants.EPSG)) {
+                break;
+            }
+            case Constants.EPSG: {
                 title     = "EPSG Geodetic Parameter Dataset";
                 code      = Constants.EPSG;
                 codeSpace = Constants.IOGP;
@@ -145,22 +155,32 @@ public final class ServicesForUtility ex
                  * After we moved the content of this citation in a database,
                  * EPSGDataAccess.getAuthority() should use this citation as a template.
                  */
-            } else if (key.equals(Constants.SIS)) {
+                break;
+            }
+            case Constants.SIS: {
                 title = "Apache Spatial Information System";
                 code  = key;
-            } else if (key.equals("ISBN")) {
+                break;
+            }
+            case "ISBN": {
                 title = "International Standard Book Number";
                 alternateTitle = key;
-            } else if (key.equals("ISSN")) {
+                break;
+            }
+            case "ISSN": {
                 title = "International Standard Serial Number";
                 alternateTitle = key;
-            } else if (key.equals("Proj4")) {
+                break;
+            }
+            case "Proj4": {
                 title = "Proj.4";
-            } else if (key.equals("S57")) {
+                break;
+            }
+            case "S57": {
                 title = "S-57";
-            } else {
-                return super.createCitation(key);
+                break;
             }
+            default: return super.createCitation(key);
         }
         /*
          * Do not use the 'c.getFoo().add(foo)' pattern below. Use the 'c.setFoo(singleton(foo))' pattern instead.
@@ -206,8 +226,8 @@ public final class ServicesForUtility ex
      */
     @Override
     public String getInformation(final String key, final Locale locale) {
-        /* switch (key) */ {
-            if (key.equals("DataSource")) {
+        switch (key) {
+            case "DataSource": {
                 Object server = null, database = null;
                 try {
                     final DataSource ds = Initializer.getDataSource();

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -55,8 +55,7 @@ public final class TransformationAccurac
     /**
      * Cache the positional accuracies. Most coordinate operation use a small set of accuracy values.
      */
-    private static final WeakValueHashMap<Double,PositionalAccuracy> CACHE =
-            new WeakValueHashMap<Double,PositionalAccuracy>(Double.class);
+    private static final WeakValueHashMap<Double,PositionalAccuracy> CACHE = new WeakValueHashMap<>(Double.class);
 
     /**
      * Do not allow instantiation of this class.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -45,9 +45,9 @@ import org.apache.sis.util.logging.Loggi
 
 // Branch-dependent imports
 import java.util.concurrent.Callable;
-import org.apache.sis.internal.jdk7.Files;
-import org.apache.sis.internal.jdk7.Path;
-import org.apache.sis.internal.jdk7.Paths;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 
 
 /**
@@ -261,7 +261,7 @@ public abstract class Initializer {
                      * of encoding issues if the path contains spaces or non-ASCII characters.
                      */
                     path = Paths.get(home).relativize(path);
-                } catch (Exception e) {     // (IllegalArgumentException | SecurityException e) on the JDK7 branch.
+                } catch (IllegalArgumentException | SecurityException e) {
                     // The path can not be relativized. This is okay.
                     Logging.recoverableException(Logging.getLogger(Loggers.SQL), Initializer.class, "getDataSource", e);
                 }
@@ -284,7 +284,7 @@ public abstract class Initializer {
              * it properly if the schemas creation below fail.
              */
             Shutdown.register(new Callable<Object>() {
-                @Override public Object call() throws Exception {
+                @Override public Object call() throws ReflectiveOperationException {
                     shutdown();
                     return null;
                 }
@@ -297,13 +297,11 @@ public abstract class Initializer {
             if (create) {
                 final Method m = source.getClass().getMethod("setCreateDatabase", String.class);
                 m.invoke(source, "create");
-                Connection c = source.getConnection();
-                try {
+                try (Connection c = source.getConnection()) {
                     for (Initializer init : DefaultFactories.createServiceLoader(Initializer.class)) {
                         init.createSchema(c);
                     }
                 } finally {
-                    c.close();
                     m.invoke(source, "no");     // Any value other than "create".
                 }
             }
@@ -405,7 +403,7 @@ public abstract class Initializer {
      * @throws ReflectiveOperationException if an error occurred while
      *         setting the shutdown property on the Derby data source.
      */
-    private static synchronized void shutdown() throws Exception {
+    private static synchronized void shutdown() throws ReflectiveOperationException {
         final DataSource ds = source;
         if (ds != null) {                       // Should never be null, but let be safe.
             source = null;                      // Clear now in case of failure in remaining code.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -36,7 +36,6 @@ import org.apache.sis.util.resources.Err
 // Branch-specific imports
 import org.apache.sis.internal.jdk8.JDK8;
 import org.apache.sis.internal.jdk8.BiFunction;
-import org.apache.sis.internal.jdk7.AutoCloseable;
 
 
 /**
@@ -55,8 +54,7 @@ import org.apache.sis.internal.jdk7.Auto
  * @version 0.7
  * @module
  */
-@AutoCloseable
-public class ScriptRunner {
+public class ScriptRunner implements AutoCloseable {
     /**
      * The database user having read (not write) permissions.
      *
@@ -109,7 +107,7 @@ public class ScriptRunner {
      *
      * @see #replace(String, String)
      */
-    private final Map<String,String> replacements = new HashMap<String,String>();
+    private final Map<String,String> replacements = new HashMap<>();
 
     /**
      * A sentinel value for the {@linkplain #replace replacements} map meaning that {@code ScriptRunner}
@@ -604,6 +602,7 @@ parseLine:  while (pos < length) {
      *
      * @throws SQLException If an error occurred while closing the statement.
      */
+    @Override
     public void close() throws SQLException {
         statement.close();
     }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -179,7 +179,7 @@ abstract class AbstractParser implements
             this.numberFormat = numberFormat;
             exponentSymbol = null;
         }
-        ignoredElements = new LinkedHashMap<String, List<String>>();
+        ignoredElements = new LinkedHashMap<>();
     }
 
     /**
@@ -348,6 +348,7 @@ abstract class AbstractParser implements
             try {
                 return Units.valueOf(text);
             } catch (IllegalArgumentException e2) {
+                e.addSuppressed(e2);
                 throw e;
             }
         }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -104,7 +104,7 @@ public class Colors implements Cloneable
      * Creates a new, initially empty, set of colors.
      */
     public Colors() {
-        map = new EnumMap<ElementKind,X364>(ElementKind.class);
+        map = new EnumMap<>(ElementKind.class);
     }
 
     /**
@@ -113,7 +113,7 @@ public class Colors implements Cloneable
      * @param colors The set of colors to copy.
      */
     public Colors(final Colors colors) {
-        map = new EnumMap<ElementKind,X364>(colors.map);
+        map = new EnumMap<>(colors.map);
     }
 
     /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -41,7 +41,6 @@ import static org.apache.sis.util.CharSe
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.JDK8;
-import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**
@@ -124,7 +123,7 @@ final class Element implements Serializa
         keyword = name;
         offset  = singleton.offset;
         locale  = singleton.locale;
-        list    = new LinkedList<Object>();                     // Needs to be a modifiable list.
+        list    = new LinkedList<>();                           // Needs to be a modifiable list.
         list.add(singleton);
     }
 
@@ -135,7 +134,7 @@ final class Element implements Serializa
         keyword = toCopy.keyword;
         offset  = toCopy.offset;
         locale  = toCopy.locale;
-        list    = new LinkedList<Object>(toCopy.list);          // Needs to be a modifiable list.
+        list    = new LinkedList<>(toCopy.list);                // Needs to be a modifiable list.
         final ListIterator<Object> it = list.listIterator();
         while (it.hasNext()) {
             final Object value = it.next();
@@ -220,7 +219,7 @@ final class Element implements Serializa
          *   - Otherwise, if the first character is a quote, then the value is taken as a String.
          *   - Otherwise, the element is parsed as a number or as a date, depending of 'isTemporal' boolean value.
          */
-        final List<Object> list = new LinkedList<Object>();
+        final List<Object> list = new LinkedList<>();
         final String separator = parser.symbols.trimmedSeparator();
         while (lower < length) {
             final int firstChar = text.codePointAt(lower);
@@ -777,7 +776,7 @@ final class Element implements Serializa
     @Override
     public String toString() {
         final StringBuilder buffer = new StringBuilder();
-        format(buffer, 0, JDK7.lineSeparator());
+        format(buffer, 0, System.lineSeparator());
         return buffer.toString();
     }
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -82,7 +82,7 @@ public abstract class FormattableObject
      * Since {@code toString()} is typically invoked for debugging purpose, a single formatter for
      * any thread is presumed sufficient.</div>
      */
-    private static final AtomicReference<Formatter> FORMATTER = new AtomicReference<Formatter>();
+    private static final AtomicReference<Formatter> FORMATTER = new AtomicReference<>();
 
     /**
      * Default constructor.

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -83,9 +83,6 @@ import org.apache.sis.measure.Measuremen
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.apache.sis.metadata.iso.extent.Extents;
 
-// Branch-specific imports
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Provides support methods for formatting a <cite>Well Known Text</cite> (WKT).
@@ -198,7 +195,7 @@ public class Formatter implements Locali
      *
      * @see #getEnclosingElement(int)
      */
-    private final List<FormattableObject> enclosingElements = new ArrayList<FormattableObject>();
+    private final List<FormattableObject> enclosingElements = new ArrayList<>();
 
     /**
      * The contextual units for writing lengths, angles or other type of measurements.
@@ -209,7 +206,7 @@ public class Formatter implements Locali
      * @see #addContextualUnit(Unit)
      * @see #toContextualUnit(Unit)
      */
-    private final Map<Unit<?>, Unit<?>> units = new HashMap<Unit<?>, Unit<?>>(4);
+    private final Map<Unit<?>, Unit<?>> units = new HashMap<>(4);
 
     /**
      * A bits mask of elements which defined a contextual units.
@@ -341,7 +338,7 @@ public class Formatter implements Locali
         ArgumentChecks.ensureNonNull("convention",  convention);
         ArgumentChecks.ensureNonNull("symbols",     symbols);
         ArgumentChecks.ensureBetween("indentation", WKTFormat.SINGLE_LINE, Byte.MAX_VALUE, indentation);
-        this.locale        = Locale.getDefault();
+        this.locale        = Locale.getDefault(Locale.Category.DISPLAY);
         this.convention    = convention;
         this.authority     = convention.getNameAuthority();
         this.symbols       = symbols.immutable();
@@ -562,7 +559,7 @@ public class Formatter implements Locali
                 buffer.append(symbols.getSeparator());
             }
         } else if (requestNewLine) {
-            buffer.append(JDK7.lineSeparator()).append(CharSequences.spaces(margin));
+            buffer.append(System.lineSeparator()).append(CharSequences.spaces(margin));
         }
         requestNewLine = false;
     }
@@ -1618,7 +1615,7 @@ public class Formatter implements Locali
         final Warnings warnings = this.warnings;                    // Protect against accidental changes.
         if (warnings != null) {
             final StringBuffer buffer = this.buffer;
-            final String ln = JDK7.lineSeparator();
+            final String ln = System.lineSeparator();
             buffer.append(ln).append(ln);
             if (colors != null) {
                 buffer.append(X364.BACKGROUND_RED.sequence()).append(X364.BOLD.sequence()).append(' ');
@@ -1629,7 +1626,7 @@ public class Formatter implements Locali
             }
             buffer.append(ln);
             final int n = warnings.getNumMessages();
-            final Set<String> done = new HashSet<String>();
+            final Set<String> done = new HashSet<>();
             for (int i=0; i<n; i++) {
                 String message = Exceptions.getLocalizedMessage(warnings.getException(i), locale);
                 if (message == null) {

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -161,12 +161,12 @@ class GeodeticObjectParser extends MathT
      * A map of properties to be given to the factory constructor methods.
      * This map will be recycled for each object to be parsed.
      */
-    private final Map<String,Object> properties = new HashMap<String,Object>(4);
+    private final Map<String,Object> properties = new HashMap<>(4);
 
     /**
      * Order of coordinate system axes. Used only if {@code AXIS[…]} elements contain {@code ORDER[…]} sub-element.
      */
-    private final Map<CoordinateSystemAxis,Integer> axisOrder = new IdentityHashMap<CoordinateSystemAxis,Integer>(4);
+    private final Map<CoordinateSystemAxis,Integer> axisOrder = new IdentityHashMap<>(4);
 
     /**
      * The last vertical CRS found during the parsing, or {@code null} if none.
@@ -302,6 +302,7 @@ class GeodeticObjectParser extends MathT
                     verticalElements = verticalElements.complete(crsFactory, csFactory);
                 } catch (FactoryException e) {
                     if (ex == null) ex = e;
+                    else ex.addSuppressed(e);
                 }
                 if (verticalElements != null) {
                     warning(null, (String) null, Errors.formatInternational(Errors.Keys.CanNotAssignUnitToDimension_2,
@@ -661,9 +662,7 @@ class GeodeticObjectParser extends MathT
         if (verify == null) {
             try {
                 verify = parseUnit(name);
-            } catch (IllegalArgumentException e) {
-                log(new LogRecord(Level.FINE, e.toString()));
-            } catch (ParseException e) {
+            } catch (IllegalArgumentException | ParseException e) {
                 log(new LogRecord(Level.FINE, e.toString()));
             }
             if (verify != null) try {
@@ -736,7 +735,7 @@ class GeodeticObjectParser extends MathT
                 final String expected = type;
                 type         = element.pullVoidElement("type").keyword;
                 dimension    = element.pullInteger("dimension");
-                csProperties = new HashMap<String,Object>(parseMetadataAndClose(element, "CS", null));
+                csProperties = new HashMap<>(parseMetadataAndClose(element, "CS", null));
                 if (expected != null) {
                     if (!expected.equalsIgnoreCase(type)) {
                         throw new LocalizedParseException(errorLocale, Errors.Keys.UnexpectedValueInElement_2,
@@ -771,7 +770,7 @@ class GeodeticObjectParser extends MathT
         CoordinateSystemAxis[] axes = null;
         CoordinateSystemAxis axis = parseAxis(type == null ? MANDATORY : OPTIONAL, parent, type, defaultUnit);
         if (axis != null) {
-            final List<CoordinateSystemAxis> list = new ArrayList<CoordinateSystemAxis>(dimension + 2);
+            final List<CoordinateSystemAxis> list = new ArrayList<>(dimension + 2);
             do {
                 list.add(axis);
                 axis = parseAxis(list.size() < dimension ? MANDATORY : OPTIONAL, parent, type, defaultUnit);
@@ -797,12 +796,12 @@ class GeodeticObjectParser extends MathT
             AxisDirection dy = AxisDirection.NORTH;
             AxisDirection direction = null;                 // Depth, height or time axis direction.
             Unit<?> unit = defaultUnit;                     // Depth, height or time axis unit.
-            /*switch (type)*/ {
+            switch (type) {
                 /*
                  * Cartesian — we can create axes only for geodetic datum, in which case the axes are for
                  * two-dimensional Projected or three-dimensional Geocentric CRS.
                  */
-                if (type.equals(WKTKeywords.Cartesian)) {
+                case WKTKeywords.Cartesian: {
                     if (!(datum instanceof GeodeticDatum)) {
                         throw parent.missingComponent(WKTKeywords.Axis);
                     }
@@ -819,6 +818,7 @@ class GeodeticObjectParser extends MathT
                         nz   = AxisNames.ELLIPSOIDAL_HEIGHT;
                         unit = SI.METRE;
                     }
+                    break;
                 }
                 /*
                  * Ellipsoidal — can be two- or three- dimensional, in which case the height can
@@ -827,7 +827,7 @@ class GeodeticObjectParser extends MathT
                  *   - WKT 1 said explicitely that the default order is (longitude, latitude).
                  *   - WKT 2 has no default, and allows only (latitude, longitude) order.
                  */
-                else if (type.equals(WKTKeywords.ellipsoidal)) {
+                case WKTKeywords.ellipsoidal: {
                     if (defaultUnit == null) {
                         throw parent.missingComponent(WKTKeywords.AngleUnit);
                     }
@@ -844,12 +844,13 @@ class GeodeticObjectParser extends MathT
                         nz   = AxisNames.ELLIPSOIDAL_HEIGHT;
                         unit = SI.METRE;
                     }
+                    break;
                 }
                 /*
                  * Vertical — the default name and symbol depends on whether this is depth,
                  * geoidal height, ellipsoidal height (non-standard) or other kind of heights.
                  */
-                else if (type.equals(WKTKeywords.vertical)) {
+                case WKTKeywords.vertical: {
                     if (defaultUnit == null) {
                         throw parent.missingComponent(WKTKeywords.Unit);
                     }
@@ -871,33 +872,36 @@ class GeodeticObjectParser extends MathT
                             nz = AxisNames.ELLIPSOIDAL_HEIGHT;
                         }
                     }
+                    break;
                 }
                 /*
                  * Temporal — axis name and abbreviation not yet specified by ISO 19111.
                  */
-                else if (type.equals(WKTKeywords.temporal)) {
+                case WKTKeywords.temporal: {
                     if (defaultUnit == null) {
                         throw parent.missingComponent(WKTKeywords.TimeUnit);
                     }
                     direction = AxisDirection.FUTURE;
                     nz = "Time";
                     z = "t";
+                    break;
                 }
                 /*
                  * Parametric — axis name and abbreviation not yet specified by ISO 19111_2.
                  */
-                else if (type.equals(WKTKeywords.parametric)) {
+                case WKTKeywords.parametric: {
                     if (defaultUnit == null) {
                         throw parent.missingComponent(WKTKeywords.ParametricUnit);
                     }
                     direction = AxisDirection.OTHER;
                     nz = "Parametric";
                     z = "p";
+                    break;
                 }
                 /*
                  * Unknown CS type — we can not guess which axes to create.
                  */
-                else {
+                default: {
                     throw parent.missingComponent(WKTKeywords.Axis);
                 }
             }
@@ -933,64 +937,60 @@ class GeodeticObjectParser extends MathT
         /*
          * Finally, delegate to the factory method corresponding to the CS type and the number of axes.
          */
-        /*switch (type)*/ {
-            if (type.equals(WKTKeywords.ellipsoidal)) {
+        switch (type) {
+            case WKTKeywords.ellipsoidal: {
                 switch (axes.length) {
                     case 2: return csFactory.createEllipsoidalCS(csProperties, axes[0], axes[1]);
                     case 3: return csFactory.createEllipsoidalCS(csProperties, axes[0], axes[1], axes[2]);
                 }
                 dimension = (axes.length < 2) ? 2 : 3;                      // For error message.
+                break;
             }
-            else if (type.equals(WKTKeywords.Cartesian)) {
+            case WKTKeywords.Cartesian: {
                 switch (axes.length) {
                     case 2: return csFactory.createCartesianCS(csProperties, axes[0], axes[1]);
                     case 3: return csFactory.createCartesianCS(csProperties, axes[0], axes[1], axes[2]);
                 }
                 dimension = (axes.length < 2) ? 2 : 3;                      // For error message.
+                break;
             }
-            else if (type.equals(WKTKeywords.affine)) {
+            case WKTKeywords.affine: {
                 switch (axes.length) {
                     case 2: return csFactory.createAffineCS(csProperties, axes[0], axes[1]);
                     case 3: return csFactory.createAffineCS(csProperties, axes[0], axes[1], axes[2]);
                 }
                 dimension = (axes.length < 2) ? 2 : 3;                      // For error message.
+                break;
             }
-            else if (type.equals(WKTKeywords.vertical)) {
-                if (axes.length == (dimension = 1)) {
-                    return csFactory.createVerticalCS(csProperties, axes[0]);
-                }
-            }
-            else if (type.equals(WKTKeywords.temporal)) {
-                if (axes.length == (dimension = 1)) {
-                    return csFactory.createTimeCS(csProperties, axes[0]);
-                }
-            }
-            else if (type.equals(WKTKeywords.linear)) {
-                if (axes.length == (dimension = 1)) {
-                    return csFactory.createLinearCS(csProperties, axes[0]);
-                }
-            }
-            else if (type.equals(WKTKeywords.polar)) {
-                if (axes.length == (dimension = 2)) {
-                    return csFactory.createPolarCS(csProperties, axes[0], axes[1]);
-                }
-            }
-            else if (type.equals(WKTKeywords.cylindrical)) {
-                if (axes.length == (dimension = 3)) {
-                    return csFactory.createCylindricalCS(csProperties, axes[0], axes[1], axes[2]);
-                }
-            }
-            else if (type.equals(WKTKeywords.spherical)) {
-                if (axes.length == (dimension = 3)) {
-                    return csFactory.createSphericalCS(csProperties, axes[0], axes[1], axes[2]);
-                }
-            }
-            else if (type.equals(WKTKeywords.parametric)) {
-                if (axes.length == (dimension = 1)) {
-                    return referencing.createParametricCS(csProperties, axes[0], csFactory);
-                }
+            case WKTKeywords.vertical: {
+                if (axes.length != (dimension = 1)) break;
+                return csFactory.createVerticalCS(csProperties, axes[0]);
+            }
+            case WKTKeywords.temporal: {
+                if (axes.length != (dimension = 1)) break;
+                return csFactory.createTimeCS(csProperties, axes[0]);
+            }
+            case WKTKeywords.linear: {
+                if (axes.length != (dimension = 1)) break;
+                return csFactory.createLinearCS(csProperties, axes[0]);
+            }
+            case WKTKeywords.polar: {
+                if (axes.length != (dimension = 2)) break;
+                return csFactory.createPolarCS(csProperties, axes[0], axes[1]);
+            }
+            case WKTKeywords.cylindrical: {
+                if (axes.length != (dimension = 3)) break;
+                return csFactory.createCylindricalCS(csProperties, axes[0], axes[1], axes[2]);
+            }
+            case WKTKeywords.spherical: {
+                if (axes.length != (dimension = 3)) break;
+                return csFactory.createSphericalCS(csProperties, axes[0], axes[1], axes[2]);
+            }
+            case WKTKeywords.parametric: {
+                if (axes.length != (dimension = 1)) break;
+                return referencing.createParametricCS(csProperties, axes[0], csFactory);
             }
-            else {
+            default: {
                 warning(parent, WKTKeywords.CS, Errors.formatInternational(Errors.Keys.UnknownType_1, type), null);
                 return referencing.createAbstractCS(csProperties, axes);
             }
@@ -1301,7 +1301,7 @@ class GeodeticObjectParser extends MathT
             return referencing.getOperationMethod(opFactory, mtFactory, name);
         } catch (FactoryException e) {
             if (suppressed != null) {
-//              e.addSuppressed(suppressed);    // Not available on JDK6.
+                e.addSuppressed(suppressed);
             }
             throw element.parseFailed(e);
         }
@@ -2177,7 +2177,7 @@ class GeodeticObjectParser extends MathT
         }
         final String  name = element.pullString("name");
         CoordinateReferenceSystem crs;
-        final List<CoordinateReferenceSystem> components = new ArrayList<CoordinateReferenceSystem>(4);
+        final List<CoordinateReferenceSystem> components = new ArrayList<>(4);
         while ((crs = parseCoordinateReferenceSystem(element, components.size() < 2)) != null) {
             components.add(crs);
         }
@@ -2241,9 +2241,7 @@ class GeodeticObjectParser extends MathT
              */
             properties.put("conversion.name", name);
             return referencing.createDerivedCRS(properties, (SingleCRS) baseCRS, method, toBase.inverse(), derivedCS);
-        } catch (FactoryException exception) {
-            throw element.parseFailed(exception);
-        } catch (NoninvertibleTransformException exception) {
+        } catch (FactoryException | NoninvertibleTransformException exception) {
             throw element.parseFailed(exception);
         }
     }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -27,9 +27,6 @@ import org.apache.sis.util.resources.Err
 
 import static org.apache.sis.util.ArgumentChecks.*;
 
-// Related to JDK7
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * The set of symbols to use for <cite>Well Known Text</cite> (WKT) parsing and formatting.
@@ -256,7 +253,7 @@ public class Symbols implements Localize
      *
      * @return The locale for dates and numbers.
      *
-     * @see WKTFormat#getLocale()
+     * @see WKTFormat#getLocale(Locale.Category)
      */
     @Override
     public final Locale getLocale() {
@@ -545,7 +542,7 @@ public class Symbols implements Localize
     final String lineSeparator() {
         final String separator = getSeparator();
         return separator.substring(0, CharSequences.skipTrailingWhitespaces(separator, 0, separator.length()))
-                .concat(JDK7.lineSeparator());
+                .concat(System.lineSeparator());
     }
 
     /**

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -114,7 +114,7 @@ public abstract class Transliterator imp
      */
     private static final Map<AxisDirection,String> CARTESIAN;
     static {
-        final Map<AxisDirection,String> m = new HashMap<AxisDirection,String>(12);
+        final Map<AxisDirection,String> m = new HashMap<>(12);
         m.put(AxisDirection.EAST,         AxisNames.EASTING);
         m.put(AxisDirection.WEST,         AxisNames.WESTING);
         m.put(AxisDirection.NORTH,        AxisNames.NORTHING);
@@ -263,22 +263,25 @@ public abstract class Transliterator imp
      * @return The axis name to use. Can not be null.
      */
     public String toLongAxisName(final String csType, final AxisDirection direction, final String name) {
-        if (csType != null) /*switch (csType)*/ {
-            if (csType.equals(WKTKeywords.ellipsoidal)) {
+        if (csType != null) switch (csType) {
+            case WKTKeywords.ellipsoidal: {
                 if (isLatLong(AxisNames.LATITUDE,  name)) return AxisNames.GEODETIC_LATITUDE;
                 if (isLatLong(AxisNames.LONGITUDE, name)) return AxisNames.GEODETIC_LONGITUDE;
+                break;
             }
-            else if (csType.equals(WKTKeywords.spherical)) {
+            case WKTKeywords.spherical: {
                 if (isLatLong(AxisNames.LATITUDE,  name)) return AxisNames.SPHERICAL_LATITUDE;
                 if (isLatLong(AxisNames.LONGITUDE, name)) return AxisNames.SPHERICAL_LONGITUDE;
+                break;
             }
-            else if (csType.equals(WKTKeywords.Cartesian)) {
+            case WKTKeywords.Cartesian: {
                 if (name.length() <= 1) {
                     final String c = CARTESIAN.get(direction);
                     if (c != null) {
                         return c;
                     }
                 }
+                break;
             }
         }
         return AxisNames.toCamelCase(name);

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -253,7 +253,7 @@ public class WKTFormat extends CompoundF
     @SuppressWarnings("ReturnOfCollectionOrArrayField")
     private Map<String,Element> fragments() {
         if (fragments == null) {
-            fragments = new TreeMap<String,Element>();
+            fragments = new TreeMap<>();
         }
         return fragments;
     }
@@ -264,12 +264,33 @@ public class WKTFormat extends CompoundF
     @SuppressWarnings("ReturnOfCollectionOrArrayField")
     private Map<Class<?>,Factory> factories() {
         if (factories == null) {
-            factories = new HashMap<Class<?>,Factory>(8);
+            factories = new HashMap<>(8);
         }
         return factories;
     }
 
     /**
+     * Returns the locale for the given category. This method implements the following mapping:
+     *
+     * <ul>
+     *   <li>{@link java.util.Locale.Category#FORMAT}: the value of {@link Symbols#getLocale()},
+     *       normally fixed to {@link Locale#ROOT}, used for number formatting.</li>
+     *   <li>{@link java.util.Locale.Category#DISPLAY}: the {@code locale} given at construction time,
+     *       used for {@link InternationalString} localization.</li>
+     * </ul>
+     *
+     * @param  category The category for which a locale is desired.
+     * @return The locale for the given category (never {@code null}).
+     */
+    @Override
+    public Locale getLocale(final Locale.Category category) {
+        if (category == Locale.Category.FORMAT) {
+            return symbols.getLocale();
+        }
+        return super.getLocale(category);
+    }
+
+    /**
      * Returns the symbols used for parsing and formatting WKT.
      *
      * @return The current set of symbols used for parsing and formatting WKT.
@@ -660,7 +681,7 @@ public class WKTFormat extends CompoundF
         short error = Errors.Keys.NotAUnicodeIdentifier_1;
         if (CharSequences.isUnicodeIdentifier(name)) {
             if (sharedValues == null) {
-                sharedValues = new HashMap<Object,Object>();
+                sharedValues = new HashMap<>();
             }
             final ParsePosition pos = new ParsePosition(0);
             final Element element = new Element(parser(), wkt, pos, sharedValues);

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -37,9 +37,6 @@ import org.apache.sis.util.resources.Err
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.util.resources.Vocabulary;
 
-// Branch-specific imports
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Warnings that occurred during a <cite>Well Known Text</cite> (WKT) parsing or formatting.
@@ -188,13 +185,13 @@ public final class Warnings implements L
     final void add(final InternationalString message, final Exception cause, final String[] source) {
         assert (message != null) || (cause != null);
         if (messages == null) {
-            messages = new ArrayList<Object>(4);                                    // We expect few items.
+            messages = new ArrayList<>(4);                          // We expect few items.
         }
         messages.add(message);
         messages.add(cause);
         if (cause != null) {
             if (exceptionSources == null) {
-                exceptionSources = new LinkedHashMap<Exception, String[]>(4);       // We expect few items.
+                exceptionSources = new LinkedHashMap<>(4);          // We expect few items.
             }
             exceptionSources.put(cause, source);
         }
@@ -208,7 +205,7 @@ public final class Warnings implements L
         if (!published) {
             ignoredElements = ignoredElements.isEmpty()
                     ? Collections.<String, List<String>>emptyMap()
-                    : new LinkedHashMap<String, List<String>>(ignoredElements);
+                    : new LinkedHashMap<>(ignoredElements);
             published = true;
         }
     }
@@ -351,7 +348,7 @@ public final class Warnings implements L
      */
     public String toString(final Locale locale) {
         final StringBuilder buffer = new StringBuilder(250);
-        final String lineSeparator = JDK7.lineSeparator();
+        final String lineSeparator = System.lineSeparator();
         final Messages resources   = Messages.getResources(locale);
         buffer.append(resources.getString(isParsing ? Messages.Keys.IncompleteParsing_1
                                                     : Messages.Keys.NonConformFormatting_1, root));

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -146,7 +146,7 @@ final class Cloner extends org.apache.si
          *          by their unmodifiable variant. The keys are assumed already immutable.
          */
         if (object instanceof Map<?,?>) {
-            final Map<Object,Object> map = new LinkedHashMap<Object,Object>((Map<?,?>) object);
+            final Map<Object,Object> map = new LinkedHashMap<>((Map<?,?>) object);
             for (final Iterator<Map.Entry<Object,Object>> it=map.entrySet().iterator(); it.hasNext();) {
                 final Map.Entry<Object,Object> entry = it.next();
                 entry.setValue(clone(entry.getValue()));

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/InformationMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/InformationMap.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/InformationMap.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/InformationMap.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -70,7 +70,7 @@ final class InformationMap extends Prope
                     // PropertyAccessor.information(int) never return null if the index is valid.
                     throw new NoSuchElementException();
                 }
-                return new SimpleImmutableEntry<String,ExtendedElementInformation>(accessor.name(index++, keyPolicy), value);
+                return new SimpleImmutableEntry<>(accessor.name(index++, keyPolicy), value);
             }
         };
     }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -210,7 +210,7 @@ public class MetadataStandard implements
         ensureNonNull("dependencies",     dependencies);
         this.citation         = citation;
         this.interfacePackage = interfacePackage.getName() + '.';
-        this.accessors        = new ConcurrentHashMap<Class<?>,Object>(); // Also defined in readObject(…)
+        this.accessors        = new ConcurrentHashMap<>(); // Also defined in readObject(…)
         if (dependencies.length == 0) {
             this.dependencies = null;
         } else {
@@ -232,7 +232,7 @@ public class MetadataStandard implements
     MetadataStandard(final String citation, final String interfacePackage, final MetadataStandard[] dependencies) {
         this.citation         = new SimpleCitation(citation);
         this.interfacePackage = interfacePackage;
-        this.accessors        = new ConcurrentHashMap<Class<?>,Object>();
+        this.accessors        = new ConcurrentHashMap<>();
         this.dependencies     = dependencies; // No clone, since this constructor is for internal use only.
     }
 
@@ -447,7 +447,7 @@ public class MetadataStandard implements
                  * Gets every interfaces from the supplied package in declaration order,
                  * including the ones declared in the super-class.
                  */
-                final Set<Class<?>> interfaces = new LinkedHashSet<Class<?>>();
+                final Set<Class<?>> interfaces = new LinkedHashSet<>();
                 for (Class<?> t=type; t!=null; t=t.getSuperclass()) {
                     getInterfaces(t, interfaces);
                 }
@@ -973,13 +973,12 @@ public class MetadataStandard implements
      * Assigns a {@link ConcurrentMap} instance to the given field.
      * Used on deserialization only.
      */
-    @SuppressWarnings("rawtypes")
     final void setMapForField(final Class<?> classe, final String name) {
         try {
             final Field field = classe.getDeclaredField(name);
             field.setAccessible(true);
-            field.set(this, new ConcurrentHashMap());
-        } catch (Exception e) { // (ReflectiveOperationException) on JDK7 branch.
+            field.set(this, new ConcurrentHashMap<>());
+        } catch (ReflectiveOperationException e) {
             throw new AssertionError(e); // Should never happen (tested by MetadataStandardTest).
         }
     }




Mime
View raw message