sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762629 [12/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-utility/src/main/java/org/apache/sis/xml/XML.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -22,6 +22,7 @@ import java.util.TimeZone;
 import java.util.logging.LogRecord; // For javadoc
 import java.net.URL;
 import java.io.File;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.StringReader;
@@ -33,6 +34,7 @@ import javax.xml.transform.Source;
 import javax.xml.transform.Result;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.Version;
+import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.logging.WarningListener;
 import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.system.SystemListener;
@@ -40,6 +42,11 @@ import org.apache.sis.internal.jaxb.Type
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
+// Branch-dependent imports
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
 
 /**
  * Provides convenience methods for marshalling and unmarshalling SIS objects.
@@ -398,6 +405,26 @@ public final class XML extends Static {
     }
 
     /**
+     * Marshall the given object into a path.
+     *
+     * @param  object The root of content tree to be marshalled.
+     * @param  output The file to be written.
+     * @throws JAXBException if an error occurred during the marshalling.
+     */
+    public static void marshal(final Object object, final Path output) throws JAXBException {
+        ensureNonNull("object", object);
+        ensureNonNull("output", output);
+        try (OutputStream out = Files.newOutputStream(output, StandardOpenOption.CREATE, StandardOpenOption.WRITE)) {
+            final MarshallerPool pool = getPool();
+            final Marshaller marshaller = pool.acquireMarshaller();
+            marshaller.marshal(object, out);
+            pool.recycle(marshaller);
+        } catch (IOException e) {
+            throw new JAXBException(Errors.format(Errors.Keys.CanNotOpen_1, output), e);
+        }
+    }
+
+    /**
      * Marshall the given object to a stream, DOM or other destinations.
      * This is the most flexible marshalling method provided in this {@code XML} class.
      * The destination is specified by the {@code output} argument implementation, for example
@@ -494,6 +521,27 @@ public final class XML extends Static {
         return object;
     }
 
+    /**
+     * Unmarshall an object from the given path.
+     *
+     * @param  input The path from which to read a XML representation.
+     * @return The object unmarshalled from the given input.
+     * @throws JAXBException if an error occurred during the unmarshalling.
+     */
+    public static Object unmarshal(final Path input) throws JAXBException {
+        ensureNonNull("input", input);
+        final Object object;
+        try (InputStream in = Files.newInputStream(input, StandardOpenOption.READ)) {
+            final MarshallerPool pool = getPool();
+            final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
+            object = unmarshaller.unmarshal(in);
+            pool.recycle(unmarshaller);
+        } catch (IOException e) {
+            throw new JAXBException(Errors.format(Errors.Keys.CanNotRead_1, input), e);
+        }
+        return object;
+    }
+
     /**
      * Unmarshall an object from the given stream, DOM or other sources.
      * This is the most flexible unmarshalling method provided in this {@code XML} class.

Modified: sis/trunk/core/sis-utility/src/main/resources/META-INF/services/org.apache.sis.util.ObjectConverter
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/resources/META-INF/services/org.apache.sis.util.ObjectConverter?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/resources/META-INF/services/org.apache.sis.util.ObjectConverter [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/resources/META-INF/services/org.apache.sis.util.ObjectConverter [UTF-8] Wed Sep 28 09:59:44 2016
@@ -14,12 +14,19 @@ org.apache.sis.internal.converter.String
 org.apache.sis.internal.converter.StringConverter$Charset
 org.apache.sis.internal.converter.StringConverter$InternationalString
 org.apache.sis.internal.converter.StringConverter$File
+org.apache.sis.internal.converter.StringConverter$Path
 org.apache.sis.internal.converter.StringConverter$URI
 org.apache.sis.internal.converter.StringConverter$URL
 org.apache.sis.internal.converter.StringConverter$Unit
 org.apache.sis.internal.converter.StringConverter$Angle
 org.apache.sis.internal.converter.AngleConverter
 org.apache.sis.internal.converter.AngleConverter$Inverse
+org.apache.sis.internal.converter.PathConverter$FilePath
+org.apache.sis.internal.converter.PathConverter$URLPath
+org.apache.sis.internal.converter.PathConverter$URIPath
+org.apache.sis.internal.converter.PathConverter$PathURI
+org.apache.sis.internal.converter.PathConverter$PathURL
+org.apache.sis.internal.converter.PathConverter$PathFile
 org.apache.sis.internal.converter.PathConverter$FileURI
 org.apache.sis.internal.converter.PathConverter$FileURL
 org.apache.sis.internal.converter.PathConverter$URLFile

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ArrayConverterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ArrayConverterTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ArrayConverterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ArrayConverterTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -37,7 +37,7 @@ public final strictfp class ArrayConvert
      * The types need to be specified because we want to test wrapper and primitive types.
      */
     private static <S,T> ArrayConverter<S,T> create(final Class<S> sourceClass, final Class<T> targetClass) {
-        return new ArrayConverter<S,T>(sourceClass, targetClass, new NumberConverter<Integer,Double>(Integer.class, Double.class));
+        return new ArrayConverter<>(sourceClass, targetClass, new NumberConverter<>(Integer.class, Double.class));
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ConverterRegistryTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ConverterRegistryTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ConverterRegistryTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ConverterRegistryTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -58,7 +58,7 @@ public final strictfp class ConverterReg
      * All converters registered in a test case. Only the converter type and properties
      * will be verified; no conversion or serialization shall be attempted.
      */
-    private final Deque<ObjectConverter<?,?>> converters = new ArrayDeque<ObjectConverter<?,?>>();
+    private final Deque<ObjectConverter<?,?>> converters = new ArrayDeque<>();
 
     /**
      * Registers a converter to test.
@@ -319,7 +319,7 @@ public final strictfp class ConverterReg
          * Expected side-effect: none
          */
         assertAllConvertersAreRegistered();
-        register(new NumberConverter<Number,Float>(Number.class, Float.class));
+        register(new NumberConverter<>(Number.class, Float.class));
         assertSameConverterForTarget(Float.class);
         assertMultilinesEquals("After NumberConverter.Float",
             "ConverterRegistry\n" +
@@ -341,7 +341,7 @@ public final strictfp class ConverterReg
      */
     @Test
     public void testArrayOfWrapperTypes() {
-        register(new NumberConverter<Float,Double>(Float.class, Double.class));
+        register(new NumberConverter<>(Float.class, Double.class));
         final ObjectConverter<?,?> converter = registry.find(Float[].class, Double[].class);
         assertInstanceOf("Array conversions", ArrayConverter.class, converter);
         assertEquals(Float [].class, converter.getSourceClass());
@@ -355,7 +355,7 @@ public final strictfp class ConverterReg
     @Test
     @DependsOnMethod("testArrayOfWrapperTypes")
     public void testArrayOfPrimitiveTypes() {
-        register(new NumberConverter<Float,Double>(Float.class, Double.class));
+        register(new NumberConverter<>(Float.class, Double.class));
         final ObjectConverter<?,?> converter = registry.find(float[].class, double[].class);
         assertInstanceOf("Array conversions", ArrayConverter.class, converter);
         assertEquals(float [].class, converter.getSourceClass());

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/StringConverterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/StringConverterTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/StringConverterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/StringConverterTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -42,7 +42,9 @@ import org.junit.Test;
 import static org.apache.sis.test.Assert.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.StandardCharsets;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.charset.StandardCharsets;
 
 
 /**
@@ -258,6 +260,17 @@ public final strictfp class StringConver
     }
 
     /**
+     * Tests conversions to {@link Path}.
+     */
+    @Test
+    public void testPath() {
+        final ObjectConverter<String,Path> c = new StringConverter.Path();
+        final String path = "home/user/index.txt".replace('/', File.separatorChar);
+        runInvertibleConversion(c, path, Paths.get(path));
+        assertSerializedEquals(c);
+    }
+
+    /**
      * Tests conversions to {@link URI}.
      *
      * @throws URISyntaxException Should never happen.
@@ -296,7 +309,7 @@ public final strictfp class StringConver
      */
     @Test
     public void testCodeList() {
-        final ObjectConverter<String, OnLineFunction> c = new StringConverter.CodeList<OnLineFunction>(OnLineFunction.class);
+        final ObjectConverter<String, OnLineFunction> c = new StringConverter.CodeList<>(OnLineFunction.class);
         runInvertibleConversion(c, "OFFLINE_ACCESS", OnLineFunction.OFFLINE_ACCESS);
         tryUnconvertibleValue(c);
         assertSerializedEquals(c);
@@ -309,7 +322,7 @@ public final strictfp class StringConver
      */
     @Test
     public void testEnum() {
-        final ObjectConverter<String, ElementType> c = new StringConverter.Enum<ElementType>(ElementType.class);
+        final ObjectConverter<String, ElementType> c = new StringConverter.Enum<>(ElementType.class);
         runInvertibleConversion(c, "PACKAGE", ElementType.PACKAGE);
         tryUnconvertibleValue(c);
         assertSerializedEquals(c);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/IdentifierMapAdapterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/IdentifierMapAdapterTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/IdentifierMapAdapterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/IdentifierMapAdapterTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -46,7 +46,7 @@ public strictfp class IdentifierMapAdapt
         assertSame(UUID, assertSerializedEquals(UUID));
         assertSame(HREF, assertSerializedEquals(HREF));
 
-        final List<Identifier> identifiers = new ArrayList<Identifier>();
+        final List<Identifier> identifiers = new ArrayList<>();
         final Map<Citation,String> map = new IdentifierMapAdapter(identifiers);
         assertTrue(identifiers.add(new IdentifierMapEntry(ID,   "myID")));
         assertTrue(identifiers.add(new IdentifierMapEntry(UUID, "myUUID")));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/ModifiableIdentifierMapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/ModifiableIdentifierMapTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/ModifiableIdentifierMapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/ModifiableIdentifierMapTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -81,7 +81,7 @@ public final strictfp class ModifiableId
      */
     @Test
     public void testGetAndPut() {
-        final List<Identifier> identifiers = new ArrayList<Identifier>();
+        final List<Identifier> identifiers = new ArrayList<>();
         final Map<Citation,String> map = new ModifiableIdentifierMap(identifiers);
         assertTrue  ("Newly created map shall be empty.", map.isEmpty());
         assertEquals("Newly created map shall be empty.", 0, map.size());
@@ -155,7 +155,7 @@ public final strictfp class ModifiableId
      */
     @Test
     public void testPutSpecialized() {
-        final List<Identifier> identifiers = new ArrayList<Identifier>();
+        final List<Identifier> identifiers = new ArrayList<>();
         final IdentifierMap map = new ModifiableIdentifierMap(identifiers);
         final String myID = "myID";
         final java.util.UUID myUUID = fromString("a1eb6e53-93db-4942-84a6-d9e7fb9db2c7");
@@ -181,7 +181,7 @@ public final strictfp class ModifiableId
      */
     @Test
     public void testGetSpecialized() {
-        final List<Identifier> identifiers = new ArrayList<Identifier>();
+        final List<Identifier> identifiers = new ArrayList<>();
         final IdentifierMap map = new ModifiableIdentifierMap(identifiers);
 
         assertNull(map.put(ID,   "myID"));
@@ -204,7 +204,7 @@ public final strictfp class ModifiableId
      */
     @Test
     public void testDuplicatedAuthorities() {
-        final List<Identifier> identifiers = new ArrayList<Identifier>();
+        final List<Identifier> identifiers = new ArrayList<>();
         assertTrue(identifiers.add(new IdentifierMapEntry(ID,   "myID1")));
         assertTrue(identifiers.add(new IdentifierMapEntry(UUID, "myUUID")));
         assertTrue(identifiers.add(new IdentifierMapEntry(ID,   "myID2")));
@@ -232,7 +232,7 @@ public final strictfp class ModifiableId
      */
     @Test
     public void testHRefSubstitution() {
-        final List<Identifier> identifiers = new ArrayList<Identifier>();
+        final List<Identifier> identifiers = new ArrayList<>();
         final IdentifierMap map = new ModifiableIdentifierMap(identifiers);
         assertNull(map.put(HREF, "myHREF"));
         assertEquals("Shall contain the entry we added.", "myHREF", map.get(HREF));
@@ -252,7 +252,7 @@ public final strictfp class ModifiableId
      */
     @Test
     public void testUUIDs() {
-        final List<Identifier> identifiers = new ArrayList<Identifier>();
+        final List<Identifier> identifiers = new ArrayList<>();
         final IdentifierMap map = new ModifiableIdentifierMap(identifiers);
         final java.util.UUID id1 = fromString("434f3107-c6d2-4c8c-bb25-553f68641c5c");
         final java.util.UUID id2 = fromString("42924124-032a-4dfe-b06e-113e3cb81cf0");

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gco/PropertyTypeMock.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gco/PropertyTypeMock.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gco/PropertyTypeMock.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gco/PropertyTypeMock.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -83,7 +83,7 @@ final strictfp class PropertyTypeMock ex
 
         /** Creates a new instance with initially no identifier. */
         Value() {
-            identifiers = new ArrayList<Identifier>();
+            identifiers = new ArrayList<>();
             map = new ModifiableIdentifierMap(identifiers);
         }
 

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -80,7 +80,7 @@ public final strictfp class LanguageCode
      */
     @BeforeClass
     public static void createMarshallerPool() throws JAXBException {
-        final Map<String,Object> properties = new HashMap<String,Object>(4);
+        final Map<String,Object> properties = new HashMap<>(4);
         assertNull(properties.put(XML.LOCALE, Locale.UK));
         assertNull(properties.put(XML.TIMEZONE, UTC));
         pool = new MarshallerPool(JAXBContext.newInstance(MetadataMock.class), properties);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -71,7 +71,7 @@ public final strictfp class TimePeriodTe
      */
     @BeforeClass
     public static void createMarshallerPool() throws JAXBException {
-        final Map<String,Object> properties = new HashMap<String,Object>(4);
+        final Map<String,Object> properties = new HashMap<>(4);
         assertNull(properties.put(XML.LOCALE, Locale.FRANCE));
         assertNull(properties.put(XML.TIMEZONE, "CET"));
         pool = new MarshallerPool(JAXBContext.newInstance(TimeInstant.class, TimePeriod.class), properties);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/system/ReferenceQueueConsumerTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/system/ReferenceQueueConsumerTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/system/ReferenceQueueConsumerTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/system/ReferenceQueueConsumerTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -45,7 +45,7 @@ public final strictfp class ReferenceQue
      */
     @Test(expected=InterruptedException.class)
     public void verifyInterruptAssumption() throws InterruptedException {
-        final ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+        final ReferenceQueue<Object> queue = new ReferenceQueue<>();
         Thread.currentThread().interrupt();
         assertNull(queue.remove(1000));
     }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -47,7 +47,7 @@ public final strictfp class AbstractMapT
      * or consistency.
      */
     private static final class Count extends AbstractMap<Integer,String> {
-        private final List<String> values = new ArrayList<String>(Arrays.asList("one", "two", "three"));
+        private final List<String> values = new ArrayList<>(Arrays.asList("one", "two", "three"));
 
         @Override public    void    clear   ()                    {       values.clear();}
         @Override public    String  get     (Object  k)           {return values.get(((Integer) k) - 1);}
@@ -88,12 +88,12 @@ public final strictfp class AbstractMapT
         assertArrayEquals("values", new String[] {"one", "two", "three"}, values.toArray());
 
         final Collection<Map.Entry<Integer,String>> entries = map.entrySet();
-        assertTrue ("contains", entries.contains(new SimpleEntry<Integer,String>(2, "two")));
-        assertFalse("contains", entries.contains(new SimpleEntry<Integer,String>(2, "deux")));
+        assertTrue ("contains", entries.contains(new SimpleEntry<>(2, "two")));
+        assertFalse("contains", entries.contains(new SimpleEntry<>(2, "deux")));
         assertArrayEquals("entrySet", new SimpleEntry<?,?>[] {
-                    new SimpleEntry<Integer,String>(1, "one"),
-                    new SimpleEntry<Integer,String>(2, "two"),
-                    new SimpleEntry<Integer,String>(3, "three")
+                    new SimpleEntry<>(1, "one"),
+                    new SimpleEntry<>(2, "two"),
+                    new SimpleEntry<>(3, "three")
                 }, entries.toArray());
 
         map.clear();
@@ -120,10 +120,10 @@ public final strictfp class AbstractMapT
         assertTrue(map.keySet().add(4));
         assertEquals("size", 4, map.size());
         assertArrayEquals("entrySet", new SimpleEntry<?,?>[] {
-                    new SimpleEntry<Integer,String>(1, "one"),
-                    new SimpleEntry<Integer,String>(2, "two"),
-                    new SimpleEntry<Integer,String>(3, "three"),
-                    new SimpleEntry<Integer,String>(4, "four")
+                    new SimpleEntry<>(1, "one"),
+                    new SimpleEntry<>(2, "two"),
+                    new SimpleEntry<>(3, "three"),
+                    new SimpleEntry<>(4, "four")
                 }, map.entrySet().toArray());
     }
 
@@ -139,10 +139,10 @@ public final strictfp class AbstractMapT
         assertTrue(map.values().add("quatre"));
         assertEquals("size", 4, map.size());
         assertArrayEquals("entrySet", new SimpleEntry<?,?>[] {
-                    new SimpleEntry<Integer,String>(1, "one"),
-                    new SimpleEntry<Integer,String>(2, "two"),
-                    new SimpleEntry<Integer,String>(3, "three"),
-                    new SimpleEntry<Integer,String>(4, "quatre")
+                    new SimpleEntry<>(1, "one"),
+                    new SimpleEntry<>(2, "two"),
+                    new SimpleEntry<>(3, "three"),
+                    new SimpleEntry<>(4, "quatre")
                 }, map.entrySet().toArray());
     }
 
@@ -153,7 +153,7 @@ public final strictfp class AbstractMapT
     @Test
     public void testEquals() {
         final Count map = new Count();
-        final Map<Integer,String> copy = new HashMap<Integer,String>(map);
+        final Map<Integer,String> copy = new HashMap<>(map);
         assertTrue  ("equals",   copy.equals(map));
         assertTrue  ("equals",   map.equals(copy));
         assertEquals("hashCode", copy.hashCode(), map.hashCode());

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -41,7 +41,7 @@ public final strictfp class CheckedArray
      */
     @Test
     public void testAdd() {
-        final CheckedArrayList<String> list = new CheckedArrayList<String>(String.class);
+        final CheckedArrayList<String> list = new CheckedArrayList<>(String.class);
         assertTrue(list.add("One"));
         assertTrue(list.add("Two"));
         assertTrue(list.add("Three"));
@@ -53,7 +53,7 @@ public final strictfp class CheckedArray
      */
     @Test
     public void testAddAll() {
-        final CheckedArrayList<String> list = new CheckedArrayList<String>(String.class);
+        final CheckedArrayList<String> list = new CheckedArrayList<>(String.class);
         assertTrue(list.add("One"));
         assertTrue(list.addAll(Arrays.asList("Two", "Three")));
         assertEquals(Arrays.asList("One", "Two", "Three"), list);
@@ -64,7 +64,7 @@ public final strictfp class CheckedArray
      */
     @Test
     public void testAddNull() {
-        final CheckedArrayList<String> list = new CheckedArrayList<String>(String.class);
+        final CheckedArrayList<String> list = new CheckedArrayList<>(String.class);
         try {
             list.add(null);
         } catch (NullArgumentException e) {
@@ -78,7 +78,7 @@ public final strictfp class CheckedArray
      */
     @Test
     public void testAddAllNull() {
-        final CheckedArrayList<String> list = new CheckedArrayList<String>(String.class);
+        final CheckedArrayList<String> list = new CheckedArrayList<>(String.class);
         final Collection<String> toAdd = Arrays.asList("One", null, "Three");
         try {
             list.addAll(toAdd);
@@ -93,7 +93,7 @@ public final strictfp class CheckedArray
      */
     @Test
     public void testAddWrongType() {
-        final CheckedArrayList<String> list = new CheckedArrayList<String>(String.class);
+        final CheckedArrayList<String> list = new CheckedArrayList<>(String.class);
         final String message = testAddWrongType(list);
         assertTrue("element", message.contains("element"));
         assertTrue("Integer", message.contains("Integer"));
@@ -121,7 +121,7 @@ public final strictfp class CheckedArray
     @Test
     @DependsOnMethod("testAddWrongType")
     public void testAddWrongTypeToSublist() {
-        final CheckedArrayList<String> list = new CheckedArrayList<String>(String.class);
+        final CheckedArrayList<String> list = new CheckedArrayList<>(String.class);
         assertTrue(list.add("One"));
         assertTrue(list.add("Two"));
         assertTrue(list.add("Three"));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -29,7 +29,6 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
-import static org.junit.Assume.assumeTrue;
 
 
 /**
@@ -70,8 +69,8 @@ public final strictfp class CitationsTes
      */
     @Test
     public void testHasCommonIdentifier() {
-        final List<Identifier> id1 = new ArrayList<Identifier>(3);
-        final List<Identifier> id2 = new ArrayList<Identifier>(2);
+        final List<Identifier> id1 = new ArrayList<>(3);
+        final List<Identifier> id2 = new ArrayList<>(2);
         assertNull(Citations.hasCommonIdentifier(id1, id2));
         /*
          * Add codes for two Operation Methods which are implemented in Apache SIS by the same class:
@@ -128,8 +127,6 @@ public final strictfp class CitationsTes
     @Test
     @DependsOnMethod("testGetIdentifier")
     public void testGetCodeSpace() {
-        assumeTrue(Character.isIdentifierIgnorable('\u2060')
-                && Character.isIdentifierIgnorable('\u200B'));
         final SimpleCitation citation = new SimpleCitation(" Valid\u2060Id\u200Bentifier ");
         assertEquals("ValidIdentifier", Citations.getCodeSpace(citation));
 

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -102,7 +102,7 @@ public final strictfp class CollectionsE
      */
     @Test
     public void testAddToMultiValuesMap() {
-        final Map<String, List<Integer>> map = new LinkedHashMap<String, List<Integer>>();
+        final Map<String, List<Integer>> map = new LinkedHashMap<>();
         final Integer A1 = 2;
         final Integer A2 = 4;
         final Integer B1 = 3;
@@ -127,7 +127,7 @@ public final strictfp class CollectionsE
     @Test
     public void testToCaseInsensitiveNameMap() {
         final Function<String,String> nameFunction = ObjectConverters.identity(String.class);
-        final Map<String,String> expected = new HashMap<String,String>();
+        final Map<String,String> expected = new HashMap<>();
         assertNull(expected.put("AA", "AA"));
         assertNull(expected.put("Aa", "Aa")); // No mapping for "aa", because of ambiguity between "AA" and "Aa".
         assertNull(expected.put("BB", "BB"));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -352,10 +352,10 @@ public final strictfp class DoubleDouble
      *   <li>The arrays do not contains an entry for a value that could be omitted.</li>
      * </ul>
      *
-     * @throws Exception If a reflective operation failed (should never happen).
+     * @throws ReflectiveOperationException Should never happen.
      */
     @Test
-    public void testArraysConsistency() throws Exception {
+    public void testArraysConsistency() throws ReflectiveOperationException {
         Field field = DoubleDouble.class.getDeclaredField("VALUES");
         field.setAccessible(true);
         final double[] values = (double[]) field.get(null);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -43,7 +43,7 @@ public final strictfp class LazySetTest
      * Creates the set to use for testing purpose.
      */
     private static LazySet<String> create() {
-        return new LazySet<String>(Arrays.asList(LABELS).iterator());
+        return new LazySet<>(Arrays.asList(LABELS).iterator());
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -22,9 +22,6 @@ import org.junit.Test;
 
 import static org.junit.Assert.*;
 
-// Related to JK7
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Tests {@link TableAppender} implementation.
@@ -87,7 +84,7 @@ public final strictfp class TableAppende
          * implementation), but simply in order to allow the test to pass.
          */
         if (out instanceof SingleCharAppendable) {
-            lineSeparator = JDK7.lineSeparator();
+            lineSeparator = System.lineSeparator();
         }
         assertOutputEquals(
                   "╔═════════╤═════════╤════════╗" + lineSeparator

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/io/WordWrapTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -24,9 +24,6 @@ import org.junit.Before;
 import static org.junit.Assert.*;
 import static org.apache.sis.util.Characters.SOFT_HYPHEN;
 
-// Related to JK7
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Tests {@link LineAppender} implementation when used for wrapping lines to 80 characters.
@@ -84,7 +81,7 @@ public strictfp class WordWrapTest exten
          */
         String insertedLineSeparator = lineSeparator;
         if (f instanceof SingleCharAppendable) {
-            insertedLineSeparator = JDK7.lineSeparator();
+            insertedLineSeparator = System.lineSeparator();
         }
         insertedLineSeparator = expectedLineSeparator(insertedLineSeparator);
         final String expectedLineSeparator = expectedLineSeparator(lineSeparator);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/DateRangeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -46,8 +46,8 @@ public final strictfp class DateRangeTes
         final Date in1 = date("1998-05-12 11:00:00");
         final Date in2 = date("1998-06-08 14:00:00");
         final Date max = date("1998-07-01 19:00:00");
-        final Range<Date> r1 = new Range<Date>(Date.class, min, true, in2, true);
-        final Range<Date> r2 = new Range<Date>(Date.class, in1, true, max, true);
+        final Range<Date> r1 = new Range<>(Date.class, min, true, in2, true);
+        final Range<Date> r2 = new Range<>(Date.class, in1, true, max, true);
         final Range<Date> rt = r1.union(r2);
         assertEquals(min, rt.getMinValue());
         assertEquals(max, rt.getMaxValue());
@@ -55,8 +55,8 @@ public final strictfp class DateRangeTes
         /*
          * Test a range fully included in the other range.
          */
-        final Range<Date> outer = new Range<Date>(Date.class, min, true, max, true);
-        final Range<Date> inner = new Range<Date>(Date.class, in1, true, in2, true);
+        final Range<Date> outer = new Range<>(Date.class, min, true, max, true);
+        final Range<Date> inner = new Range<>(Date.class, in1, true, in2, true);
         assertSame(outer, outer.union(inner));
         assertSame(outer, inner.union(outer));
     }
@@ -70,8 +70,8 @@ public final strictfp class DateRangeTes
         final Date in1 = date("1998-05-12 11:00:00");
         final Date in2 = date("1998-06-08 14:00:00");
         final Date max = date("1998-07-01 19:00:00");
-        final Range<Date> r1 = new Range<Date>(Date.class, min, true, in2, true);
-        final Range<Date> r2 = new Range<Date>(Date.class, in1, true, max, true);
+        final Range<Date> r1 = new Range<>(Date.class, min, true, in2, true);
+        final Range<Date> r2 = new Range<>(Date.class, in1, true, max, true);
         final Range<Date> rt = r1.intersect(r2);
         assertEquals(in1, rt.getMinValue());
         assertEquals(in2, rt.getMaxValue());
@@ -79,8 +79,8 @@ public final strictfp class DateRangeTes
         /*
          * Test a range fully included in the other range.
          */
-        final Range<Date> outer = new Range<Date>(Date.class, min, true, max, true);
-        final Range<Date> inner = new Range<Date>(Date.class, in1, true, in2, true);
+        final Range<Date> outer = new Range<>(Date.class, min, true, max, true);
+        final Range<Date> inner = new Range<>(Date.class, in1, true, in2, true);
         assertSame(inner, outer.intersect(inner));
         assertSame(inner, inner.intersect(outer));
     }
@@ -94,8 +94,8 @@ public final strictfp class DateRangeTes
         final Date in1 = date("1998-05-12 11:00:00");
         final Date in2 = date("1998-06-08 14:00:00");
         final Date max = date("1998-07-01 19:00:00");
-        final Range<Date> outer = new Range<Date>(Date.class, min, true, max, true);
-        final Range<Date> inner = new Range<Date>(Date.class, in1, true, in2, true);
+        final Range<Date> outer = new Range<>(Date.class, min, true, max, true);
+        final Range<Date> inner = new Range<>(Date.class, in1, true, in2, true);
         final Range<Date>[] rt = outer.subtract(inner);
         assertEquals(2, rt.length);
         assertEquals(min, rt[0].getMinValue());

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/FormattedCharacterIteratorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/FormattedCharacterIteratorTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/FormattedCharacterIteratorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/FormattedCharacterIteratorTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -112,7 +112,7 @@ public final strictfp class FormattedCha
      * @param withNumberFields {@code true} for including the keys for {@code NumberFormat} fields.
      */
     private static Set<Attribute> getAllAttributeKeys(final boolean withNumberFields) {
-        final Set<Attribute> keys = new HashSet<Attribute>(8);
+        final Set<Attribute> keys = new HashSet<>(8);
         assertTrue(keys.add(DEGREES));
         assertTrue(keys.add(MINUTES));
         assertTrue(keys.add(SECONDS));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/NumberRangeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -132,7 +132,7 @@ public final strictfp class NumberRangeT
         final ValueRange values = NumberRangeTest.class
                 .getMethod("testValueRangeAnnotation").getAnnotation(ValueRange.class);
         assertNotNull("Annotation not found.", values);
-        final NumberRange<Short> range = new NumberRange<Short>(Short.class, values);
+        final NumberRange<Short> range = new NumberRange<>(Short.class, values);
         assertEquals(NumberRange.create((short) 4, true, (short) 8, false), range);
     }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -316,7 +316,7 @@ public final strictfp class RangeFormatT
         final long DAY  = 24L * HOUR;
         final long YEAR = round(365.25 * DAY);
 
-        Range<Date> range = new Range<Date>(Date.class,
+        Range<Date> range = new Range<>(Date.class,
                 new Date(15*DAY + 18*HOUR), true,
                 new Date(20*YEAR + 15*DAY + 9*HOUR), true);
         AttributedCharacterIterator it = format.formatToCharacterIterator(range);
@@ -332,7 +332,7 @@ public final strictfp class RangeFormatT
         /*
          * Try again with the infinity symbol in one endpoint.
          */
-        range = new Range<Date>(Date.class, (Date) null, true, new Date(20*YEAR), true);
+        range = new Range<>(Date.class, (Date) null, true, new Date(20*YEAR), true);
         it    = format.formatToCharacterIterator(range);
         text  = it.toString();
         findYears(it, RangeFormat.Field.MAX_VALUE, maxPos);
@@ -341,7 +341,7 @@ public final strictfp class RangeFormatT
         assertEquals(14, maxPos.getEndIndex());
         assertEquals(range, parse(text));
 
-        range = new Range<Date>(Date.class, new Date(20*YEAR), true, (Date) null, true);
+        range = new Range<>(Date.class, new Date(20*YEAR), true, (Date) null, true);
         it    = format.formatToCharacterIterator(range);
         text  = it.toString();
         findYears(it, RangeFormat.Field.MIN_VALUE, minPos);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -38,35 +38,35 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testConstructor() {
-        Range<Integer> range = new Range<Integer>(Integer.class, 3, true, 5, true);
+        Range<Integer> range = new Range<>(Integer.class, 3, true, 5, true);
         assertEquals(Integer.valueOf(3), range.getMinValue());
         assertEquals(Integer.valueOf(5), range.getMaxValue());
         assertTrue  (range.isMaxIncluded());
         assertTrue  (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<Integer>(Integer.class, 3, false, 5, true);
+        range = new Range<>(Integer.class, 3, false, 5, true);
         assertEquals(Integer.valueOf(3), range.getMinValue());
         assertEquals(Integer.valueOf(5), range.getMaxValue());
         assertTrue  (range.isMaxIncluded());
         assertFalse (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<Integer>(Integer.class, 2, true, 7, false);
+        range = new Range<>(Integer.class, 2, true, 7, false);
         assertEquals(Integer.valueOf(2), range.getMinValue());
         assertEquals(Integer.valueOf(7), range.getMaxValue());
         assertFalse (range.isMaxIncluded());
         assertTrue  (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<Integer>(Integer.class, 3, false, 10, false);
+        range = new Range<>(Integer.class, 3, false, 10, false);
         assertEquals(Integer.valueOf( 3), range.getMinValue());
         assertEquals(Integer.valueOf(10), range.getMaxValue());
         assertFalse (range.isMaxIncluded());
         assertFalse (range.isMinIncluded());
         assertFalse (range.isEmpty());
 
-        range = new Range<Integer>(Integer.class, 10, true, 2, true);
+        range = new Range<>(Integer.class, 10, true, 2, true);
         assertEquals(Integer.valueOf(10), range.getMinValue());
         assertEquals(Integer.valueOf( 2), range.getMaxValue());
         assertTrue (range.isEmpty());
@@ -107,7 +107,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContains() {
-        final Range<Integer> range = new Range<Integer>(Integer.class, 3, true, 5, true);
+        final Range<Integer> range = new Range<>(Integer.class, 3, true, 5, true);
         assertTrue (range.contains(4));
         assertFalse(range.contains(6));
         assertFalse(range.contains(2));
@@ -120,7 +120,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNotInclusiveMinimum() {
-        final Range<Integer> range = new Range<Integer>(Integer.class, 2, false, 5, true);
+        final Range<Integer> range = new Range<>(Integer.class, 2, false, 5, true);
         assertTrue (range.contains(4));
         assertFalse(range.contains(6));
         assertFalse(range.contains(2));
@@ -134,7 +134,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNotInclusiveMaximum() {
-        final Range<Integer> range = new Range<Integer>(Integer.class, 3, true, 6, false);
+        final Range<Integer> range = new Range<>(Integer.class, 3, true, 6, false);
         assertTrue (range.contains(4));
         assertFalse(range.contains(6));
         assertFalse(range.contains(2));
@@ -147,7 +147,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNoLowerEndpoint() {
-        final Range<Integer> range = new Range<Integer>(Integer.class, null, true, 5, true);
+        final Range<Integer> range = new Range<>(Integer.class, null, true, 5, true);
         assertTrue (range.contains(-555));
         assertTrue (range.contains(5));
         assertFalse(range.contains(6));
@@ -158,7 +158,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNoUpperEndpoint() {
-        final Range<Integer> range = new Range<Integer>(Integer.class, 3, true, null, true);
+        final Range<Integer> range = new Range<>(Integer.class, 3, true, null, true);
         assertFalse(range.contains(1));
         assertTrue (range.contains(3));
         assertTrue (range.contains(10000));
@@ -169,7 +169,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsNoEndpoints() {
-        final Range<Integer> range = new Range<Integer>(Integer.class, null, true, null, true);
+        final Range<Integer> range = new Range<>(Integer.class, null, true, null, true);
         assertTrue(range.contains(-55555));
         assertTrue(range.contains(100000));
     }
@@ -179,8 +179,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsRange() {
-        final Range<Integer> range  = new Range<Integer>(Integer.class, -10, true, 10, true);
-        final Range<Integer> inside = new Range<Integer>(Integer.class,  -5, true,  5, true);
+        final Range<Integer> range  = new Range<>(Integer.class, -10, true, 10, true);
+        final Range<Integer> inside = new Range<>(Integer.class,  -5, true,  5, true);
 
         assertTrue(range.contains(inside));
         assertFalse(inside.contains(range));
@@ -191,8 +191,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsRangeNoLowerEndpoint() {
-        final Range<Integer> range  = new Range<Integer>(Integer.class,  null, true, 500, true);
-        final Range<Integer> inside = new Range<Integer>(Integer.class, -2500, true, 305, true);
+        final Range<Integer> range  = new Range<>(Integer.class,  null, true, 500, true);
+        final Range<Integer> inside = new Range<>(Integer.class, -2500, true, 305, true);
 
         assertTrue (range.contains(inside));
         assertFalse(inside.contains(range));
@@ -203,8 +203,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testContainsRangeNoUpperEndpoint() {
-        final Range<Integer> range  = new Range<Integer>(Integer.class, -2500, true, null, true);
-        final Range<Integer> inside = new Range<Integer>(Integer.class,    17, true,  305, true);
+        final Range<Integer> range  = new Range<>(Integer.class, -2500, true, null, true);
+        final Range<Integer> inside = new Range<>(Integer.class,    17, true,  305, true);
 
         assertTrue(range.contains(inside));
         assertFalse(inside.contains(range));
@@ -215,9 +215,9 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testIntersects() {
-        final Range<Character> range1 = new Range<Character>(Character.class, 'a', true, 'g', true);
-        final Range<Character> range2 = new Range<Character>(Character.class, 'c', true, 'm', true);
-        final Range<Character> range3 = new Range<Character>(Character.class, 'o', true, 'z', true);
+        final Range<Character> range1 = new Range<>(Character.class, 'a', true, 'g', true);
+        final Range<Character> range2 = new Range<>(Character.class, 'c', true, 'm', true);
+        final Range<Character> range3 = new Range<>(Character.class, 'o', true, 'z', true);
 
         assertTrue (range1.intersects(range2));
         assertTrue (range2.intersects(range1));
@@ -230,8 +230,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testIntersection() {
-        final Range<Integer> range1 = new Range<Integer>(Integer.class, 1, true, 5, true);
-        final Range<Integer> range2 = new Range<Integer>(Integer.class, 4, true, 6, true);
+        final Range<Integer> range1 = new Range<>(Integer.class, 1, true, 5, true);
+        final Range<Integer> range2 = new Range<>(Integer.class, 4, true, 6, true);
 
         final Range<?> intersection = range1.intersect(range2);
         assertEquals(Integer.class, intersection.getElementType());
@@ -244,8 +244,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testIntersectionOfNonIntersectingRanges() {
-        final Range<Integer> range1 = new Range<Integer>(Integer.class, 1, true,  5, true);
-        final Range<Integer> range2 = new Range<Integer>(Integer.class, 8, true, 10, true);
+        final Range<Integer> range1 = new Range<>(Integer.class, 1, true,  5, true);
+        final Range<Integer> range2 = new Range<>(Integer.class, 8, true, 10, true);
 
         final Range<?> intersection = range1.intersect(range2);
         assertEquals(Integer.class, intersection.getElementType());
@@ -257,8 +257,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testUnion() {
-        final Range<Character> range1 = new Range<Character>(Character.class, 'a', true, 'f', true);
-        final Range<Character> range2 = new Range<Character>(Character.class, 'd', true, 'h', true);
+        final Range<Character> range1 = new Range<>(Character.class, 'a', true, 'f', true);
+        final Range<Character> range2 = new Range<>(Character.class, 'd', true, 'h', true);
 
         final Range<?> union = range1.union(range2);
         assertFalse(union.isEmpty());
@@ -271,8 +271,8 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testDisjointUnion() {
-        final Range<Character> range1 = new Range<Character>(Character.class, 'a', true, 'f', true);
-        final Range<Character> range2 = new Range<Character>(Character.class, 'm', true, 'v', true);
+        final Range<Character> range1 = new Range<>(Character.class, 'a', true, 'f', true);
+        final Range<Character> range2 = new Range<>(Character.class, 'm', true, 'v', true);
 
         final Range<?> unionRange = range1.union(range2);
         assertFalse(unionRange.isEmpty());
@@ -285,12 +285,12 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testSubtract() {
-        final Range<Integer> range1 = new Range<Integer>(Integer.class, 10, true, 40, true);
-        final Range<Integer> range2 = new Range<Integer>(Integer.class, 20, true, 25, true);
+        final Range<Integer> range1 = new Range<>(Integer.class, 10, true, 40, true);
+        final Range<Integer> range2 = new Range<>(Integer.class, 20, true, 25, true);
         final Range<Integer>[] subtract = range1.subtract(range2);
         assertEquals(2, subtract.length);
-        assertEquals(new Range<Integer>(Integer.class, 10, true,  20, false), subtract[0]);
-        assertEquals(new Range<Integer>(Integer.class, 25, false, 40, true),  subtract[1]);
+        assertEquals(new Range<>(Integer.class, 10, true,  20, false), subtract[0]);
+        assertEquals(new Range<>(Integer.class, 25, false, 40, true),  subtract[1]);
     }
 
     /**
@@ -298,12 +298,12 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testToString() {
-        assertEquals("{}",        new Range<Integer>(Integer.class, 10, false, 10, false).toString());
-        assertEquals("{10}",      new Range<Integer>(Integer.class, 10, true,  10, true ).toString());
-        assertEquals("[10 … 20]", new Range<Integer>(Integer.class, 10, true,  20, true ).toString());
-        assertEquals("(10 … 20)", new Range<Integer>(Integer.class, 10, false, 20, false).toString());
-        assertEquals("[10 … 20)", new Range<Integer>(Integer.class, 10, true,  20, false).toString());
-        assertEquals("(10 … 20]", new Range<Integer>(Integer.class, 10, false, 20, true ).toString());
+        assertEquals("{}",        new Range<>(Integer.class, 10, false, 10, false).toString());
+        assertEquals("{10}",      new Range<>(Integer.class, 10, true,  10, true ).toString());
+        assertEquals("[10 … 20]", new Range<>(Integer.class, 10, true,  20, true ).toString());
+        assertEquals("(10 … 20)", new Range<>(Integer.class, 10, false, 20, false).toString());
+        assertEquals("[10 … 20)", new Range<>(Integer.class, 10, true,  20, false).toString());
+        assertEquals("(10 … 20]", new Range<>(Integer.class, 10, false, 20, true ).toString());
     }
 
     /**
@@ -311,7 +311,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testFormatTo() {
-        final Range<Integer> range = new Range<Integer>(Integer.class, 10, true,  20, false);
+        final Range<Integer> range = new Range<>(Integer.class, 10, true,  20, false);
         assertEquals("[10 … 20)",    String.format(Locale.CANADA, "%s", range));
         assertEquals("[10 … 20)",    String.format(Locale.CANADA, "%4s", range));
         assertEquals("[10 … 20)   ", String.format(Locale.CANADA, "%-12s", range));
@@ -325,20 +325,20 @@ public final strictfp class RangeTest ex
     @Test
     public void testEquality() {
         // Positive test - success case
-        final Range<Character> range1 = new Range<Character>(Character.class, 'a', true, 'f', true);
-        final Range<Character> range2 = new Range<Character>(Character.class, 'a', true, 'f', true);
+        final Range<Character> range1 = new Range<>(Character.class, 'a', true, 'f', true);
+        final Range<Character> range2 = new Range<>(Character.class, 'a', true, 'f', true);
         assertTrue(range1.equals(range2));
 
         // Positive test - failure case
-        final Range<Character> range3 = new Range<Character>(Character.class, 'a', true, 'g', true);
+        final Range<Character> range3 = new Range<>(Character.class, 'a', true, 'g', true);
         assertFalse(range1.equals(range3));
 
         // Failure due to type incompatibility
-        final Range<String> range4 = new Range<String>(String.class, "a", true, "g", true);
+        final Range<String> range4 = new Range<>(String.class, "a", true, "g", true);
         assertFalse(range3.equals(range4));
 
-        final Range<Character> range5 = new Range<Character>(Character.class, 'g', true, 'a', true);
-        final Range<Character> range6 = new Range<Character>(Character.class, 'g', true, 'a', true);
+        final Range<Character> range5 = new Range<>(Character.class, 'g', true, 'a', true);
+        final Range<Character> range6 = new Range<>(Character.class, 'g', true, 'a', true);
         assertTrue(range5.isEmpty());
         assertTrue(range6.isEmpty());
         assertTrue(range5.equals(range6));
@@ -349,7 +349,7 @@ public final strictfp class RangeTest ex
      */
     @Test
     public void testSerialization() {
-        final Range<Integer> range  = new Range<Integer>(Integer.class, -10, true, 10, true);
+        final Range<Integer> range  = new Range<>(Integer.class, -10, true, 10, true);
         assertNotSame(range, assertSerializedEquals(range));
     }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/setup/OptionKeyTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/setup/OptionKeyTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/setup/OptionKeyTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/setup/OptionKeyTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -90,7 +90,7 @@ public final strictfp class OptionKeyTes
      */
     @Test
     public void testSubclassSerialization() {
-        final CustomKey<Integer> key = new CustomKey<Integer>("key", Integer.class);
+        final CustomKey<Integer> key = new CustomKey<>("key", Integer.class);
         assertNotSame(key, assertSerializedEquals(key));
     }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -185,7 +185,7 @@ public abstract strictfp class Annotatio
                     wrapper.isInherited = true;
                     return wrapper;
                 } catch (ClassNotFoundException e2) {
-                    // JDK7 branch does: e.addSuppressed(e2);
+                    e.addSuppressed(e2);
                 }
             }
             throw e;
@@ -441,7 +441,7 @@ public abstract strictfp class Annotatio
      */
     @Test
     public void testPackageAnnotations() {
-        final Set<Package> packages = new HashSet<Package>();
+        final Set<Package> packages = new HashSet<>();
         for (final Class<?> type : types) {
             if (!CodeList.class.isAssignableFrom(type)) {
                 testingClass = type.getCanonicalName();

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -37,7 +37,7 @@ import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.Classes;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -120,10 +120,8 @@ public strictfp class Assert extends Geo
                 for (int i=0; i<length; i++) try {
                     assertEqualsIgnoreMetadata(expected[i], actual[i]);
                 } catch (AssertionError e) {
-                    final AssertionError ne = new AssertionError(Exceptions.formatChainedMessages(null,
-                            "Comparison failure at index " + i + " (a " + Classes.getShortClassName(actual[i]) + ").", e));
-                    ne.initCause(e);
-                    throw ne;
+                    throw new AssertionError(Exceptions.formatChainedMessages(null, "Comparison failure at index "
+                            + i + " (a " + Classes.getShortClassName(actual[i]) + ").", e), e);
                 }
                 assertEquals("Unexpected array length.", expected.length, actual.length);
             }
@@ -184,7 +182,7 @@ public strictfp class Assert extends Geo
      */
     public static void assertSetEquals(final Collection<?> expected, final Collection<?> actual) {
         if (expected != null && actual != null && !expected.isEmpty()) {
-            final Set<Object> r = new LinkedHashSet<Object>(expected);
+            final Set<Object> r = new LinkedHashSet<>(expected);
             assertTrue("The two sets are disjoint.",                 r.removeAll(actual));
             assertTrue("The set is missing elements: " + r,          r.isEmpty());
             assertTrue("The set unexpectedly became empty.",         r.addAll(actual));
@@ -205,7 +203,7 @@ public strictfp class Assert extends Geo
      */
     public static void assertMapEquals(final Map<?,?> expected, final Map<?,?> actual) {
         if (expected != null && actual != null && !expected.isEmpty()) {
-            final Map<Object,Object> r = new LinkedHashMap<Object,Object>(expected);
+            final Map<Object,Object> r = new LinkedHashMap<>(expected);
             for (final Map.Entry<?,?> entry : actual.entrySet()) {
                 final Object key = entry.getKey();
                 if (!r.containsKey(key)) {
@@ -354,16 +352,12 @@ public strictfp class Assert extends Geo
         final XMLComparator comparator;
         try {
             comparator = new XMLComparator(expected, actual);
-        } catch (IOException e) {
+        } catch (IOException | ParserConfigurationException | SAXException e) {
             // We don't throw directly those exceptions since failing to parse the XML file can
             // be considered as part of test failures and the JUnit exception for such failures
             // is AssertionError. Having no checked exception in "assert" methods allow us to
             // declare the checked exceptions only for the library code being tested.
             throw new AssertionError(e);
-        } catch (ParserConfigurationException e) {
-            throw new AssertionError(e);
-        } catch (SAXException e) {
-            throw new AssertionError(e);
         }
         comparator.tolerance = tolerance;
         comparator.ignoreComments = true;
@@ -395,26 +389,20 @@ public strictfp class Assert extends Geo
         final Object deserialized;
         try {
             final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-            final ObjectOutputStream out = new ObjectOutputStream(buffer);
-            try {
+            try (ObjectOutputStream out = new ObjectOutputStream(buffer)) {
                 out.writeObject(object);
-            } finally {
-                out.close();
             }
             // Now reads the object we just serialized.
             final byte[] data = buffer.toByteArray();
-            final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(data));
-            try {
+            try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(data))) {
                 try {
                     deserialized = in.readObject();
                 } catch (ClassNotFoundException e) {
                     throw new AssertionError(e);
                 }
-            } finally {
-                in.close();
             }
         } catch (IOException e) {
-            throw new AssertionError(e);
+            throw new AssertionError(e.toString(), e);
         }
         // Compares with the original object and returns it.
         @SuppressWarnings("unchecked")

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assume.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assume.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assume.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/Assume.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -19,8 +19,8 @@ package org.apache.sis.test;
 import org.apache.sis.internal.system.DataDirectory;
 
 // Branch-specific imports
-import org.apache.sis.internal.jdk7.Path;
-import org.apache.sis.internal.jdk7.Files;
+import java.nio.file.Path;
+import java.nio.file.Files;
 
 
 /**

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LogRecordCollector.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LogRecordCollector.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LogRecordCollector.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LogRecordCollector.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -27,9 +27,6 @@ import org.apache.sis.internal.system.Mo
 import org.apache.sis.io.TableAppender;
 import org.junit.runner.Description;
 
-// Branch-specific imports
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Collects who emitted logging messages during the execution of a test suite.
@@ -56,7 +53,7 @@ final class LogRecordCollector extends H
      *   <li>Logging level</li>
      * </ul>
      */
-    private final List<String> records = new ArrayList<String>();
+    private final List<String> records = new ArrayList<>();
 
     /**
      * The description of the test currently running.
@@ -119,7 +116,7 @@ final class LogRecordCollector extends H
      */
     final void report(final Appendable out) throws IOException {
         synchronized (records) {
-            final String lineSeparator = JDK7.lineSeparator();
+            final String lineSeparator = System.lineSeparator();
             if (!records.isEmpty()) {
                 out.append(lineSeparator)
                    .append("The following tests have logged messages at level INFO or higher:").append(lineSeparator)

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -67,7 +67,7 @@ public final strictfp class LoggingWatch
     /**
      * The logged messages.
      */
-    private final Queue<String> messages = new LinkedList<String>();
+    private final Queue<String> messages = new LinkedList<>();
 
     /**
      * The logger to watch.

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -198,7 +198,7 @@ public final class TestRunner extends Bl
         final TestClass testClass = getTestClass();
         final List<FrameworkMethod> depends = testClass.getAnnotatedMethods(DependsOnMethod.class);
         if (!isNullOrEmpty(depends)) {
-            final Set<String> dependencies = new HashSet<String>(hashMapCapacity(depends.size()));
+            final Set<String> dependencies = new HashSet<>(hashMapCapacity(depends.size()));
             for (final FrameworkMethod method : depends) {
                 for (final String value : method.getAnnotation(DependsOnMethod.class).value()) {
                     dependencies.add(value);
@@ -268,7 +268,7 @@ public final class TestRunner extends Bl
      * @param methods The methods to sort.
      */
     private static void sortDependantTestsLast(final FrameworkMethod[] methods) {
-        final Set<String> dependencies = new HashSet<String>();
+        final Set<String> dependencies = new HashSet<>();
         int retryCount = methods.length;
         for (int i=methods.length-1; --i>=0;) {
             final FrameworkMethod method = methods[i];
@@ -385,12 +385,12 @@ public final class TestRunner extends Bl
      */
     final void addDependencyFailure(final String methodName) {
         if (methodDependencyFailures == null) {
-            methodDependencyFailures = new HashSet<String>();
+            methodDependencyFailures = new HashSet<>();
         }
         methodDependencyFailures.add(methodName);
         synchronized (TestRunner.class) {
             if (classDependencyFailures == null) {
-                classDependencyFailures = new HashSet<Class<?>>();
+                classDependencyFailures = new HashSet<>();
             }
             classDependencyFailures.add(getTestClass().getJavaClass());
         }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -95,7 +95,7 @@ public abstract strictfp class TestSuite
         File root;
         try {
             root = new File(url.toURI());
-        } catch (Exception e) { // (URISyntaxException | IllegalArgumentException) on JDK7 branch.
+        } catch (URISyntaxException | IllegalArgumentException e) {
             // If not a file, then it is probably an entry in a JAR file.
             fail(e.toString());
             return;
@@ -125,9 +125,9 @@ public abstract strictfp class TestSuite
          * and fail on the first missing test file if any.
          */
         List<Class<?>> declared = Arrays.asList(suite.getAnnotation(Suite.SuiteClasses.class).value());
-        final Set<Class<?>> tests = new HashSet<Class<?>>(declared);
+        final Set<Class<?>> tests = new HashSet<>(declared);
         if (tests.size() != declared.size()) {
-            declared = new ArrayList<Class<?>>(declared);
+            declared = new ArrayList<>(declared);
             assertTrue(declared.removeAll(tests));
             fail("Classes defined twice in " + suite.getSimpleName() + ": " + declared);
         }
@@ -217,7 +217,7 @@ public abstract strictfp class TestSuite
      */
     protected static void verifyTestList(final Class<? extends TestSuite> suite, final Class<?>[] baseTestClasses) {
         final Class<?>[] testCases = suite.getAnnotation(Suite.SuiteClasses.class).value();
-        final Set<Class<?>> done = new HashSet<Class<?>>(testCases.length);
+        final Set<Class<?>> done = new HashSet<>(testCases.length);
         for (final Class<?> testCase : testCases) {
             if (!Classes.isAssignableToAny(testCase, baseTestClasses)) {
                 fail("Class " + testCase.getCanonicalName() + " does not extends TestCase.");

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -49,9 +49,6 @@ import static org.opengis.test.Assert.*;
 import static org.apache.sis.util.Characters.NO_BREAK_SPACE;
 import static org.apache.sis.util.CharSequences.trimWhitespaces;
 
-// Related to JDK7
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Compares the XML document produced by a test method with the expected XML document.
@@ -87,7 +84,7 @@ public strictfp class XMLComparator {
      *
      * @see #substitutePrefix(String)
      */
-    private static final Map<String, String> PREFIX_URL = new HashMap<String, String>(16);
+    private static final Map<String, String> PREFIX_URL = new HashMap<>(16);
     static {
         final Map<String,String> map = PREFIX_URL;
         map.put("xmlns", "http://www.w3.org/2000/xmlns"); // No trailing slash.
@@ -209,11 +206,8 @@ public strictfp class XMLComparator {
             expectedDoc = (Node) expected;
         } else {
             builder = newDocumentBuilder();
-            final InputStream stream = toInputStream(expected);
-            try {
+            try (InputStream stream = toInputStream(expected)) {
                 expectedDoc = builder.parse(stream);
-            } finally {
-                stream.close();
             }
         }
         if (actual instanceof Node) {
@@ -222,15 +216,12 @@ public strictfp class XMLComparator {
             if (builder == null) {
                 builder = newDocumentBuilder();
             }
-            final InputStream stream = toInputStream(actual);
-            try {
+            try (InputStream stream = toInputStream(actual)) {
                 actualDoc = builder.parse(stream);
-            } finally {
-                stream.close();
             }
         }
-        ignoredAttributes = new HashSet<String>();
-        ignoredNodes      = new HashSet<String>();
+        ignoredAttributes = new HashSet<>();
+        ignoredNodes      = new HashSet<>();
     }
 
     /**
@@ -640,7 +631,7 @@ public strictfp class XMLComparator {
             if (abs(doubleValue(expected) - doubleValue(actual)) <= tolerance) {
                 return;
             }
-            final String lineSeparator = JDK7.lineSeparator();
+            final String lineSeparator = System.lineSeparator();
             final StringBuilder buffer = new StringBuilder(1024).append("Expected ")
                     .append(propertyName).append(" \"")
                     .append(expected).append("\" but got \"")
@@ -664,7 +655,6 @@ public strictfp class XMLComparator {
      * returns {@code NaN}. This is used only if a {@linkplain #tolerance} threshold greater
      * than zero has been provided.
      */
-    @SuppressWarnings("unchecked")
     private static double doubleValue(final Comparable<?> property) {
         if (property instanceof Number) {
             return ((Number) property).doubleValue();
@@ -686,7 +676,7 @@ public strictfp class XMLComparator {
      * @return         An error message containing the expected and actual node.
      */
     protected String formatErrorMessage(final Node expected, final Node result) {
-        final String lineSeparator = JDK7.lineSeparator();
+        final String lineSeparator = System.lineSeparator();
         final StringBuilder buffer = new StringBuilder(256).append("Nodes are not equal:").append(lineSeparator);
         formatErrorMessage(buffer, expected, result, lineSeparator);
         return buffer.toString();
@@ -723,7 +713,7 @@ public strictfp class XMLComparator {
     private static List<String> formatHierarchy(final StringBuilder buffer, Node node,
             final List<String> expected, final String lineSeparator)
     {
-        final List<String> hierarchy = new ArrayList<String>();
+        final List<String> hierarchy = new ArrayList<>();
         while (node != null) {
             hierarchy.add(node.getNodeName());
             if (node instanceof Attr) {

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -123,7 +123,7 @@ public abstract strictfp class XMLTestCa
      */
     protected static synchronized MarshallerPool getMarshallerPool() throws JAXBException {
         if (defaultPool == null) {
-            final Map<String,Object> properties = new HashMap<String,Object>(4);
+            final Map<String,Object> properties = new HashMap<>(4);
             assertNull(properties.put(XML.LOCALE, Locale.UK));
             assertNull(properties.put(XML.TIMEZONE, TIMEZONE));
             defaultPool = new MarshallerPool(properties);
@@ -180,19 +180,6 @@ public abstract strictfp class XMLTestCa
     }
 
     /**
-     * Appends explicitely {@code "xmlns:xsi"} to the list of attributes to ignore.
-     * This is not needed on JDK7 if the {@code "xmlns:*"} property has been defined,
-     * but required on JDK6. Not sure why...
-     */
-    @org.apache.sis.util.Workaround(library = "JDK", version = "1.6")
-    private static String[] addIgnoreXSI(String[] ignoredAttributes) {
-        final int length = ignoredAttributes.length;
-        ignoredAttributes = java.util.Arrays.copyOf(ignoredAttributes, length + 1);
-        ignoredAttributes[length] = "xmlns:xsi";
-        return ignoredAttributes;
-    }
-
-    /**
      * Marshals the given object and ensure that the result is equals to the content of the given file.
      *
      * @param  filename The name of the XML file in the package of the final subclass of {@code this}.
@@ -206,7 +193,7 @@ public abstract strictfp class XMLTestCa
     protected final void assertMarshalEqualsFile(final String filename, final Object object,
             final String... ignoredAttributes) throws JAXBException
     {
-        assertXmlEquals(getResource(filename), marshal(object), addIgnoreXSI(ignoredAttributes));
+        assertXmlEquals(getResource(filename), marshal(object), ignoredAttributes);
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -36,12 +36,12 @@ public final strictfp class Serializable
     /**
      * A constant for column of latitudes as floating point value.
      */
-    public static final TableColumn<Float> LATITUDE = new SerializableTableColumn<Float>("LATITUDE", Float.class, "Latitude");
+    public static final TableColumn<Float> LATITUDE = new SerializableTableColumn<>("LATITUDE", Float.class, "Latitude");
 
     /**
      * A constant for column of longitudes as floating point value.
      */
-    public static final TableColumn<Float> LONGITUDE = new SerializableTableColumn<Float>("LONGITUDE", Float.class, "Longitude");
+    public static final TableColumn<Float> LONGITUDE = new SerializableTableColumn<>("LONGITUDE", Float.class, "Longitude");
 
     /**
      * The programmatic name of the static final field holding this constant.

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -129,7 +129,7 @@ public final strictfp class ClassesTest
      */
     @Test
     public void testFindCommonParent() {
-        final Set<Object> types = new HashSet<Object>();
+        final Set<Object> types = new HashSet<>();
 
         assertTrue(types.add(new NotSerializableException()));
         assertEquals(NotSerializableException.class, findCommonClass     (types));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ExceptionsTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ExceptionsTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ExceptionsTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ExceptionsTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -24,9 +24,6 @@ import org.junit.Test;
 
 import static org.junit.Assert.*;
 
-// Related to JDK7
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Tests the {@link Exceptions} utility methods.
@@ -42,7 +39,7 @@ public final strictfp class ExceptionsTe
      */
     @Test
     public void testFormatChainedMessages() {
-        final String lineSeparator = JDK7.lineSeparator();
+        final String lineSeparator = System.lineSeparator();
         final FileNotFoundException cause = new FileNotFoundException("MisingFile.txt");
         cause.initCause(new IOException("Disk is not mounted."));
         final Exception e = new Exception("Can not find “MisingFile.txt”.", cause);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -17,6 +17,7 @@
 package org.apache.sis.util;
 
 import java.util.Locale;
+import java.util.IllformedLocaleException;
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.DependsOnMethod;
@@ -93,7 +94,6 @@ public final strictfp class LocalesTest
      * This functionality is supported only on the JDK7 branch.
      */
     @Test
-    @org.junit.Ignore("Not supported on the JDK6 branch")
     public void testParseIETF() {
         assertEquals(Locale.JAPAN, Locales.parse("ja-JP"));
         assertEquals(new Locale("en", "US", "POSIX"), Locales.parse("en-US-x-lvariant-POSIX"));
@@ -107,7 +107,7 @@ public final strictfp class LocalesTest
         try {
             Locales.parse("orange_APPLE");
             fail("Shall not parse invalid locale.");
-        } catch (RuntimeException e) { // IllformedLocaleException on the JDK7 branch.
+        } catch (IllformedLocaleException e) {
             final String message = e.getMessage();
             assertTrue(message, message.contains("APPLE"));
         }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/UtilitiesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/UtilitiesTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/UtilitiesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/UtilitiesTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -65,11 +65,11 @@ public final strictfp class UtilitiesTes
 
         final Collection<DummyLenient> c1, c2;
         if (orderIsSignificant) {
-            c1 = new ArrayList<DummyLenient>();
-            c2 = new ArrayList<DummyLenient>();
+            c1 = new ArrayList<>();
+            c2 = new ArrayList<>();
         } else {
-            c1 = new LinkedHashSet<DummyLenient>();
-            c2 = new LinkedHashSet<DummyLenient>();
+            c1 = new LinkedHashSet<>();
+            c2 = new LinkedHashSet<>();
         }
         assertTrue(c1.add(e1)); assertTrue(c1.add(e2));
         assertTrue(c2.add(e3)); assertTrue(c2.add(e4));



Mime
View raw message