sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762629 [13/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/test/java/org/apache/sis/util/collection/CacheTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -85,7 +85,7 @@ public final strictfp class CacheTest ex
     public void testPutAndUnlock() {
         final String key   = "The key";
         final String value = "The value";
-        final Cache<String,String> cache = new Cache<String,String>();
+        final Cache<String,String> cache = new Cache<>();
         assertTrue("No initial value expected.", cache.isEmpty());
         assertNull("No initial value expected.", cache.peek(key));
 
@@ -96,7 +96,7 @@ public final strictfp class CacheTest ex
         assertEquals(1,              cache.size());
         assertEquals(value,          cache.peek(key));
         assertEquals(singleton(key), cache.keySet());
-        assertEquals(singleton(new SimpleEntry<String,String>(key, value)), cache.entrySet());
+        assertEquals(singleton(new SimpleEntry<>(key, value)), cache.entrySet());
     }
 
     /**
@@ -112,7 +112,7 @@ public final strictfp class CacheTest ex
         final String  valueByMainThread =  "valueByMainThread";
         final String   keyByOtherThread =   "keyByOtherThread";
         final String valueByOtherThread = "valueByOtherThread";
-        final Cache<String,String> cache = new Cache<String,String>();
+        final Cache<String,String> cache = new Cache<>();
         final class OtherThread extends Thread {
             /**
              * If an error occurred, the cause. It may be an {@link AssertionError}.
@@ -150,7 +150,7 @@ public final strictfp class CacheTest ex
                     if (failure == null) {
                         failure = e;
                     } else {
-                        // The JDK7 branch invokes Throwable.addSuppressed(…) here.
+                        failure.addSuppressed(e);
                     }
                 }
             }
@@ -174,7 +174,7 @@ public final strictfp class CacheTest ex
         /*
          * Checks the map content.
          */
-        final Map<String,String> expected = new HashMap<String,String>(4);
+        final Map<String,String> expected = new HashMap<>(4);
         assertNull(expected.put( keyByMainThread,  valueByMainThread));
         assertNull(expected.put(keyByOtherThread, valueByOtherThread));
         assertMapEquals(expected, cache);
@@ -210,8 +210,8 @@ public final strictfp class CacheTest ex
     @DependsOnMethod("testThreadBlocking")
     public void stress() throws InterruptedException {
         final int count = 5000;
-        final Cache<Integer,Integer> cache = new Cache<Integer,Integer>();
-        final AtomicReference<Throwable> failures = new AtomicReference<Throwable>();
+        final Cache<Integer,Integer> cache = new Cache<>();
+        final AtomicReference<Throwable> failures = new AtomicReference<>();
         final class WriterThread extends Thread {
             /**
              * Incremented every time a value has been added. This is not the number of time the
@@ -244,7 +244,7 @@ public final strictfp class CacheTest ex
                         assertEquals(expected, value);
                     } catch (Throwable e) {
                         if (!failures.compareAndSet(null, e)) {
-                            // The JDK7 branch invokes Throwable.addSuppressed(…) here.
+                            failures.get().addSuppressed(e);
                         }
                         continue;
                     }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -50,7 +50,7 @@ public final strictfp class CodeListSetT
      */
     @SuppressWarnings("fallthrough")
     private CodeListSet<AxisDirection> create(final int n) {
-        final CodeListSet<AxisDirection> c = new CodeListSet<AxisDirection>(AxisDirection.class);
+        final CodeListSet<AxisDirection> c = new CodeListSet<>(AxisDirection.class);
         assertTrue(c.isEmpty());
         switch (n) {
             default: throw new AssertionError(n);
@@ -72,7 +72,7 @@ public final strictfp class CodeListSetT
     private CodeListSet<OnLineFunction> createOtherKind() {
         // For the validity of the tests, ordinal value must be the same.
         assertEquals(NORTH.ordinal(), OnLineFunction.INFORMATION.ordinal());
-        final CodeListSet<OnLineFunction> c = new CodeListSet<OnLineFunction>(OnLineFunction.class);
+        final CodeListSet<OnLineFunction> c = new CodeListSet<>(OnLineFunction.class);
         assertTrue(c.add(OnLineFunction.INFORMATION));
         return c;
     }
@@ -217,7 +217,7 @@ public final strictfp class CodeListSetT
     @Test
     @DependsOnMethod("testContains")
     public void testFill() {
-        final CodeListSet<AxisDirection> c = new CodeListSet<AxisDirection>(AxisDirection.class, true);
+        final CodeListSet<AxisDirection> c = new CodeListSet<>(AxisDirection.class, true);
         assertTrue("Expect at least 32 elements as of GeoAPI 3.0.0.", c.size() >= 32);
         assertTrue(c.toString().startsWith("[AxisDirection[OTHER], AxisDirection[NORTH], "));
         /*
@@ -233,9 +233,9 @@ public final strictfp class CodeListSetT
      */
     @Test
     public void testLargeCodeList() {
-        final Set<LargeCodeList> master = new HashSet<LargeCodeList>(Arrays.asList(LargeCodeList.values()));
+        final Set<LargeCodeList> master = new HashSet<>(Arrays.asList(LargeCodeList.values()));
         assertTrue("This test requires more than 64 elements.", master.size() > Long.SIZE);
-        final CodeListSet<LargeCodeList> c = new CodeListSet<LargeCodeList>(LargeCodeList.class);
+        final CodeListSet<LargeCodeList> c = new CodeListSet<>(LargeCodeList.class);
         /*
          * Copy all content from the master to the CodeListSet. This will indirectly
          * test CodeListSet.add(E), through the AbstractSet.addAll(Collection) method.
@@ -250,7 +250,7 @@ public final strictfp class CodeListSetT
         final CodeListSet<LargeCodeList> clone = c.clone();
         assertNotSame("Clone shall be a new instance.", c, clone);
         assertEquals("Clone shall be equal to the original.", master, clone);
-        assertEquals(clone, new CodeListSet<LargeCodeList>(LargeCodeList.class, true));
+        assertEquals(clone, new CodeListSet<>(LargeCodeList.class, true));
         /*
          * Tests contains(Object) and remove(Object). We also remove elements
          * from the master set, then we verify that the result is the same.

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -68,8 +68,8 @@ public final strictfp class DerivedMapTe
      */
     @Test
     public void testNoExclusion() {
-        final Map<Integer,Integer> source = new HashMap<Integer,Integer>();
-        final Map<Integer,Integer> target = new HashMap<Integer,Integer>();
+        final Map<Integer,Integer> source = new HashMap<>();
+        final Map<Integer,Integer> target = new HashMap<>();
         final Map<Integer,Integer> tested = DerivedMap.create(source, this, new DerivedSetTest());
         fill(source, target);
         assertEquals(target.size(),     tested.size());
@@ -95,8 +95,8 @@ public final strictfp class DerivedMapTe
      */
     @Test
     public void testWithExclusion() {
-        final Map<Integer,Integer> source = new HashMap<Integer,Integer>();
-        final Map<Integer,Integer> target = new HashMap<Integer,Integer>();
+        final Map<Integer,Integer> source = new HashMap<>();
+        final Map<Integer,Integer> target = new HashMap<>();
         final Map<Integer,Integer> tested = DerivedMap.create(source, this, new DerivedSetTest());
         fill(source, target);
         assertNull(source.put(EXCLUDED, 4));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -50,8 +50,8 @@ public final strictfp class DerivedSetTe
      */
     @Test
     public void testNoExclusion() {
-        final Set<Integer> source = new HashSet<Integer>(Arrays.asList(2,  7,  12,  17,  20 ));
-        final Set<Integer> target = new HashSet<Integer>(Arrays.asList(20, 70, 120, 170, 200));
+        final Set<Integer> source = new HashSet<>(Arrays.asList(2,  7,  12,  17,  20 ));
+        final Set<Integer> target = new HashSet<>(Arrays.asList(20, 70, 120, 170, 200));
         final Set<Integer> tested = DerivedSet.create(source, this);
         assertEquals(target.size(), tested.size());
         assertEquals(target, tested);
@@ -76,8 +76,8 @@ public final strictfp class DerivedSetTe
      */
     @Test
     public void testWithExclusion() {
-        final Set<Integer> source = new HashSet<Integer>(Arrays.asList(2,  7,  12,  EXCLUDED, 20));
-        final Set<Integer> target = new HashSet<Integer>(Arrays.asList(20, 70, 120, 200));
+        final Set<Integer> source = new HashSet<>(Arrays.asList(2,  7,  12,  EXCLUDED, 20));
+        final Set<Integer> target = new HashSet<>(Arrays.asList(20, 70, 120, 200));
         final Set<Integer> tested = DerivedSet.create(source, this);
         assertEquals(target.size(), tested.size());
         assertEquals(target, tested);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -55,7 +55,7 @@ public final strictfp class IntegerListT
         // Use half the lenght as initial capacity in order to test dynamic resizing.
         list = new IntegerList(length / 2, maximalValue);
         assertTrue(list.maximalValue() >= maximalValue);
-        final List<Integer> copy = new ArrayList<Integer>(length);
+        final List<Integer> copy = new ArrayList<>(length);
         for (int i=0; i<length; i++) {
             assertEquals(i, list.size());
             final Integer value = nextInt(random, maximalValue);
@@ -108,7 +108,7 @@ public final strictfp class IntegerListT
      */
     private void testFill(final int value) {
         assertEquals(400, list.size());
-        final Set<Integer> set = new HashSet<Integer>();
+        final Set<Integer> set = new HashSet<>();
         list.fill(value);
         set.addAll(list);
         assertEquals(Collections.singleton(value), set);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -156,20 +156,20 @@ public final strictfp class RangeSetTest
         final Date yesterday = new Date(now.getTime() - MILLISECONDS_PER_DAY);
         assertTrue(ranges.add(yesterday, now));
         assertEquals(1, ranges.size());
-        checkContains(ranges, new Range<Date>(Date.class, yesterday, true, now, false), true, true);
+        checkContains(ranges, new Range<>(Date.class, yesterday, true, now, false), true, true);
         /*
          * Add a disjoint range.
          */
         final Date lastWeek = new Date(now.getTime() - 7*MILLISECONDS_PER_DAY);
         final Date other = new Date(lastWeek.getTime() + 2*MILLISECONDS_PER_DAY);
-        assertTrue(ranges.add(new Range<Date>(Date.class, lastWeek, true, other, false)));
+        assertTrue(ranges.add(new Range<>(Date.class, lastWeek, true, other, false)));
         assertEquals(2, ranges.size());
         /*
          * Verify the RangeSet content.
          */
         final Iterator<Range<Date>> it = ranges.iterator();
-        assertEqual(new Range<Date>(Date.class, lastWeek,  true, other, false), it.next(), ranges.first());
-        assertEqual(new Range<Date>(Date.class, yesterday, true, now,   false), it.next(), ranges.last());
+        assertEqual(new Range<>(Date.class, lastWeek,  true, other, false), it.next(), ranges.first());
+        assertEqual(new Range<>(Date.class, yesterday, true, now,   false), it.next(), ranges.last());
         assertFalse(it.hasNext());
     }
 
@@ -182,13 +182,13 @@ public final strictfp class RangeSetTest
         assertTrue(ranges.isEmpty());
         assertTrue(ranges.add("FAA", "FBB"));
         assertEquals(1, ranges.size());
-        checkContains(ranges, new Range<String>(String.class, "FAA", true, "FBB", false), true, true);
+        checkContains(ranges, new Range<>(String.class, "FAA", true, "FBB", false), true, true);
         /*
          * Merge the singleton range with the given range.
          */
         assertTrue(ranges.add("FAZ", "FCC"));
         assertEquals(1, ranges.size());
-        checkContains(ranges, new Range<String>(String.class, "FAA", true, "FCC", false), true, true);
+        checkContains(ranges, new Range<>(String.class, "FAA", true, "FCC", false), true, true);
         /*
          * Add a disjoint range.
          */
@@ -198,8 +198,8 @@ public final strictfp class RangeSetTest
          * Verify the RangeSet content.
          */
         final Iterator<Range<String>> it = ranges.iterator();
-        assertEqual(new Range<String>(String.class, "FAA", true, "FCC", false), it.next(), ranges.first());
-        assertEqual(new Range<String>(String.class, "GAA", true, "GBB", false), it.next(), ranges.last());
+        assertEqual(new Range<>(String.class, "FAA", true, "FCC", false), it.next(), ranges.first());
+        assertEqual(new Range<>(String.class, "GAA", true, "GBB", false), it.next(), ranges.last());
         assertFalse(it.hasNext());
     }
 

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -90,8 +90,8 @@ public final strictfp class TreeTableFor
     @Test
     @DependsOnMethod("testTreeFormat")
     public void testTreeTableFormat() {
-        final TableColumn<Integer> valueA = new TableColumn<Integer>(Integer.class, "value #1");
-        final TableColumn<String>  valueB = new TableColumn<String> (String .class, "value #2");
+        final TableColumn<Integer> valueA = new TableColumn<>(Integer.class, "value #1");
+        final TableColumn<String>  valueB = new TableColumn<>(String .class, "value #2");
         final DefaultTreeTable table  = new DefaultTreeTable(NAME, valueA, valueB);
         final TreeTable.Node   root   = new DefaultTreeTable.Node(table);
         root.setValue(NAME, "Node #1");
@@ -144,8 +144,8 @@ public final strictfp class TreeTableFor
     @Test
     @DependsOnMethod("testTreeTableFormat")
     public void testTreeTableParse() throws ParseException {
-        final TableColumn<Integer> valueA = new TableColumn<Integer>(Integer.class, "value #1");
-        final TableColumn<String>  valueB = new TableColumn<String> (String .class, "value #2");
+        final TableColumn<Integer> valueA = new TableColumn<>(Integer.class, "value #1");
+        final TableColumn<String>  valueB = new TableColumn<>(String .class, "value #2");
         final TreeTableFormat tf = new TreeTableFormat(null, null);
         tf.setColumns(NAME, valueA, valueB);
         tf.setVerticalLinePosition(1);
@@ -166,8 +166,8 @@ public final strictfp class TreeTableFor
     @Test
     @DependsOnMethod("testTreeTableParse")
     public void testAlternativeColumnSeparatorPattern() throws ParseException {
-        final TableColumn<Integer> valueA = new TableColumn<Integer>(Integer.class, "value #1");
-        final TableColumn<String>  valueB = new TableColumn<String> (String .class, "value #2");
+        final TableColumn<Integer> valueA = new TableColumn<>(Integer.class, "value #1");
+        final TableColumn<String>  valueB = new TableColumn<>(String .class, "value #2");
         final TreeTableFormat tf = new TreeTableFormat(null, null);
         assertEquals("?……[…] ", tf.getColumnSeparatorPattern());
         tf.setColumns(NAME, valueA, valueB);

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -18,6 +18,8 @@ package org.apache.sis.util.collection;
 
 import java.util.List;
 import java.io.File;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
 import java.text.ParseException;
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
@@ -90,6 +92,33 @@ public final strictfp class TreeTablesTe
     }
 
     /**
+     * Tests the {@link TreeTables#nodeForPath(TreeTable.Node, TableColumn, Path)} method.
+     */
+    @Test
+    public void testNodeForPath() {
+        final FileSystem fs = FileSystems.getDefault();
+        final TreeTable table = new DefaultTreeTable(NAME, VALUE_AS_NUMBER);
+        final TreeTable.Node files = table.getRoot();
+        files.setValue(NAME, "Root");
+        nodeForPath(files, NAME, fs.getPath("users","Alice","data"))           .setValue(VALUE_AS_NUMBER, 10);
+        nodeForPath(files, NAME, fs.getPath("users","Bob","data"))             .setValue(VALUE_AS_NUMBER, 20);
+        nodeForPath(files, NAME, fs.getPath("users","Bob"))                    .setValue(VALUE_AS_NUMBER, 30);
+        nodeForPath(files, NAME, fs.getPath("lib"))                            .setValue(VALUE_AS_NUMBER, 40);
+        nodeForPath(files, NAME, fs.getPath("users","Alice","document"))       .setValue(VALUE_AS_NUMBER, 50);
+        nodeForPath(files, NAME, fs.getPath("users","Alice","data","mercator")).setValue(VALUE_AS_NUMBER, 60);
+        assertMultilinesEquals(
+                "Root\n" +
+                "  ├─users\n" +
+                "  │   ├─Alice\n" +
+                "  │   │   ├─data………………………… 10\n" +
+                "  │   │   │   └─mercator…… 60\n" +
+                "  │   │   └─document……………… 50\n" +
+                "  │   └─Bob……………………………………… 30\n" +
+                "  │       └─data………………………… 20\n" +
+                "  └─lib………………………………………………… 40\n", table.toString());
+    }
+
+    /**
      * Tests the {@link TreeTables#nodeForPath(TreeTable.Node, TableColumn, File)} method.
      */
     @Test

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -59,8 +59,8 @@ public final strictfp class WeakHashSetT
     public void testStrongReferences() {
         final Random random = new Random();
         for (int pass=0; pass<NUM_RETRY; pass++) {
-            final WeakHashSet<Integer> weakSet = new WeakHashSet<Integer>(Integer.class);
-            final HashSet<Integer> strongSet = new HashSet<Integer>();
+            final WeakHashSet<Integer> weakSet = new WeakHashSet<>(Integer.class);
+            final HashSet<Integer> strongSet = new HashSet<>();
             for (int i=0; i<SAMPLE_SIZE; i++) {
                 final Integer value = random.nextInt(SAMPLE_SIZE);
                 if (random.nextBoolean()) {
@@ -102,8 +102,8 @@ public final strictfp class WeakHashSetT
     public void testWeakReferences() throws InterruptedException {
         final Random random = new Random();
         for (int pass=0; pass<NUM_RETRY; pass++) {
-            final WeakHashSet<Integer> weakSet = new WeakHashSet<Integer>(Integer.class);
-            final HashSet<Integer> strongSet = new HashSet<Integer>();
+            final WeakHashSet<Integer> weakSet = new WeakHashSet<>(Integer.class);
+            final HashSet<Integer> strongSet = new HashSet<>();
             for (int i=0; i<SAMPLE_SIZE; i++) {
                 final Integer value = new Integer(random.nextInt(SAMPLE_SIZE)); // Really need new instances
                 if (random.nextBoolean()) {
@@ -180,7 +180,7 @@ public final strictfp class WeakHashSetT
     @Test
     @DependsOnMethod("testStrongReferences")
     public void testWithArrayElements() {
-        final WeakHashSet<int[]> weakSet = new WeakHashSet<int[]>(int[].class);
+        final WeakHashSet<int[]> weakSet = new WeakHashSet<>(int[].class);
         final int[] array = new int[] {2, 5, 3};
         assertTrue (weakSet.add(array));
         assertFalse(weakSet.add(array));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -71,7 +71,7 @@ public final strictfp class WeakValueHas
         final Random random = new Random();
         for (int pass=0; pass<NUM_RETRY; pass++) {
             weakMap.clear();
-            final HashMap<Integer,Integer> strongMap = new HashMap<Integer,Integer>();
+            final HashMap<Integer,Integer> strongMap = new HashMap<>();
             for (int i=0; i<SAMPLE_SIZE; i++) {
                 final Integer key   = random.nextInt(SAMPLE_SIZE);
                 final Integer value = random.nextInt(SAMPLE_SIZE);
@@ -113,7 +113,7 @@ public final strictfp class WeakValueHas
         final Random random = new Random();
         for (int pass=0; pass<NUM_RETRY; pass++) {
             weakMap.clear();
-            final HashMap<Integer,Integer> strongMap = new HashMap<Integer,Integer>();
+            final HashMap<Integer,Integer> strongMap = new HashMap<>();
             for (int i=0; i<SAMPLE_SIZE; i++) {
                 // We really want new instances here.
                 final Integer key   = new Integer(random.nextInt(SAMPLE_SIZE));
@@ -184,7 +184,7 @@ public final strictfp class WeakValueHas
     @Test
     @DependsOnMethod("testStrongReferences")
     public void testWithArrayKeys() {
-        final WeakValueHashMap<int[],Integer> weakMap = new WeakValueHashMap<int[],Integer>(int[].class);
+        final WeakValueHashMap<int[],Integer> weakMap = new WeakValueHashMap<>(int[].class);
         final int[] k1 = new int[] {2, 5, 3};
         final int[] k2 = new int[] {2, 5, 4};
         final Integer v1 = 1;
@@ -207,7 +207,7 @@ public final strictfp class WeakValueHas
     @Test
     @DependsOnMethod("testStrongReferences")
     public void testIdentityComparisons() {
-        final WeakValueHashMap<Integer,Integer> weakMap = new WeakValueHashMap<Integer,Integer>(Integer.class, true);
+        final WeakValueHashMap<Integer,Integer> weakMap = new WeakValueHashMap<>(Integer.class, true);
         final Integer k1 = 10;
         final Integer k2 = 20;
         final Integer k3 = new Integer(10); // Really want a new instance.

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordSchemaTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordSchemaTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordSchemaTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordSchemaTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -50,7 +50,7 @@ public final strictfp class DefaultRecor
     @Test
     public void testCreateRecordType() {
         final DefaultRecordSchema schema = new DefaultRecordSchema(null, null, "MySchema");
-        final Map<CharSequence,Class<?>> members = new LinkedHashMap<CharSequence,Class<?>>(8);
+        final Map<CharSequence,Class<?>> members = new LinkedHashMap<>(8);
         assertNull(members.put("city",       String.class));
         assertNull(members.put("latitude",   Double.class));
         assertNull(members.put("longitude",  Double.class));

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -53,7 +53,7 @@ public final strictfp class DefaultRecor
     @BeforeClass
     public static void createRecordType() {
         final DefaultRecordSchema schema = new SerializableRecordSchema("MySchema");
-        final Map<CharSequence,Class<?>> members = new LinkedHashMap<CharSequence,Class<?>>(8);
+        final Map<CharSequence,Class<?>> members = new LinkedHashMap<>(8);
         assertNull(members.put("city",       String.class));
         assertNull(members.put("latitude",   Double.class));
         assertNull(members.put("longitude",  Double.class));
@@ -178,7 +178,7 @@ public final strictfp class DefaultRecor
     @Test
     @DependsOnMethod({"testSetAll", "testToString", "testSerialization"})
     public void testPrimitiveType() {
-        final Map<CharSequence,Class<?>> members = new LinkedHashMap<CharSequence,Class<?>>(8);
+        final Map<CharSequence,Class<?>> members = new LinkedHashMap<>(8);
         assertNull(members.put("latitude",  Double.class));
         assertNull(members.put("longitude", Double.class));
         final DefaultRecord record = new DefaultRecord(

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTypeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTypeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTypeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultRecordTypeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -68,7 +68,7 @@ public final strictfp class DefaultRecor
      * Creates a new record type from the current values of private fields.
      */
     private DefaultRecordType create() throws IllegalArgumentException {
-        final Type memberType = new SimpleAttributeType<Integer>(memberTypeName, Integer.class);
+        final Type memberType = new SimpleAttributeType<>(memberTypeName, Integer.class);
         return new DefaultRecordType(recordTypeName, container, Collections.singletonMap(memberName, memberType));
     }
 

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/LargeCodeList.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/LargeCodeList.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/LargeCodeList.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/LargeCodeList.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -37,7 +37,7 @@ public final strictfp class LargeCodeLis
     /**
      * List of all enumerations of this type.
      */
-    private static final List<LargeCodeList> VALUES = new ArrayList<LargeCodeList>(100);
+    private static final List<LargeCodeList> VALUES = new ArrayList<>(100);
 
     /**
      * Creates 100 code list elements.

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -49,7 +49,7 @@ public final strictfp class WarningListe
      * Creates a new test case.
      */
     public WarningListenersTest() {
-        listeners = new WarningListeners<String>("source");
+        listeners = new WarningListeners<>("source");
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/OGCNamespacePrefixMapperTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/OGCNamespacePrefixMapperTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/OGCNamespacePrefixMapperTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/OGCNamespacePrefixMapperTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -48,11 +48,11 @@ public final strictfp class OGCNamespace
      * defined in the JDK class. This test is ignored if the Java framework running this test
      * is not the Oracle one (i.e. if it does not bundle the Sun internal JAXB implementation).
      *
-     * @throws Exception If an error occurred while invoking a method by
+     * @throws ReflectiveOperationException If an error occurred while invoking a method by
      *         the reflection API.
      */
     @Test
-    public void testInternalJAXB() throws Exception {
+    public void testInternalJAXB() throws ReflectiveOperationException {
         try {
             ensureOverrideMethods(new OGCNamespacePrefixMapper(null));
         } catch (NoClassDefFoundError e) {
@@ -65,11 +65,11 @@ public final strictfp class OGCNamespace
      * methods defined in the JAXB class. This test is ignored if the Java framework running
      * this test does not contains JAXB in its endorsed directory.
      *
-     * @throws Exception If an error occurred while invoking a method by
+     * @throws ReflectiveOperationException If an error occurred while invoking a method by
      *         the reflection API.
      */
     @Test
-    public void testEndorsedJAXB() throws Exception {
+    public void testEndorsedJAXB() throws ReflectiveOperationException {
         try {
             ensureOverrideMethods(new OGCNamespacePrefixMapper_Endorsed(null));
         } catch (NoClassDefFoundError e) {
@@ -86,10 +86,10 @@ public final strictfp class OGCNamespace
      *
      * @param  The {@code OGCNamespacePrefixMapper} or {@code OGCNamespacePrefixMapper_Endorsed}
      *         instance to check.
-     * @throws Exception If an error occurred while invoking a method by
+     * @throws ReflectiveOperationException If an error occurred while invoking a method by
      *         the reflection API.
      */
-    private void ensureOverrideMethods(final Object mapper) throws Exception {
+    private void ensureOverrideMethods(final Object mapper) throws ReflectiveOperationException {
         String preferredPrefix = "getPreferredPrefix_method_has_not_been_found";
         final Method[] methods = mapper.getClass().getSuperclass().getDeclaredMethods();
         /*

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -24,7 +24,7 @@ import org.junit.Test;
 import static org.junit.Assert.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.StandardCharsets;
+import java.nio.charset.StandardCharsets;
 
 
 /**

Modified: sis/trunk/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.properties?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Wed Sep 28 09:59:44 2016
@@ -34,8 +34,8 @@ manifest.file        = manifest.mf
 project.license      = apache20
 no.dependencies      = true
 source.encoding      = UTF-8
-javac.source         = 1.6
-javac.target         = 1.6
+javac.source         = 1.7
+javac.target         = 1.7
 platform.active      = default_platform
 run.jvmargs          = -ea -Dorg.apache.sis.test.verbose=true -Dorg.apache.sis.test.extensive=true
 junit.forkmode       = once
@@ -85,10 +85,10 @@ jdom1.version        = 1.0
 jdom2.version        = 2.0.4
 jee.version          = 6.0
 osgi.version         = 6.0.0
-netcdf.version       = 4.4.2
+netcdf.version       = 4.6.4
 joda-time.version    = 2.2
-httpclient.version   = 4.2.6
-slf4j.version        = 1.7.5
+httpclient.version   = 4.3.6
+slf4j.version        = 1.7.7
 junit.version        = 4.12
 hamcrest.version     = 1.3
 jaxb-ns-mapper       = 2.2.4

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Wed Sep 28 09:59:44 2016
@@ -81,7 +81,7 @@ Apache SIS is a free software, Java lang
 
   <ciManagement>
     <system>jenkins</system>
-    <url>https://builds.apache.org/job/sis-trunk</url>
+    <url>https://builds.apache.org/job/sis-jdk7</url>
   </ciManagement>
 
   <issueManagement>
@@ -422,7 +422,7 @@ Apache SIS is a free software, Java lang
       <dependency>
         <groupId>javax</groupId>
         <artifactId>javaee-api</artifactId>
-        <version>6.0</version>
+        <version>7.0</version>
         <scope>provided</scope>
       </dependency>
       <dependency>
@@ -447,7 +447,7 @@ Apache SIS is a free software, Java lang
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-jdk14</artifactId>
-        <version>1.7.5</version>                <!-- Must matches the version used by NetCDF. -->
+        <version>1.7.7</version>                <!-- Must matches the version used by NetCDF. -->
         <scope>runtime</scope>                  <!-- Should never be needed at compile time.  -->
       </dependency>
     </dependencies>
@@ -473,14 +473,14 @@ Apache SIS is a free software, Java lang
          The last properties in this list depend on the Apache SIS branch.
        =================================================================== -->
   <properties>
-    <netcdf.version>4.4.2</netcdf.version>          <!-- Last version compatible with JDK6. -->
+    <netcdf.version>4.6.5</netcdf.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <website.encoding>UTF-8</website.encoding>
     <website.locale>en</website.locale>
 
     <!-- Following properties are branch-specific -->
-    <maven.compile.source>1.6</maven.compile.source>
-    <maven.compile.target>1.6</maven.compile.target>
+    <maven.compile.source>1.7</maven.compile.source>
+    <maven.compile.target>1.7</maven.compile.target>
     <sis.plugin.version>${project.version}</sis.plugin.version>
     <geoapi.version>3.0.0</geoapi.version>
   </properties>
@@ -558,7 +558,7 @@ Apache SIS is a free software, Java lang
           <encoding>${project.build.sourceEncoding}</encoding>
           <useIncrementalCompilation>false</useIncrementalCompilation> <!-- https://jira.codehaus.org/browse/MCOMPILER-209 -->
           <compilerArgs>
-            <arg>-Xlint</arg>
+            <arg>-Xlint:all</arg>
           </compilerArgs>
         </configuration>
       </plugin>
@@ -636,7 +636,7 @@ Apache SIS is a free software, Java lang
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.5.4</version>                                <!-- Last version compatible with JDK6. -->
+        <version>3.0.1</version>
         <extensions>true</extensions>
         <configuration>
           <excludeDependencies>true</excludeDependencies>
@@ -647,7 +647,37 @@ Apache SIS is a free software, Java lang
       </plugin>
 
       <!-- Checkstype configuration
-           Omitted from the JDK6 branch because Checkstyle requires a higher JDK version. -->
+           Legal note: Checkstyle is under LGPL license, but it is okay to use it only for
+           the build if it is downloaded by Maven (not included in Apache SIS distribution).
+           See http://www.apache.org/legal/resolved.html#prohibited
+      -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>2.17</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <configuration>
+              <skip>${skipTests}</skip> <!-- When skipping tests, skip also checkstyle verification. -->
+              <encoding>${project.build.sourceEncoding}</encoding>
+              <consoleOutput>true</consoleOutput>
+              <checkstyleRules>
+                <module name="Checker">
+                  <module name="FileTabCharacter"/>     <!-- Checks that there are no tab characters in the file. -->
+                  <module name="NewlineAtEndOfFile"/>   <!-- Checks that there is a newline at the end of each file. -->
+                  <module name="TreeWalker">
+                    <module name="RedundantImport"/>    <!-- Checks for redundant import statements. -->
+                    <module name="GenericWhitespace"/>  <!-- Checks that the whitespace around the Generic tokens follow the typical convention. -->
+                  </module>
+                </module>
+              </checkstyleRules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
 
       <!-- JavaDoc configuration. -->
       <plugin>
@@ -768,12 +798,12 @@ Apache SIS is a free software, Java lang
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>build-helper-maven-plugin</artifactId>
-          <version>1.9.1</version>                              <!-- Last version compatible with JDK6. -->
+          <version>1.10</version>
         </plugin>
         <plugin>
-          <groupId>org.mortbay.jetty</groupId>
+          <groupId>org.eclipse.jetty</groupId>
           <artifactId>jetty-maven-plugin</artifactId>
-          <version>8.1.16.v20140903</version>                   <!-- Versions 9.0.* require JDK 7 -->
+          <version>9.2.13.v20150730</version>           <!-- Versions 9.3.* require JDK 8 -->
         </plugin>
       </plugins>
     </pluginManagement>

Modified: sis/trunk/src/main/javadoc/stylesheet.css
URL: http://svn.apache.org/viewvc/sis/trunk/src/main/javadoc/stylesheet.css?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/src/main/javadoc/stylesheet.css (original)
+++ sis/trunk/src/main/javadoc/stylesheet.css Wed Sep 28 09:59:44 2016
@@ -248,11 +248,6 @@ div.block pre, code, tt, dt code, table
   font-size:   1em;
 }
 
-h5 {
-  font-size: 110%;
-  margin-bottom: 3pt;
-}
-
 /* Appareance of links in the "Description" column of class and package summaries.
  * JDK style uses bold characters for the left column, which contains the class and
  * package names. But we do not want those bold characters to apply to the descriptions.

Modified: sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -158,7 +158,7 @@ final class LandsatReader {
             throws IOException, DataStoreException
     {
         this.listeners = listeners;
-        properties = new HashMap<String,String>();
+        properties = new HashMap<>();
         String line;
         while ((line = reader.readLine()) != null) {
             line = line.trim();

Modified: sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java [UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -108,16 +108,13 @@ public class LandsatStore extends DataSt
     @Override
     public Metadata getMetadata() throws DataStoreException {
         if (metadata == null && source != null) try {
-            BufferedReader reader = (source instanceof BufferedReader) ? (BufferedReader) source : new LineNumberReader(source);
-            try {
+            try (BufferedReader reader = (source instanceof BufferedReader) ? (BufferedReader) source : new LineNumberReader(source)) {
                 source = null;      // Will be closed at the end of this try-catch block.
                 final LandsatReader parser = new LandsatReader(reader, listeners);
                 metadata = parser.read();
                 if (metadata instanceof ModifiableMetadata) {
                     ((ModifiableMetadata) metadata).freeze();
                 }
-            } finally {
-                reader.close();
             }
         } catch (IOException e) {
             throw new DataStoreException(e);

Modified: sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java [UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -53,12 +53,10 @@ public class LandsatReaderTest extends T
     @Test
     public void testRead() throws IOException, DataStoreException {
         final Metadata actual;
-        final BufferedReader in = new BufferedReader(new InputStreamReader(
-                LandsatReaderTest.class.getResourceAsStream("LandsatTest.txt"), "UTF-8"));
-        try {
-            actual = new LandsatReader(in, new EmptyWarningListeners<LandsatReader>(Locale.US, Modules.EARTH_OBSERVATION)).read();
-        } finally {
-            in.close();
+        try (BufferedReader in = new BufferedReader(new InputStreamReader(
+                LandsatReaderTest.class.getResourceAsStream("LandsatTest.txt"), "UTF-8")))
+        {
+            actual = new LandsatReader(in, new EmptyWarningListeners<>(Locale.US, Modules.EARTH_OBSERVATION)).read();
         }
         final String text = formatNameAndValue(DefaultMetadata.castOrCopy(actual).asTreeTable());
         assertMultilinesEquals(

Modified: sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatStoreProviderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatStoreProviderTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatStoreProviderTest.java [UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatStoreProviderTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -26,7 +26,7 @@ import org.junit.Test;
 import static org.junit.Assert.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.StandardCharsets;
+import java.nio.charset.StandardCharsets;
 
 
 /**

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -90,7 +90,7 @@ final class Reader extends GeoTIFF {
      * Positions of each <cite>Image File Directory</cite> (IFD) in this file.
      * Those positions are fetched when first needed.
      */
-    private final List<ImageFileDirectory> imageFileDirectories = new ArrayList<ImageFileDirectory>();
+    private final List<ImageFileDirectory> imageFileDirectories = new ArrayList<>();
 
     /**
      * Entries having a value that can not be read immediately, but instead have a pointer
@@ -100,7 +100,7 @@ final class Reader extends GeoTIFF {
      * we use a {@code LinkedList} because we will perform frequent additions and removals,
      * but no random access.</div>
      */
-    private final LinkedList<DeferredEntry> deferredEntries = new LinkedList<DeferredEntry>();
+    private final LinkedList<DeferredEntry> deferredEntries = new LinkedList<>();
 
     /**
      * Whether {@link #deferredEntries} needs to be stored. This flag is set to {@code true} when
@@ -264,9 +264,7 @@ final class Reader extends GeoTIFF {
                              * without value (count = 0) - in principle illegal but we make this reader tolerant.
                              */
                             error = dir.addEntry(this, tag, type, count);
-                        } catch (ParseException e) {
-                            error = e;
-                        } catch (RuntimeException e) {
+                        } catch (ParseException | RuntimeException e) {
                             error = e;
                         }
                         if (error != null) {
@@ -330,9 +328,7 @@ final class Reader extends GeoTIFF {
                 Object error;
                 try {
                     error = entry.owner.addEntry(this, entry.tag, entry.type, entry.count);
-                } catch (ParseException e) {
-                    error = e;
-                } catch (RuntimeException e) {
+                } catch (ParseException | RuntimeException e) {
                     error = e;
                 }
                 if (error != null) {

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java [UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -26,8 +26,8 @@ import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.resources.Errors;
 
 // Branch-dependent imports
+import java.nio.charset.StandardCharsets;
 import org.apache.sis.internal.jdk8.JDK8;
-import org.apache.sis.internal.jdk7.StandardCharsets;
 
 
 /**

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -24,7 +24,7 @@ import org.apache.sis.measure.Units;
 import org.apache.sis.util.logging.WarningListeners;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -668,9 +668,7 @@ public final class ChannelDecoder extend
                     dates[i] = new Date(epoch + Math.round(converter.convert(value.doubleValue())));
                 }
             }
-        } catch (ConversionException e) {
-            listeners.warning(null, e);
-        } catch (IllegalArgumentException e) {
+        } catch (ConversionException | IllegalArgumentException e) {
             listeners.warning(null, e);
         }
         return dates;
@@ -705,7 +703,7 @@ public final class ChannelDecoder extend
              * grid dimensions which are the domain of the variable (i.e. the sources of the conversion
              * from grid coordinates to CRS coordinates).
              */
-            final Map<Dimension, List<VariableInfo>> dimToAxes = new IdentityHashMap<Dimension, List<VariableInfo>>();
+            final Map<Dimension, List<VariableInfo>> dimToAxes = new IdentityHashMap<>();
             for (final VariableInfo variable : variables) {
                 if (variable.isCoordinateSystemAxis()) {
                     for (final Dimension dimension : variable.dimensions) {
@@ -719,8 +717,8 @@ public final class ChannelDecoder extend
              * and consequently the same axes, so we will remember the previously created instances in order
              * to share them.
              */
-            final Set<VariableInfo> axes = new LinkedHashSet<VariableInfo>(4);
-            final Map<List<Dimension>, GridGeometryInfo> dimsToGG = new LinkedHashMap<List<Dimension>, GridGeometryInfo>();
+            final Set<VariableInfo> axes = new LinkedHashSet<>(4);
+            final Map<List<Dimension>, GridGeometryInfo> dimsToGG = new LinkedHashMap<>();
 nextVar:    for (final VariableInfo variable : variables) {
                 if (variable.isCoordinateSystemAxis()) {
                     continue;

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -280,7 +280,7 @@ final class MetadataReader {
     private static <T> Set<T> addIfNonNull(Set<T> collection, final T element) {
         if (element != null) {
             if (collection == null) {
-                collection = new LinkedHashSet<T>(4);
+                collection = new LinkedHashSet<>(4);
             }
             collection.add(element);
         }
@@ -616,7 +616,7 @@ final class MetadataReader {
         final String list = stringValue(standard ? STANDARD_NAME : KEYWORDS);
         DefaultKeywords keywords = null;
         if (list != null) {
-            final Set<InternationalString> words = new LinkedHashSet<InternationalString>();
+            final Set<InternationalString> words = new LinkedHashSet<>();
             for (String keyword : list.split(KEYWORD_SEPARATOR)) {
                 keyword = keyword.trim();
                 if (!keyword.isEmpty()) {
@@ -788,8 +788,7 @@ final class MetadataReader {
      * @throws IOException If an I/O operation was necessary but failed.
      */
     private Collection<DefaultCoverageDescription> createContentInfo() throws IOException {
-        final Map<List<String>, DefaultCoverageDescription> contents =
-                new HashMap<List<String>, DefaultCoverageDescription>(4);
+        final Map<List<String>, DefaultCoverageDescription> contents = new HashMap<>(4);
         final String processingLevel = stringValue(PROCESSING_LEVEL);
         for (final Variable variable : decoder.getVariables()) {
             if (!variable.isCoverage(2)) {

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -38,6 +38,9 @@ import org.apache.sis.util.logging.Warni
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.Version;
 
+// Branch-specific import
+import java.nio.file.NoSuchFileException;
+
 
 /**
  * The provider of {@link NetcdfStore} instances. Given a {@link StorageConnector} input,
@@ -162,7 +165,7 @@ public class NetcdfStoreProvider extends
                     if (cause instanceof DataStoreException) throw (DataStoreException) cause;
                     if (cause instanceof RuntimeException)   throw (RuntimeException)   cause;
                     if (cause instanceof Error)              throw (Error)              cause;
-                    if (cause instanceof FileNotFoundException) {
+                    if (cause instanceof FileNotFoundException || cause instanceof NoSuchFileException) {
                         /*
                          * Happen if the String argument uses any protocol not recognized by the UCAR library,
                          * in which case UCAR tries to open it as a file even if it is not a file. For example
@@ -230,9 +233,11 @@ public class NetcdfStoreProvider extends
             keepOpen = input;
         } catch (DataStoreException e) {
             final String path = storage.getStorageAs(String.class);
-            if (path != null) {
+            if (path != null) try {
                 decoder = createByReflection(listeners, path, false);
                 keepOpen = path;
+            } catch (IOException | DataStoreException s) {
+                e.addSuppressed(s);
             }
             throw e;
         } else {
@@ -285,7 +290,7 @@ public class NetcdfStoreProvider extends
             if (cause instanceof RuntimeException)   throw (RuntimeException)   cause;
             if (cause instanceof Error)              throw (Error)              cause;
             throw new UndeclaredThrowableException(cause); // Should never happen actually.
-        } catch (Exception e) { // (ReflectiveOperationException) on JDK7 branch.
+        } catch (ReflectiveOperationException e) {
             throw new AssertionError(e); // Should never happen (shall be verified by the JUnit tests).
         }
     }
@@ -321,7 +326,7 @@ public class NetcdfStoreProvider extends
                     createFromUCAR = wrapper.getConstructor(parameterTypes);
                     parameterTypes[1] = String.class;
                     createFromPath = wrapper.getConstructor(parameterTypes);
-                } catch (Exception e) { // (ReflectiveOperationException) on JDK7 branch.
+                } catch (ReflectiveOperationException e) {
                     throw new AssertionError(e);        // Should never happen (shall be verified by the JUnit tests).
                 }
             }

Modified: sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -46,7 +46,7 @@ public abstract strictfp class TestCase
     /**
      * A dummy list of listeners which can be given to the {@link Decoder} constructor.
      */
-    public static EmptyWarningListeners<Decoder> LISTENERS = new EmptyWarningListeners<Decoder>(null, Modules.NETCDF);
+    public static EmptyWarningListeners<Decoder> LISTENERS = new EmptyWarningListeners<>(null, Modules.NETCDF);
 
     /**
      * The {@code searchPath} argument value to be given to the {@link Decoder#setSearchPath(String[])}
@@ -57,7 +57,7 @@ public abstract strictfp class TestCase
     /**
      * The decoders cached by {@link #selectDataset(String)}.
      */
-    private static final Map<String,Decoder> DECODERS = new HashMap<String,Decoder>();
+    private static final Map<String,Decoder> DECODERS = new HashMap<>();
 
     /**
      * The decoder to test, which is set by {@link #selectDataset(String)}.
@@ -154,7 +154,7 @@ public abstract strictfp class TestCase
                     if (failure == null) {
                         failure = e;
                     } else {
-                        // On JDK7 branch: failure.addSuppressed(e);
+                        failure.addSuppressed(e);
                     }
                 }
                 it.remove();

Modified: sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -57,11 +57,8 @@ public final strictfp class MetadataRead
     @Test
     public void testEmbedded() throws IOException, DataStoreException {
         final Metadata metadata;
-        final Decoder input = ChannelDecoderTest.createChannelDecoder(NCEP);
-        try {
+        try (Decoder input = ChannelDecoderTest.createChannelDecoder(NCEP)) {
             metadata = new MetadataReader(input).read();
-        } finally {
-            input.close();
         }
         compareToExpected(metadata);
     }
@@ -75,11 +72,8 @@ public final strictfp class MetadataRead
     @Test
     public void testUCAR() throws IOException {
         final Metadata metadata;
-        final Decoder input = new DecoderWrapper(TestCase.LISTENERS, new NetcdfDataset(open(NCEP)));
-        try {
+        try (Decoder input = new DecoderWrapper(TestCase.LISTENERS, new NetcdfDataset(open(NCEP)))) {
             metadata = new MetadataReader(input).read();
-        } finally {
-            input.close();
         }
         compareToExpected(metadata);
     }

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/AutoChecker.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/AutoChecker.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/AutoChecker.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/AutoChecker.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -19,15 +19,13 @@ package org.apache.sis.internal.shapefil
 import java.lang.reflect.Constructor;
 import java.text.MessageFormat;
 import java.util.MissingResourceException;
+import java.util.Objects;
 import java.util.ResourceBundle;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.sis.util.logging.Logging;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
 
 /**
  * Base class for objets having auto-checking abilities

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -35,10 +35,6 @@ import org.apache.sis.util.logging.Loggi
 
 import com.esri.core.geometry.*;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
-
 /**
  * Reader of a Shapefile Binary content by the way of a {@link java.nio.MappedByteBuffer}
  *
@@ -127,17 +123,17 @@ public class ShapefileByteReader extends
 
         final int n = this.databaseFieldsDescriptors.size();
         final DefaultAttributeType<?>[] attributes = new DefaultAttributeType<?>[n + 1];
-        final Map<String, Object> properties = new HashMap<String, Object>(4);
+        final Map<String, Object> properties = new HashMap<>(4);
 
         // Load data field.
         for (int i = 0; i < n; i++) {
             properties.put(DefaultAttributeType.NAME_KEY, this.databaseFieldsDescriptors.get(i).getName());
-            attributes[i] = new DefaultAttributeType<String>(properties, String.class, 1, 1, null);
+            attributes[i] = new DefaultAttributeType<>(properties, String.class, 1, 1, null);
         }
 
         // Add geometry field.
         properties.put(DefaultAttributeType.NAME_KEY, GEOMETRY_NAME);
-        attributes[n] = new DefaultAttributeType<Geometry>(properties, Geometry.class, 1, 1, null);
+        attributes[n] = new DefaultAttributeType<>(properties, Geometry.class, 1, 1, null);
 
         // Add name.
         properties.put(DefaultAttributeType.NAME_KEY, name);
@@ -161,15 +157,14 @@ public class ShapefileByteReader extends
             return false;
         }
 
-        try {
-            FileInputStream fis = new FileInputStream(this.shapeFileIndex); FileChannel fc = fis.getChannel();
+        try(FileInputStream fis = new FileInputStream(this.shapeFileIndex); FileChannel fc = fis.getChannel()) {
             try {
                 int fsize = (int)fc.size();
                 MappedByteBuffer indexesByteBuffer = fc.map(FileChannel.MapMode.READ_ONLY, 0, fsize);
 
                 // Indexes entries follow.
-                this.indexes = new ArrayList<Integer>();
-                this.recordsLengths = new ArrayList<Integer>();
+                this.indexes = new ArrayList<>();
+                this.recordsLengths = new ArrayList<>();
                 indexesByteBuffer.position(100);
                 indexesByteBuffer.order(ByteOrder.BIG_ENDIAN);
 
@@ -185,8 +180,6 @@ public class ShapefileByteReader extends
                 log(Level.WARNING, "log.invalid_file_content_for_shapefile_index", this.shapeFileIndex.getAbsolutePath(), e.getMessage());
                 this.shapeFileIndex = null;
                 return false;
-            } finally {
-                fis.close();
             }
         }
         catch(FileNotFoundException e) {

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -22,12 +22,9 @@ import java.nio.charset.UnsupportedChars
 import java.text.MessageFormat;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Objects;
 import java.util.logging.Level;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
-
 /**
  * The Abstract Byte Reader.
  * @author  Marc Le Bihan
@@ -188,7 +185,7 @@ abstract class AbstractDbase3ByteReader
      */
     private String toCodePage(byte pageCodeBinaryValue) {
         // From http://trac.osgeo.org/gdal/ticket/2864
-        HashMap<Integer, String> knownConversions = new HashMap<Integer,String>();
+        HashMap<Integer, String> knownConversions = new HashMap<>();
         knownConversions.put(0x01, "cp437"); //  U.S. MS–DOS
         knownConversions.put(0x02, "cp850"); // International MS–DOS
         knownConversions.put(0x03, "cp1252"); // Windows ANSI

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/CommonByteReader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -19,14 +19,11 @@ package org.apache.sis.internal.shapefil
 import java.io.*;
 import java.nio.MappedByteBuffer;
 import java.nio.channels.FileChannel;
+import java.util.Objects;
 import java.util.logging.Level;
 
 import org.apache.sis.internal.shapefile.AutoChecker;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
-
 /**
  * Common byte reader.
  * @author  Marc Le Bihan
@@ -36,7 +33,7 @@ import org.apache.sis.internal.jdk7.Obje
  * @since   0.5
  * @module
  */
-public abstract class CommonByteReader<InvalidFormatException extends Exception, FNFException extends Exception> extends AutoChecker {
+public abstract class CommonByteReader<InvalidFormatException extends Exception, FNFException extends Exception> extends AutoChecker implements AutoCloseable  {
     /** The File. */
     private File file;
 
@@ -98,6 +95,7 @@ public abstract class CommonByteReader<I
      * Close the MappedByteReader.
      * @throws IOException if the close operation fails.
      */
+    @Override
     public void close() throws IOException {
         if (this.fc != null)
             this.fc.close();

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -20,15 +20,13 @@ import java.io.File;
 import java.sql.Connection;
 import java.sql.Driver;
 import java.sql.DriverPropertyInfo;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.logging.Logger;
 
 import org.apache.sis.internal.shapefile.jdbc.connection.DBFConnection;
 import org.apache.sis.internal.system.Modules;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
 
 /**
  * Database driver for DBF 3.
@@ -140,6 +138,7 @@ public class DBFDriver extends AbstractJ
     /**
      * The logger used by this driver.
      */
+    @Override
     public Logger getParentLogger() {
         return super.getLogger();
     }

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -40,9 +40,9 @@ import org.apache.sis.internal.jdk8.JDK8
  * @since   0.5
  * @module
  */
-public class MappedByteReader extends AbstractDbase3ByteReader {
+public class MappedByteReader extends AbstractDbase3ByteReader implements AutoCloseable {
     /** List of field descriptors. */
-    private List<DBase3FieldDescriptor> fieldsDescriptors = new ArrayList<DBase3FieldDescriptor>();
+    private List<DBase3FieldDescriptor> fieldsDescriptors = new ArrayList<>();
 
     /** Connection properties. */
     private Properties info;
@@ -62,6 +62,7 @@ public class MappedByteReader extends Ab
         if (this.info != null) {
             // Sometimes, DBF files have a wrong charset, or more often : none, and you have to specify it.
             String recordCharset = (String)this.info.get("record_charset");
+
             if (recordCharset != null) {
                 Charset cs = Charset.forName(recordCharset);
                 setCharset(cs);
@@ -110,6 +111,7 @@ public class MappedByteReader extends Ab
 
         boolean isEOF = (eofCheck == 0x1A);
         this.log(Level.FINER, "log.delete_status", getRowNum(), eofCheck, isEOF ? "EOF" : "Active");
+
         if (eofCheck == 0x1A) {
             return false;
         }
@@ -141,7 +143,7 @@ public class MappedByteReader extends Ab
         /* byte isDeleted = */ getByteBuffer().get(); // denotes whether deleted or current
 
         // read first part of record
-        HashMap<String, byte[]> fieldsValues = new HashMap<String, byte[]>();
+        HashMap<String, byte[]> fieldsValues = new HashMap<>();
 
         for (DBase3FieldDescriptor fd : this.fieldsDescriptors) {
             byte[] data = new byte[fd.getLength()];
@@ -149,6 +151,7 @@ public class MappedByteReader extends Ab
 
             // Trim the bytes right.
             int length = data.length;
+
             while (length != 0 && JDK8.toUnsignedInt(data[length - 1]) <= ' ') {
                 length--;
             }

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -68,6 +68,7 @@ abstract class AbstractConnection extend
     /**
      * Unsupported by default.
      */
+    @Override
     public String getSchema() throws SQLException {
         throw unsupportedOperation("getSchema");
     }
@@ -75,6 +76,7 @@ abstract class AbstractConnection extend
     /**
      * Unsupported by default.
      */
+    @Override
     public void setSchema(String schema) throws SQLException {
         throw unsupportedOperation("setSchema");
     }
@@ -393,6 +395,7 @@ abstract class AbstractConnection extend
     /**
      * Defaults to 0, which means there is no limit.
      */
+    @Override
     public int getNetworkTimeout() {
         return 0; // Means there is no limt.
     }
@@ -400,6 +403,7 @@ abstract class AbstractConnection extend
     /**
      * Unsupported by default.
      */
+    @Override
     public void setNetworkTimeout(Executor executor, int milliseconds) {
         logUnsupportedOperation("setNetworkTimeout");
     }
@@ -407,6 +411,7 @@ abstract class AbstractConnection extend
     /**
      * Unsupported by default.
      */
+    @Override
     public void abort(Executor executor) throws SQLException {
         throw unsupportedOperation("abort");
     }

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -28,9 +28,6 @@ import org.apache.sis.internal.shapefile
 import org.apache.sis.internal.shapefile.jdbc.resultset.*;
 import org.apache.sis.internal.shapefile.jdbc.statement.DBFStatement;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
 
 /**
  * Connection to a DBF database.
@@ -44,7 +41,7 @@ public class DBFConnection extends Abstr
     final File databaseFile;
 
     /** Opened statement. */
-    private HashSet<DBFStatement> openedStatements = new HashSet<DBFStatement>();
+    private HashSet<DBFStatement> openedStatements = new HashSet<>();
 
     /** ByteReader. */
     private Dbase3ByteReader byteReader;
@@ -242,7 +239,7 @@ public class DBFConnection extends Abstr
                 }
             }
         }
-        catch(java.sql.SQLException e) {
+        catch(SQLNoResultException e) {
             // if we run out of bound of the ResultSet, the boolean returned by next() has not been checked well, and it's an internal error.
             rs.close();
             throw new RuntimeException(e.getMessage(), e);
@@ -275,7 +272,7 @@ public class DBFConnection extends Abstr
             try {
                 rs.next();
             }
-            catch(java.sql.SQLException e) {
+            catch(SQLNoResultException e) {
                 // We encounter an internal API error in this case.
                 rs.close();
                 throw new RuntimeException(e.getMessage(), e);

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/AbstractDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/AbstractDatabaseMetaData.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/AbstractDatabaseMetaData.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/AbstractDatabaseMetaData.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -119,7 +119,7 @@ public abstract class AbstractDatabaseMe
     /**
      * @see java.sql.DatabaseMetaData#getPseudoColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
      */
-    public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
+    @Override public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
         throw unsupportedOperation("getPseudoColumns", catalog, schemaPattern, tableNamePattern, columnNamePattern);
     }
 

Modified: sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java [UTF-8] (original)
+++ sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/metadata/DBFDatabaseMetaData.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -19,16 +19,13 @@ package org.apache.sis.internal.shapefil
 import java.io.File;
 import java.sql.*;
 import java.util.Arrays;
+import java.util.Objects;
 
 import org.apache.sis.internal.shapefile.jdbc.SQLConnectionClosedException;
 import org.apache.sis.internal.shapefile.jdbc.connection.DBFConnection;
 import org.apache.sis.internal.shapefile.jdbc.resultset.*;
 import org.apache.sis.internal.shapefile.jdbc.statement.DBFStatement;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
-
 /**
  * Database Metadata.
  * @author Marc LE BIHAN
@@ -76,11 +73,8 @@ public class DBFDatabaseMetaData extends
      */
     @Override
     public ResultSet getColumns(@SuppressWarnings("unused") String catalog, @SuppressWarnings("unused") String schemaPattern, @SuppressWarnings("unused") String tableNamePattern, @SuppressWarnings("unused") String columnNamePattern) throws SQLConnectionClosedException {
-        DBFStatement stmt = (DBFStatement)this.connection.createStatement();
-        try {
+        try(DBFStatement stmt = (DBFStatement)this.connection.createStatement()) {
             return new DBFBuiltInMemoryResultSetForColumnsListing(stmt, this.connection.getFieldsDescriptors());
-        } finally {
-            stmt.close();
         }
     }
 
@@ -1292,7 +1286,7 @@ public class DBFDatabaseMetaData extends
     /**
      * @see java.sql.DatabaseMetaData#generatedKeyAlwaysReturned()
      */
-    public boolean generatedKeyAlwaysReturned() {
+    @Override public boolean generatedKeyAlwaysReturned() {
         logStep("generatedKeyAlwaysReturned");
         return false;
     }



Mime
View raw message