sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762629 [11/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/util/Locales.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -24,10 +24,10 @@ import java.util.TreeMap;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.MissingResourceException;
+import java.util.IllformedLocaleException;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import org.apache.sis.util.logging.Logging;
-import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.system.Loggers;
 
 import static org.apache.sis.util.CharSequences.trimWhitespaces;
@@ -58,7 +58,7 @@ public final class Locales extends Stati
     private static final Map<Locale,Locale> POOL;
     static {
         final Locale[] locales = Locale.getAvailableLocales();
-        POOL = new HashMap<Locale,Locale>(hashMapCapacity(locales.length));
+        POOL = new HashMap<>(hashMapCapacity(locales.length));
         for (final Locale lc : locales) {
             POOL.put(lc, lc);
         }
@@ -104,7 +104,7 @@ public final class Locales extends Stati
     private static final short[] ISO3, ISO2;
     static {
         final Short CONFLICT = 0;                           // Sentinal value for conflicts (paranoiac safety).
-        final Map<Short,Short> map = new TreeMap<Short,Short>();
+        final Map<Short,Short> map = new TreeMap<>();
         for (final Locale locale : POOL.values()) {
             short type = LANGUAGE;                          // 0 for language, or leftmost bit set for country.
             do { // Executed exactly twice: once for language, than once for country.
@@ -211,7 +211,7 @@ filter: for (final Locale locale : local
      * @return The languages, without country or variant information.
      */
     private static Locale[] getLanguages(final Locale... locales) {
-        final Set<String> codes = new LinkedHashSet<String>(hashMapCapacity(locales.length));
+        final Set<String> codes = new LinkedHashSet<>(hashMapCapacity(locales.length));
         for (final Locale locale : locales) {
             codes.add(locale.getLanguage());
         }
@@ -234,11 +234,11 @@ filter: for (final Locale locale : local
      *
      * @param  code The language code, optionally followed by country code and variant.
      * @return The language for the given code (never {@code null}).
-     * @throws RuntimeException If the given code is not valid ({@code IllformedLocaleException} on the JDK7 branch).
+     * @throws IllformedLocaleException If the given code is not valid.
      *
      * @see Locale#forLanguageTag(String)
      */
-    public static Locale parse(final String code) {
+    public static Locale parse(final String code) throws IllformedLocaleException {
         return parse(code, 0);
     }
 
@@ -256,22 +256,24 @@ filter: for (final Locale locale : local
      * @param  code The language code, which may be followed by country code.
      * @param  fromIndex Index of the first character to parse.
      * @return The language for the given code (never {@code null}).
-     * @throws RuntimeException If the given code is not valid ({@code IllformedLocaleException} on the JDK7 branch).
+     * @throws IllformedLocaleException If the given code is not valid.
      *
      * @see Locale#forLanguageTag(String)
      * @see org.apache.sis.util.iso.Types#toInternationalString(Map, String)
      */
-    public static Locale parse(final String code, final int fromIndex) {
+    public static Locale parse(final String code, final int fromIndex) throws IllformedLocaleException {
         ArgumentChecks.ensureNonNull("code", code);
         ArgumentChecks.ensurePositive("fromIndex", fromIndex);
         int p1 = code.indexOf('_', fromIndex);
-        // JDK7 branch contains a code here with the following comment:
+        int i  = code.indexOf('-', fromIndex);
+        if (i >= 0 && (p1 < 0 || i < p1)) {
             /*
              * IETF BCP 47 language tag string. This syntax uses the '-' separator instead of '_'.
              * Note that the '_' character is illegal for the language code, but is legal for the
              * variant. Consequently we require the '-' character to appear before the first '_'.
              */
-        // End of JDK7-specific.
+            return unique(new Locale.Builder().setLanguageTag(code).build());
+        }
         /*
          * Old syntax (e.g. "en_US"). Split in (language, country, variant) components,
          * then convert the 3-letters codes to the 2-letters ones.
@@ -292,29 +294,7 @@ filter: for (final Locale locale : local
         language = (String) trimWhitespaces(code, fromIndex, p1);
         language = toISO2(language, LANGUAGE);
         country  = toISO2(country,  COUNTRY);
-        if (language.length() > 8 || !isAlphaNumeric(language) ||
-             country.length() > 3 || !isAlphaNumeric(country))
-        {
-            throw new RuntimeException( // IllformedLocaleException (indirectly) on the JDK7 branch.
-                    Errors.format(Errors.Keys.IllegalLanguageCode_1, code.substring(fromIndex)));
-        }
-        return unique(new Locale(language, country, variant));
-    }
-
-    /**
-     * Returns {@code true} if the given text contains only Latin alphabetic or numeric characters.
-     * We use this method for simulating the check performed by {@code Locale.Builder} on JDK7. Our
-     * test is not as accurate as the JDK7 one however - we are more permissive. But it is not our
-     * intend to reproduce all the JDK7 syntax checks here.
-     */
-    private static boolean isAlphaNumeric(final String text) {
-        for (int i=text.length(); --i>=0;) {
-            final char c = text.charAt(i);
-            if (!(c >= 'A' && c <= 'Z') && !(c >= 'a' && c <= 'z') && !(c >= '0' && c <= '9')) {
-                return false;
-            }
-        }
-        return true;
+        return unique(new Locale.Builder().setLanguage(language).setRegion(country).setVariant(variant).build());
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -65,7 +65,7 @@ public final class Numbers extends Stati
      * But maybe the most interesting property is that it allocates less objects since {@code IdentityHashMap}
      * implementation doesn't need the chain of objects created by {@code HashMap}.</div>
      */
-    private static final Map<Class<?>,Numbers> MAPPING = new IdentityHashMap<Class<?>,Numbers>(11);
+    private static final Map<Class<?>,Numbers> MAPPING = new IdentityHashMap<>(11);
     static {
         new Numbers(BigDecimal.class, true, false, BIG_DECIMAL);
         new Numbers(BigInteger.class, false, true, BIG_INTEGER);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -81,7 +81,7 @@ public final class ObjectConverters exte
      */
     public static <T> ObjectConverter<T,T> identity(final Class<T> type) {
         ArgumentChecks.ensureNonNull("type", type);
-        return new IdentityConverter<T,T>(type, type, null).unique();
+        return new IdentityConverter<>(type, type, null).unique();
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -25,7 +25,7 @@ import java.util.Set;
 import org.apache.sis.util.collection.CheckedContainer;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -250,7 +250,7 @@ public final class Utilities extends Sta
              * compared up to this point.
              */
             // Creates a copy of REMAINING elements in the first collection.
-            final LinkedList<Object> copy = new LinkedList<Object>();
+            final LinkedList<Object> copy = new LinkedList<>();
             copy.add(element1);
             while (it1.hasNext()) {
                 copy.add(it1.next());

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -67,9 +67,7 @@ import org.apache.sis.internal.jdk8.Supp
  *                     return createMyObject(key);
  *                 }
  *             });
- *         } catch (MyCheckedException e) {
- *             throw e;
- *         } catch (RuntimeException e) {
+ *         } catch (MyCheckedException | RuntimeException e) {
  *             throw e;
  *         } catch (Exception e) {
  *             throw new UndeclaredThrowableException(e);
@@ -214,8 +212,8 @@ public class Cache<K,V> extends Abstract
         ArgumentChecks.ensureStrictlyPositive("initialCapacity", initialCapacity);
         ArgumentChecks.ensurePositive("costLimit", costLimit);
         initialCapacity = Containers.hashMapCapacity(initialCapacity);
-        this.map        = new ConcurrentHashMap<K,Object>(initialCapacity);
-        this.costs      = new LinkedHashMap<K,Integer>((int) Math.min(initialCapacity, costLimit), 0.75f, true);
+        this.map        = new ConcurrentHashMap<>(initialCapacity);
+        this.costs      = new LinkedHashMap<>((int) Math.min(initialCapacity, costLimit), 0.75f, true);
         this.costLimit  = costLimit;
         this.soft       = soft;
     }
@@ -480,7 +478,7 @@ public class Cache<K,V> extends Abstract
                         ref.clear();                        // Prevents the reference from being enqueued.
                         DelayedExecutor.schedule(new Strong(key, result));
                     }
-                    return new Simple<V>(result);
+                    return new Simple<>(result);
                 }
                 /*
                  * The weak reference is invalid but not yet discarded (it looks like that this
@@ -522,7 +520,7 @@ public class Cache<K,V> extends Abstract
                      * not be cached. This is okay since the value that we really want to cache is
                      * CoordinateOperation, which is associated to the first occurrence of that key.
                      */
-                    return new Simple<V>(null);
+                    return new Simple<>(null);
                 }
                 throw new IllegalStateException(Errors.format(Errors.Keys.RecursiveCreateCallForKey_1, key));
             }
@@ -535,7 +533,7 @@ public class Cache<K,V> extends Abstract
         assert !isReservedType(value) : value;
         @SuppressWarnings("unchecked")
         final V result = (V) value;
-        return new Simple<V>(result);
+        return new Simple<>(result);
     }
 
     /**
@@ -786,8 +784,8 @@ public class Cache<K,V> extends Abstract
                     final Object oldValue = map.get(oldKey);
                     if (oldValue != null && !isReservedType(oldValue)) {
                         @SuppressWarnings("unchecked")
-                        final Reference<V> ref = soft ? new Soft<K,V>(map, oldKey, (V) oldValue)
-                                                      : new Weak<K,V>(map, oldKey, (V) oldValue);
+                        final Reference<V> ref = soft ? new Soft<>(map, oldKey, (V) oldValue)
+                                                      : new Weak<>(map, oldKey, (V) oldValue);
                         if (!map.replace(oldKey, oldValue, ref)) {
                             ref.clear(); // Prevents the reference to be enqueued.
                         }
@@ -869,7 +867,7 @@ public class Cache<K,V> extends Abstract
     @Override
     public Set<Entry<K,V>> entrySet() {
         final Set<Entry<K,V>> es = entries;
-        return (es != null) ? es : (entries = new CacheEntries<K,V>(map.entrySet()));
+        return (es != null) ? es : (entries = new CacheEntries<>(map.entrySet()));
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CacheEntries.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CacheEntries.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CacheEntries.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CacheEntries.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -80,7 +80,7 @@ final class CacheEntries<K,V> extends Ab
      */
     @Override
     public Iterator<Map.Entry<K,V>> iterator() {
-        return new Iter<K,V>(entries.iterator());
+        return new Iter<>(entries.iterator());
     }
 
     /**
@@ -123,7 +123,7 @@ final class CacheEntries<K,V> extends Ab
                         continue;
                     }
                 }
-                next = new SimpleEntry<K,V>(entry.getKey(), (V) value);
+                next = new SimpleEntry<>(entry.getKey(), (V) value);
                 return;
             }
             next = null;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -72,7 +72,7 @@ public class CodeListSet<E extends CodeL
      * same code list type, this allows those instances to share the same arrays.
      */
     @SuppressWarnings("rawtypes")
-    private static final WeakHashSet<CodeList[]> POOL = new WeakHashSet<CodeList[]>(CodeList[].class);
+    private static final WeakHashSet<CodeList[]> POOL = new WeakHashSet<>(CodeList[].class);
 
     /**
      * The type of code list elements.

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -93,6 +93,7 @@ public final class Containers extends St
      *
      * @see java.util.Arrays#asList(Object[])
      */
+    @SafeVarargs
     public static <E> List<? extends E> unmodifiableList(final E... array) {
         return UnmodifiableArrayList.wrap(array);
     }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -33,7 +33,7 @@ import static org.apache.sis.util.collec
 import static org.apache.sis.util.collection.Containers.hashMapCapacity;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -157,7 +157,7 @@ public class DefaultTreeTable implements
         switch (columns.length) {
             case 0:  map = Collections.emptyMap(); break;
             case 1:  map = null; break; // Will be created inside the loop (common case).
-            default: map = new LinkedHashMap<TableColumn<?>,Integer>(hashMapCapacity(columns.length)); break;
+            default: map = new LinkedHashMap<>(hashMapCapacity(columns.length)); break;
         }
         for (int i=0; i<columns.length; i++) {
             final TableColumn<?> column = columns[i];

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedMap.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedMap.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedMap.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -117,14 +117,14 @@ class DerivedMap<SK,SV,K,V> extends Abst
         final Set<FunctionProperty> vp = valueConverter.properties();
         if (kp.contains(FunctionProperty.INVERTIBLE)) {
             if (vp.contains(FunctionProperty.INVERTIBLE)) {
-                return new Invertible<SK,SV,K,V>(storage, keyConverter, valueConverter);
+                return new Invertible<>(storage, keyConverter, valueConverter);
             }
-            return new InvertibleKey<SK,SV,K,V>(storage, keyConverter, valueConverter);
+            return new InvertibleKey<>(storage, keyConverter, valueConverter);
         }
         if (vp.contains(FunctionProperty.INVERTIBLE)) {
-            return new InvertibleValue<SK,SV,K,V>(storage, keyConverter, valueConverter);
+            return new InvertibleValue<>(storage, keyConverter, valueConverter);
         }
-        return new DerivedMap<SK,SV,K,V>(storage, keyConverter, valueConverter);
+        return new DerivedMap<>(storage, keyConverter, valueConverter);
     }
 
     /**
@@ -293,7 +293,7 @@ class DerivedMap<SK,SV,K,V> extends Abst
         @Override
         public ObjectConverter<Entry<K,V>, Entry<SK,SV>> inverse() {
             if (inverse == null) {
-                inverse = new DerivedMap<K,V,SK,SV>(null, keyInverse, valueInverse);
+                inverse = new DerivedMap<>(null, keyInverse, valueInverse);
             }
             return inverse;
         }
@@ -363,7 +363,7 @@ class DerivedMap<SK,SV,K,V> extends Abst
     public final Entry<K,V> apply(final Entry<SK,SV> entry) {
         final K key   =   keyConverter.apply(entry.getKey());
         final V value = valueConverter.apply(entry.getValue());
-        return (key != null) ? new SimpleEntry<K,V>(key, value) : null;
+        return (key != null) ? new SimpleEntry<>(key, value) : null;
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -87,11 +87,11 @@ class DerivedSet<S,E> extends SetOfUnkno
         final Set<FunctionProperty> properties = converter.properties();
         if (properties.contains(FunctionProperty.INVERTIBLE)) {
             if (FunctionProperty.isBijective(properties)) {
-                return new Bijective<S,E>(storage, converter);
+                return new Bijective<>(storage, converter);
             }
-            return new Invertible<S,E>(storage, converter);
+            return new Invertible<>(storage, converter);
         }
-        return new DerivedSet<S,E>(storage, converter);
+        return new DerivedSet<>(storage, converter);
     }
 
     /**
@@ -121,7 +121,7 @@ class DerivedSet<S,E> extends SetOfUnkno
      */
     @Override
     public final Iterator<E> iterator() {
-        return new DerivedIterator<S,E>(storage.iterator(), converter);
+        return new DerivedIterator<>(storage.iterator(), converter);
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -292,7 +292,7 @@ public class RangeSet<E extends Comparab
         if (Number.class.isAssignableFrom(elementType)) {
             return new Numeric(elementType, isMinIncluded, isMaxIncluded);
         }
-        return new RangeSet<E>(elementType, isMinIncluded, isMaxIncluded);
+        return new RangeSet<>(elementType, isMinIncluded, isMaxIncluded);
     }
 
     /**
@@ -434,14 +434,13 @@ public class RangeSet<E extends Comparab
      */
     final int binarySearch(final E value, final int lower, final int upper) {
         switch (elementCode) {
-            // The convolved casts below are for working around a JDK6 compiler error which does not occur with the JDK7 compiler.
-            case DOUBLE:    return Arrays.binarySearch((double[]) array, lower, upper, ((Double)    ((Comparable) value)).doubleValue());
-            case FLOAT:     return Arrays.binarySearch((float []) array, lower, upper, ((Float)     ((Comparable) value)).floatValue ());
-            case LONG:      return Arrays.binarySearch((long  []) array, lower, upper, ((Long)      ((Comparable) value)).longValue  ());
-            case INTEGER:   return Arrays.binarySearch((int   []) array, lower, upper, ((Integer)   ((Comparable) value)).intValue   ());
-            case SHORT:     return Arrays.binarySearch((short []) array, lower, upper, ((Short)     ((Comparable) value)).shortValue ());
-            case BYTE:      return Arrays.binarySearch((byte  []) array, lower, upper, ((Byte)      ((Comparable) value)).byteValue  ());
-            case CHARACTER: return Arrays.binarySearch((char  []) array, lower, upper, ((Character) ((Comparable) value)).charValue  ());
+            case DOUBLE:    return Arrays.binarySearch((double[]) array, lower, upper, (Double)    value);
+            case FLOAT:     return Arrays.binarySearch((float []) array, lower, upper, (Float)     value);
+            case LONG:      return Arrays.binarySearch((long  []) array, lower, upper, (Long)      value);
+            case INTEGER:   return Arrays.binarySearch((int   []) array, lower, upper, (Integer)   value);
+            case SHORT:     return Arrays.binarySearch((short []) array, lower, upper, (Short)     value);
+            case BYTE:      return Arrays.binarySearch((byte  []) array, lower, upper, (Byte)      value);
+            case CHARACTER: return Arrays.binarySearch((char  []) array, lower, upper, (Character) value);
             default:        return Arrays.binarySearch((Object[]) array, lower, upper,             value);
         }
     }
@@ -931,7 +930,7 @@ public class RangeSet<E extends Comparab
             throw new IllegalArgumentException(Errors.format(
                     Errors.Keys.IllegalArgumentValue_2, "upper", upper));
         }
-        return intersect(new Range<E>(elementType,
+        return intersect(new Range<>(elementType,
                 lower.getMinValue(),  lower.isMinIncluded(),
                 maxValue, !upper.isMinIncluded()));
     }
@@ -956,7 +955,7 @@ public class RangeSet<E extends Comparab
             throw new IllegalArgumentException(Errors.format(
                     Errors.Keys.IllegalArgumentValue_2, "upper", upper));
         }
-        return intersect(new Range<E>(elementType, null, false, maxValue, !upper.isMinIncluded()));
+        return intersect(new Range<>(elementType, null, false, maxValue, !upper.isMinIncluded()));
     }
 
     /**
@@ -974,7 +973,7 @@ public class RangeSet<E extends Comparab
     @Override
     public SortedSet<Range<E>> tailSet(final Range<E> lower) {
         ArgumentChecks.ensureNonNull("lower", lower);
-        return intersect(new Range<E>(elementType, lower.getMinValue(), lower.isMinIncluded(), null, false));
+        return intersect(new Range<>(elementType, lower.getMinValue(), lower.isMinIncluded(), null, false));
     }
 
     /**
@@ -1508,7 +1507,7 @@ public class RangeSet<E extends Comparab
      * @return The new range for the given values.
      */
     protected Range<E> newRange(final E lower, final E upper) {
-        return new Range<E>(elementType, lower, isMinIncluded, upper, isMaxIncluded);
+        return new Range<>(elementType, lower, isMinIncluded, upper, isMaxIncluded);
     }
 
     /**
@@ -1525,7 +1524,7 @@ public class RangeSet<E extends Comparab
 
         @Override
         protected Range<E> newRange(final E lower, final E upper) {
-            return new NumberRange<E>(elementType, lower, isMinIncluded, upper, isMaxIncluded);
+            return new NumberRange<>(elementType, lower, isMinIncluded, upper, isMaxIncluded);
         }
     }
 

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -104,7 +104,7 @@ public class TableColumn<V> implements C
      * the column elements are typically instances of {@link String} or {@link InternationalString},
      * depending on whether the data provide localization support or not.
      */
-    public static final TableColumn<CharSequence> NAME = new Constant<CharSequence>("NAME",
+    public static final TableColumn<CharSequence> NAME = new Constant<>("NAME",
             CharSequence.class, Vocabulary.Keys.Name);
 
     /**
@@ -112,7 +112,7 @@ public class TableColumn<V> implements C
      * The column {@linkplain #getHeader() header} is <cite>"Identifier"</cite> (eventually localized)
      * and the column elements are instances of {@link String}.
      */
-    public static final TableColumn<String> IDENTIFIER = new Constant<String>("IDENTIFIER",
+    public static final TableColumn<String> IDENTIFIER = new Constant<>("IDENTIFIER",
             String.class, Vocabulary.Keys.Identifier);
 
     /**
@@ -120,7 +120,7 @@ public class TableColumn<V> implements C
      * The column {@linkplain #getHeader() header} is <cite>"Index"</cite> (eventually localized)
      * and the column elements are instances of {@link Integer}.
      */
-    public static final TableColumn<Integer> INDEX = new Constant<Integer>("INDEX",
+    public static final TableColumn<Integer> INDEX = new Constant<>("INDEX",
             Integer.class, Vocabulary.Keys.Index);
 
     /**
@@ -128,7 +128,7 @@ public class TableColumn<V> implements C
      * The column {@linkplain #getHeader() header} is <cite>"Type"</cite> (eventually localized).
      */
     @SuppressWarnings("unchecked")
-    public static final TableColumn<Class<?>> TYPE = new Constant<Class<?>>("TYPE",
+    public static final TableColumn<Class<?>> TYPE = new Constant<>("TYPE",
             (Class) Class.class, Vocabulary.Keys.Type);
 
     /**
@@ -139,7 +139,7 @@ public class TableColumn<V> implements C
      * @see #VALUE_AS_TEXT
      * @see #VALUE_AS_NUMBER
      */
-    public static final TableColumn<Object> VALUE = new Constant<Object>("VALUE",
+    public static final TableColumn<Object> VALUE = new Constant<>("VALUE",
             Object.class, Vocabulary.Keys.Value);
 
     /**
@@ -148,14 +148,14 @@ public class TableColumn<V> implements C
      * the column elements are typically instances of {@link String} or {@link InternationalString},
      * depending on whether the data provide localization support or not.
      */
-    public static final TableColumn<CharSequence> VALUE_AS_TEXT = new Constant<CharSequence>("VALUE_AS_TEXT",
+    public static final TableColumn<CharSequence> VALUE_AS_TEXT = new Constant<>("VALUE_AS_TEXT",
             CharSequence.class, Vocabulary.Keys.Value);
 
     /**
      * Frequently-used constant for a column of object numerical values.
      * The column {@linkplain #getHeader() header} is <cite>"Value"</cite> (eventually localized).
      */
-    public static final TableColumn<Number> VALUE_AS_NUMBER = new Constant<Number>("VALUE_AS_NUMBER",
+    public static final TableColumn<Number> VALUE_AS_NUMBER = new Constant<>("VALUE_AS_NUMBER",
             Number.class, Vocabulary.Keys.Value);
 
     /**
@@ -237,7 +237,7 @@ public class TableColumn<V> implements C
         private Object readResolve() throws InvalidObjectException {
             try {
                 return TableColumn.class.getField(field).get(null);
-            } catch (Exception cause) { // (ReflectiveOperationException) on JDK7 branch.
+            } catch (ReflectiveOperationException cause) {
                 InvalidObjectException e = new InvalidObjectException(cause.toString());
                 e.initCause(cause);
                 throw e;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.List;
 import java.util.Locale;
 import java.util.TimeZone;
+import java.util.Currency;
 import java.io.IOException;
 import java.text.Format;
 import java.text.ParsePosition;
@@ -291,7 +292,7 @@ public class TreeTableFormat extends Tab
      * Returns the locale to use for code lists, international strings and exception messages.
      */
     final Locale getDisplayLocale() {
-        return getLocale(); // Implemented as getLocale(Locale.Category.DISPLAY) on the JDK7 branch.
+        return getLocale(Locale.Category.DISPLAY);
     }
 
     /**
@@ -677,6 +678,9 @@ public class TreeTableFormat extends Tab
             } else if (value instanceof Charset) {
                 final Locale locale = getDisplayLocale();
                 text = (locale != Locale.ROOT) ? ((Charset) value).displayName(locale) : ((Charset) value).name();
+            } else if (value instanceof Currency) {
+                final Locale locale = getDisplayLocale();
+                text = (locale != Locale.ROOT) ? ((Currency) value).getDisplayName(locale) : value.toString();
             } else if (value instanceof Record) {
                 formatCollection(((Record) value).getAttributes().values(), recursive);
                 return;
@@ -828,7 +832,7 @@ public class TreeTableFormat extends Tab
             columns = c.toArray(new TableColumn<?>[c.size()]);
         }
         if (parentObjects == null) {
-            parentObjects = new IdentityHashMap<Object,Object>();
+            parentObjects = new IdentityHashMap<>();
         }
         try {
             final Writer out = new Writer(toAppendTo, columns, parentObjects);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTables.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Locale;
 import java.io.File;
+import java.nio.file.Path;
 import java.text.ParseException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.Static;
@@ -132,6 +133,38 @@ public final class TreeTables extends St
      *
      * @param  from   The root node from which to start the search.
      * @param  column The column containing the file name.
+     * @param  path   The path for which to find or create a node.
+     * @return The node for the given path, either as an existing node or a new node.
+     */
+    public static TreeTable.Node nodeForPath(TreeTable.Node from,
+            final TableColumn<? super String> column, final Path path)
+    {
+        final Path parent = path.getParent();
+        if (parent != null) {
+            from = nodeForPath(from, column, parent);
+        }
+        Path filename = path.getFileName();
+        if (filename == null) {
+            filename = path.getRoot();
+        }
+        final String name = filename.toString();
+        for (final TreeTable.Node child : from.getChildren()) {
+            if (name.equals(child.getValue(column))) {
+                return child;
+            }
+        }
+        from = from.newChild();
+        from.setValue(column, name);
+        return from;
+    }
+
+    /**
+     * Finds the node for the given file, or creates a new node if none exists.
+     * This method performs the same work than the above variant, but working on
+     * {@code File} instances rather than {@code Path}.
+     *
+     * @param  from   The root node from which to start the search.
+     * @param  column The column containing the file name.
      * @param  path   The file for which to find or create a node.
      * @return The node for the given file, either as an existing node or a new node.
      */

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

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/WeakValueHashMap.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -34,7 +34,7 @@ import org.apache.sis.util.resources.Err
 import static org.apache.sis.util.collection.WeakEntry.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -541,7 +541,7 @@ public class WeakValueHashMap<K,V> exten
                 final Entry[] table = WeakValueHashMap.this.table;
                 for (Entry el : table) {
                     while (el != null) {
-                        final Map.Entry<K,V> entry = new SimpleEntry<K,V>(el);
+                        final Map.Entry<K,V> entry = new SimpleEntry<>(el);
                         if (entry.getValue() != null) {
                             elements[index++] = entry;
                         }

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

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultInternationalString.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -38,7 +38,7 @@ import org.apache.sis.util.collection.Co
 import org.apache.sis.internal.system.Modules;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -118,7 +118,7 @@ public class DefaultInternationalString
             if (!it.hasNext()) {
                 localeMap = Collections.singletonMap(entry.getKey(), entry.getValue());
             } else {
-                localeMap = new LinkedHashMap<Locale,String>(strings);
+                localeMap = new LinkedHashMap<>(strings);
                 // If HashMap is replaced by an other type, please revisit 'getLocales()'.
             }
         }
@@ -148,7 +148,7 @@ public class DefaultInternationalString
             }
             case 1: {
                 // If HashMap is replaced by an other type, please revisit 'getLocales()'.
-                localeMap = new LinkedHashMap<Locale,String>(localeMap);
+                localeMap = new LinkedHashMap<>(localeMap);
                 localeSet = null;
                 break;
             }

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

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

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -105,7 +105,7 @@ public class DefaultNameFactory extends
      * Creates a new factory.
      */
     public DefaultNameFactory() {
-        pool = new WeakHashSet<GenericName>(GenericName.class);
+        pool = new WeakHashSet<>(GenericName.class);
     }
 
     /**
@@ -296,7 +296,7 @@ public class DefaultNameFactory extends
             separator = DEFAULT_SEPARATOR_STRING;
         }
         final int s = separator.length();
-        final List<String> names = new ArrayList<String>();
+        final List<String> names = new ArrayList<>();
         int lower = 0;
         final String string = name.toString();
         while (true) {

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -33,7 +33,7 @@ import org.apache.sis.internal.util.Unmo
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -175,7 +175,7 @@ public class DefaultNameSpace implements
      * Initializes the transient fields.
      */
     private void init() {
-        childs = new WeakValueHashMap<String,Object>(String.class);
+        childs = new WeakValueHashMap<>(String.class);
     }
 
     /**

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

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -135,8 +135,8 @@ public class DefaultRecordSchema impleme
         }
         this.nameFactory    = nameFactory;
         this.namespace      = nameFactory.createNameSpace(nameFactory.createLocalName(parent, schemaName), null);
-        this.description    = new WeakValueHashMap<TypeName,RecordType>(TypeName.class);
-        this.attributeTypes = new ConcurrentHashMap<Class<?>,Type>();
+        this.description    = new WeakValueHashMap<>(TypeName.class);
+        this.attributeTypes = new ConcurrentHashMap<>();
     }
 
     /**
@@ -204,7 +204,6 @@ public class DefaultRecordSchema impleme
      * @param  valueClass The value class to represent as an attribute type.
      * @return Attribute type for the given value class.
      */
-    @SuppressWarnings({"unchecked", "rawtypes"})
     final Type toAttributeType(final Class<?> valueClass) {
         if (!TypeNames.isValid(valueClass)) {
             return null;
@@ -215,7 +214,7 @@ public class DefaultRecordSchema impleme
                 throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2, "valueClass", "void"));
             }
             final TypeName name = nameFactory.toTypeName(valueClass);
-            type = new SimpleAttributeType(name, valueClass);
+            type = new SimpleAttributeType<>(name, valueClass);
             final Type old = attributeTypes.putIfAbsent(valueClass, type);
             if (old != null) {      // May happen if the type has been computed concurrently.
                 return old;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -42,7 +42,7 @@ import org.apache.sis.util.ObjectConvert
 import org.apache.sis.internal.converter.SurjectiveConverter;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -197,7 +197,7 @@ public class DefaultRecordType extends R
         this.typeName  = typeName;
         this.container = container;
         final NameSpace namespace = nameFactory.createNameSpace(typeName, null);
-        final Map<MemberName,Type> memberTypes = new LinkedHashMap<MemberName,Type>(Containers.hashMapCapacity(members.size()));
+        final Map<MemberName,Type> memberTypes = new LinkedHashMap<>(Containers.hashMapCapacity(members.size()));
         for (final Map.Entry<? extends CharSequence, ? extends Type> entry : members.entrySet()) {
             final Type         type   = entry.getValue();
             final CharSequence name   = entry.getKey();
@@ -220,7 +220,7 @@ public class DefaultRecordType extends R
     private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
         in.defaultReadObject();
         final int size = in.readInt();
-        final Map<MemberName,Type> members = new LinkedHashMap<MemberName,Type>(Containers.hashMapCapacity(size));
+        final Map<MemberName,Type> members = new LinkedHashMap<>(Containers.hashMapCapacity(size));
         for (int i=0; i<size; i++) {
             final MemberName member = (MemberName) in.readObject();
             final Type type = (Type) in.readObject();

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/RecordDefinition.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -33,11 +33,8 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.collection.Containers;
 import org.apache.sis.internal.util.CollectionsExt;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.JDK7;
 import org.apache.sis.internal.simple.SimpleAttributeType;
 
-
 /**
  * Holds a {@code Record} definition in a way more convenient for Apache SIS than
  * what the {@code RecordType} interface provides.
@@ -151,7 +148,7 @@ abstract class RecordDefinition { // Int
     final Type[] computeTransientFields(final Map<? extends MemberName, ? extends Type> memberTypes) {
         final int size = memberTypes.size();
         members       = new MemberName[size];
-        memberIndices = new LinkedHashMap<MemberName,Integer>(Containers.hashMapCapacity(size));
+        memberIndices = new LinkedHashMap<>(Containers.hashMapCapacity(size));
         final Type[] types = new Type[size];
         int i = 0;
         for (final Map.Entry<? extends MemberName, ? extends Type> entry : memberTypes.entrySet()) {
@@ -242,7 +239,7 @@ abstract class RecordDefinition { // Int
      */
     final String toString(final String head, final Object values) {
         final StringBuilder buffer = new StringBuilder(250);
-        final String lineSeparator = JDK7.lineSeparator();
+        final String lineSeparator = System.lineSeparator();
         final String[] names = new String[size()];
         int width = 0;
         buffer.append(head).append("[“").append(getRecordType().getTypeName()).append("”] {").append(lineSeparator);

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

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/TypeNames.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/TypeNames.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/TypeNames.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/TypeNames.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -52,7 +52,7 @@ final class TypeNames {
      *
      * <p>This map shall not be modified after construction.</p>
      */
-    private static final Map<String,Class<?>> MAPPING = new LinkedHashMap<String,Class<?>>(16);
+    private static final Map<String,Class<?>> MAPPING = new LinkedHashMap<>(16);
     static {
         final Map<String,Class<?>> m = MAPPING;
         m.put("URI",       URI.class);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -23,6 +23,7 @@ import java.util.Locale;
 import java.util.Properties;
 import java.util.ResourceBundle;
 import java.util.MissingResourceException;
+import java.util.IllformedLocaleException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.Array;
@@ -495,9 +496,7 @@ public final class Types extends Static
                 throw (Error) cause;
             }
             throw new UndeclaredThrowableException(cause);
-        } catch (NoSuchMethodException e) {
-            values = Array.newInstance(codeType, 0);
-        } catch (IllegalAccessException e) {
+        } catch (NoSuchMethodException | IllegalAccessException e) {
             values = Array.newInstance(codeType, 0);
         }
         return (T[]) values;
@@ -535,12 +534,10 @@ public final class Types extends Static
             try {
                 props.load(in);
                 in.close();
-            } catch (IOException e) {
-                throw new BackingStoreException(e);
-            } catch (IllegalArgumentException e) {
+            } catch (IOException | IllegalArgumentException e) {
                 throw new BackingStoreException(e);
             }
-            typeForNames = new HashMap<Object,Object>(props);
+            typeForNames = new HashMap<>(props);
             JDK8.putIfAbsent(typeForNames, "MI_SensorTypeCode", "org.apache.sis.internal.metadata.SensorType");
         }
         final Object value = typeForNames.get(identifier);
@@ -743,7 +740,7 @@ public final class Types extends Static
                 final int s = offset + 1;
                 try {
                     locale = Locales.parse(key, s);
-                } catch (RuntimeException e) { // IllformedLocaleException on the JDK7 branch.
+                } catch (IllformedLocaleException e) {
                     throw new IllegalArgumentException(Errors.getResources(properties).getString(
                             Errors.Keys.IllegalLanguageCode_1, '(' + key.substring(0, s) + ')' + key.substring(s), e));
                 }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/LoggerFactory.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -72,7 +72,7 @@ public abstract class LoggerFactory<L> {
      */
     protected LoggerFactory(final Class<L> loggerClass) {
         this.loggerClass = loggerClass;
-        loggers = new WeakValueHashMap<String,Logger>(String.class);
+        loggers = new WeakValueHashMap<>(String.class);
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -43,9 +43,6 @@ import org.apache.sis.util.Debug;
 
 import static org.apache.sis.internal.util.StandardDateFormat.UTC;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * A formatter writing log messages on a single line. Compared to the JDK {@link SimpleFormatter},
@@ -326,7 +323,7 @@ public class MonolineFormatter extends F
          * The default (8 characters) is a little bit too wide...
          */
         final StringWriter str = new StringWriter();
-        writer  = new LineAppender(str, JDK7.lineSeparator(), true);
+        writer  = new LineAppender(str, System.lineSeparator(), true);
         buffer  = str.getBuffer().append(header);
         printer = new PrintWriter(IO.asWriter(writer));
         writer.setTabulationWidth(4);
@@ -553,7 +550,7 @@ loop:   for (int i=0; ; i++) {
     @SuppressWarnings("ReturnOfCollectionOrArrayField")
     private SortedMap<Level,X364> colors() {
         if (colors == null) {
-            colors = new TreeMap<Level,X364>(COMPARATOR);
+            colors = new TreeMap<>(COMPARATOR);
         }
         return colors;
     }
@@ -701,7 +698,7 @@ loop:   for (int i=0; ; i++) {
              * amount of spaces in order to align message body on the column after the level name.
              */
             String bodyLineSeparator = writer.getLineSeparator();
-            final String lineSeparator = JDK7.lineSeparator();
+            final String lineSeparator = System.lineSeparator();
             if (bodyLineSeparator.length() != lineSeparator.length() + margin + 1) {
                 bodyLineSeparator = lineSeparator + levelColor + CharSequences.spaces(margin) + levelReset + ' ';
                 writer.setLineSeparator(bodyLineSeparator);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -43,9 +43,6 @@ import org.apache.sis.util.logging.Loggi
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.internal.util.PatchedUnitFormat;
 
-// Related to JDK7
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * {@link ResourceBundle} implementation accepting integers instead of strings for resource keys.
@@ -239,7 +236,7 @@ public class IndexedResourceBundle exten
                 keyLength = Math.max(keyLength, key.length());
             }
         }
-        final String lineSeparator = JDK7.lineSeparator();
+        final String lineSeparator = System.lineSeparator();
         final String[] values = ensureLoaded(null);
         for (int i=0; i<values.length; i++) {
             final String key   = keys  [i];
@@ -297,8 +294,7 @@ public class IndexedResourceBundle exten
                     /*
                      * Loads resources from the UTF file.
                      */
-                    try {
-                        DataInputStream input = new DataInputStream(new BufferedInputStream(resources.openStream()));
+                    try (DataInputStream input = new DataInputStream(new BufferedInputStream(resources.openStream()))) {
                         values = new String[input.readInt()];
                         for (int i=0; i<values.length; i++) {
                             values[i] = input.readUTF();
@@ -306,7 +302,6 @@ public class IndexedResourceBundle exten
                                 values[i] = null;
                             }
                         }
-                        input.close();
                     } catch (IOException exception) {
                         record.setLevel  (Level.WARNING);
                         record.setMessage(exception.getMessage()); // For administrator, use system locale.
@@ -364,7 +359,8 @@ public class IndexedResourceBundle exten
              */
             try {
                 keyID = getKeyConstants().getKeyValue(key);
-            } catch (Exception e) {
+            } catch (ReflectiveOperationException e) {
+                e.addSuppressed(exception);
                 Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), getClass(), "handleGetObject", e);
                 return null; // This is okay as of 'handleGetObject' contract.
             }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -116,7 +116,7 @@ final class Loader extends ResourceBundl
          */
         try {
             return (ResourceBundle) classe.getDeclaredConstructor(URL.class).newInstance(resources);
-        } catch (Exception e) { // The JDK7 branch uses multi-catches here.
+        } catch (NoSuchMethodException | InvocationTargetException e) {
             InstantiationException exception = new InstantiationException(Exceptions.getLocalizedMessage(e, locale));
             exception.initCause(e);
             throw exception;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -27,7 +27,7 @@ import org.apache.sis.util.Utilities;
 import org.apache.sis.util.iso.AbstractInternationalString;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -168,7 +168,7 @@ abstract class ResourceInternationalStri
         in.defaultReadObject();
         try {
             key = getKeyConstants().getKeyValue(in.readUTF());
-        } catch (Exception cause) { // (ReflectiveOperationException) on JDK7
+        } catch (ReflectiveOperationException cause) {
             InvalidObjectException e = new InvalidObjectException(cause.toString());
             e.initCause(cause);
             throw e;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -70,7 +70,7 @@ public interface IdentifierSpace<T> exte
      *
      * @see javax.xml.bind.annotation.XmlID
      */
-    IdentifierSpace<String> ID = new NonMarshalledAuthority<String>("gml:id", NonMarshalledAuthority.ID);
+    IdentifierSpace<String> ID = new NonMarshalledAuthority<>("gml:id", NonMarshalledAuthority.ID);
 
     /**
      * An optional attribute available on every object-with-identity provided in the GMD schemas
@@ -87,7 +87,7 @@ public interface IdentifierSpace<T> exte
      *
      * @see UUID
      */
-    IdentifierSpace<UUID> UUID = new NonMarshalledAuthority<UUID>("gco:uuid", NonMarshalledAuthority.UUID);
+    IdentifierSpace<UUID> UUID = new NonMarshalledAuthority<>("gco:uuid", NonMarshalledAuthority.UUID);
 
     /**
      * An optional attribute for URN to an external resources, or to an other part of a XML
@@ -99,7 +99,7 @@ public interface IdentifierSpace<T> exte
      *
      * @see XLink#getHRef()
      */
-    IdentifierSpace<URI> HREF = new NonMarshalledAuthority<URI>("xlink:href", NonMarshalledAuthority.HREF);
+    IdentifierSpace<URI> HREF = new NonMarshalledAuthority<>("xlink:href", NonMarshalledAuthority.HREF);
 
     /**
      * Any XML attributes defined by OGC in the
@@ -109,7 +109,7 @@ public interface IdentifierSpace<T> exte
      *
      * @see XLink
      */
-    IdentifierSpace<XLink> XLINK = new NonMarshalledAuthority<XLink>("xlink", NonMarshalledAuthority.XLINK);
+    IdentifierSpace<XLink> XLINK = new NonMarshalledAuthority<>("xlink", NonMarshalledAuthority.XLINK);
 
     /**
      * Returns the name of this identifier space.

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -47,8 +47,8 @@ final class LegacyCodes {
     static {
         final CharacterSet[] codes = CharacterSet.values();
         final int capacity = Containers.hashMapCapacity(codes.length);
-        IANA_TO_LEGACY = new HashMap<String,String>(capacity);
-        LEGACY_TO_IANA = new HashMap<String,String>(capacity);
+        IANA_TO_LEGACY = new HashMap<>(capacity);
+        LEGACY_TO_IANA = new HashMap<>(capacity);
         for (final CharacterSet code : codes) {
             final String   legacy = code.identifier().intern();
             final String[] names  = code.names();

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -19,7 +19,7 @@ package org.apache.sis.xml;
 import java.util.Map;
 import java.util.Deque;
 import java.util.ServiceLoader;
-import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.ConcurrentLinkedDeque;
 import java.util.concurrent.atomic.AtomicBoolean;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
@@ -221,11 +221,11 @@ public class MarshallerPool {
             mapper = null;
         } else try {
             mapper = Class.forName(classname).getConstructor(String.class).newInstance(rootNamespace);
-        } catch (Throwable exception) { // (ReflectiveOperationException | NoClassDefFoundError) on JDK7 branch.
+        } catch (ReflectiveOperationException | NoClassDefFoundError exception) {
             throw new JAXBException(exception);
         }
-        marshallers        = new LinkedBlockingDeque<Marshaller>();
-        unmarshallers      = new LinkedBlockingDeque<Unmarshaller>();
+        marshallers        = new ConcurrentLinkedDeque<>();
+        unmarshallers      = new ConcurrentLinkedDeque<>();
         isRemovalScheduled = new AtomicBoolean();
     }
 

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -188,7 +188,7 @@ public final class Namespaces extends St
      */
     private static final Map<String,String> SPECIFIC_URLS;
     static {
-        final Map<String,String> p = new HashMap<String,String>(40);
+        final Map<String,String> p = new HashMap<>(40);
         p.put(XMLConstants.W3C_XML_SCHEMA_NS_URI,                         "xsd");
         p.put(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,                "xsi");
         p.put("http://www.w3.org/2004/02/skos/core#",                    "skos");

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilObjectHandler.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -34,7 +34,7 @@ import org.apache.sis.internal.jaxb.Iden
 import org.apache.sis.internal.jaxb.ModifiableIdentifierMap;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -67,7 +67,7 @@ final class NilObjectHandler implements
      * or modify identifiers.
      */
     NilObjectHandler(final Identifier[] identifiers) {
-        final List<Identifier> asList = new ArrayList<Identifier>(identifiers.length);
+        final List<Identifier> asList = new ArrayList<>(identifiers.length);
         for (final Identifier identifier : identifiers) {
             if (identifier != null) {
                 asList.add(identifier);
@@ -127,21 +127,21 @@ final class NilObjectHandler implements
     public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
         final String name = method.getName();
         if (args == null) {
-            /*switch (name)*/ {
-                if ("getNilReason".equals(name)) {
+            switch (name) {
+                case "getNilReason": {
                     return (attribute instanceof NilReason) ? (NilReason) attribute : null;
                 }
-                if ("getIdentifierMap".equals(name)) {
+                case "getIdentifierMap": {
                     return (attribute instanceof IdentifierMap) ? (IdentifierMap) attribute : null;
                 }
-                if ("getIdentifiers".equals(name)) {
+                case "getIdentifiers": {
                     return (attribute instanceof IdentifierMapAdapter) ?
                             ((IdentifierMapAdapter) attribute).identifiers : null;
                 }
-                if ("toString".equals(name)) {
+                case "toString": {
                     return getInterface(proxy).getSimpleName() + '[' + attribute + ']';
                 }
-                if ("hashCode".equals(name)) {
+                case "hashCode": {
                     return ~attribute.hashCode();
                 }
             }

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -139,7 +139,7 @@ public final class NilReason implements
     /**
      * The pool of other nil reasons created up to date.
      */
-    private static final WeakHashSet<NilReason> POOL = new WeakHashSet<NilReason>(NilReason.class);
+    private static final WeakHashSet<NilReason> POOL = new WeakHashSet<>(NilReason.class);
 
     /**
      * Either the XML value as a {@code String} (including the explanation if the prefix
@@ -389,7 +389,7 @@ public final class NilReason implements
          * ReferenceQueueConsumer thread is shared by all the SIS library.
          */
         if (nilObjects == null) {
-            nilObjects = new WeakValueHashMap<Class<?>, Object>((Class) Class.class);
+            nilObjects = new WeakValueHashMap<>((Class) Class.class);
         }
         Object object = nilObjects.get(type);
         if (object == null) {

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -20,6 +20,7 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.ConcurrentModificationException;
+import java.util.IllformedLocaleException;
 import java.util.Locale;
 import java.util.TimeZone;
 import javax.xml.validation.Schema;
@@ -175,7 +176,7 @@ abstract class Pooled {
      */
     Pooled(final boolean internal) {
         this.internal = internal;
-        initialProperties = new LinkedHashMap<Object,Object>();
+        initialProperties = new LinkedHashMap<>();
     }
 
     /**
@@ -185,7 +186,7 @@ abstract class Pooled {
      * @param template The {@link PooledTemplate} from which to get the initial values.
      */
     Pooled(final Pooled template) {
-        initialProperties = new LinkedHashMap<Object,Object>();
+        initialProperties = new LinkedHashMap<>();
         internal = template.internal;
     }
 
@@ -324,20 +325,20 @@ abstract class Pooled {
      */
     public final void setProperty(String name, final Object value) throws PropertyException {
         try {
-            /* switch (name) */ {
-                if (name.equals(XML.LOCALE)) {
+            switch (name) {
+                case XML.LOCALE: {
                     locale = (value instanceof CharSequence) ? Locales.parse(value.toString()) : (Locale) value;
                     return;
                 }
-                if (name.equals(XML.TIMEZONE)) {
+                case XML.TIMEZONE: {
                     timezone = (value instanceof CharSequence) ? TimeZone.getTimeZone(value.toString()) : (TimeZone) value;
                     return;
                 }
-                if (name.equals(XML.SCHEMAS)) {
+                case XML.SCHEMAS: {
                     final Map<?,?> map = (Map<?,?>) value;
                     Map<String,String> copy = null;
                     if (map != null) {
-                        copy = new HashMap<String,String>(4);
+                        copy = new HashMap<>(4);
                         for (final String key : SCHEMA_KEYS) {
                             final Object schema = map.get(key);
                             if (schema != null) {
@@ -353,19 +354,19 @@ abstract class Pooled {
                     schemas = copy;
                     return;
                 }
-                if (name.equals(XML.GML_VERSION)) {
+                case XML.GML_VERSION: {
                     versionGML = (value instanceof CharSequence) ? new Version(value.toString()) : (Version) value;
                     return;
                 }
-                if (name.equals(XML.RESOLVER)) {
+                case XML.RESOLVER: {
                     resolver = (ReferenceResolver) value;
                     return;
                 }
-                if (name.equals(XML.CONVERTER)) {
+                case XML.CONVERTER: {
                     converter = (ValueConverter) value;
                     return;
                 }
-                if (name.equals(XML.STRING_SUBSTITUTES)) {
+                case XML.STRING_SUBSTITUTES: {
                     bitMasks &= ~(Context.SUBSTITUTE_LANGUAGE |
                                   Context.SUBSTITUTE_COUNTRY  |
                                   Context.SUBSTITUTE_FILENAME |
@@ -385,11 +386,11 @@ abstract class Pooled {
                     }
                     return;
                 }
-                if (name.equals(XML.WARNING_LISTENER)) {
+                case XML.WARNING_LISTENER: {
                     warningListener = (WarningListener<?>) value;
                     return;
                 }
-                if (name.equals(LegacyNamespaces.APPLY_NAMESPACE_REPLACEMENTS)) {
+                case LegacyNamespaces.APPLY_NAMESPACE_REPLACEMENTS: {
                     xmlnsReplaceCode = 0;
                     if (value != null) {
                         xmlnsReplaceCode = ((Boolean) value) ? (byte) 1 : (byte) 2;
@@ -397,7 +398,7 @@ abstract class Pooled {
                     return;
                 }
             }
-        } catch (RuntimeException e) { // (ClassCastException | IllformedLocaleException) on the JDK7 branch.
+        } catch (ClassCastException | IllformedLocaleException e) {
             throw new PropertyException(Errors.format(
                     Errors.Keys.IllegalPropertyValueClass_2, name, value.getClass()), e);
         }
@@ -419,15 +420,15 @@ abstract class Pooled {
      * A method which is common to both {@code Marshaller} and {@code Unmarshaller}.
      */
     public final Object getProperty(final String name) throws PropertyException {
-        /*switch (name)*/ {
-            if (name.equals(XML.LOCALE))           return locale;
-            if (name.equals(XML.TIMEZONE))         return timezone;
-            if (name.equals(XML.SCHEMAS))          return schemas;
-            if (name.equals(XML.GML_VERSION))      return versionGML;
-            if (name.equals(XML.RESOLVER))         return resolver;
-            if (name.equals(XML.CONVERTER))        return converter;
-            if (name.equals(XML.WARNING_LISTENER)) return warningListener;
-            if (name.equals(XML.STRING_SUBSTITUTES)) {
+        switch (name) {
+            case XML.LOCALE:           return locale;
+            case XML.TIMEZONE:         return timezone;
+            case XML.SCHEMAS:          return schemas;
+            case XML.GML_VERSION:      return versionGML;
+            case XML.RESOLVER:         return resolver;
+            case XML.CONVERTER:        return converter;
+            case XML.WARNING_LISTENER: return warningListener;
+            case XML.STRING_SUBSTITUTES: {
                 int n = 0;
                 final String[] substitutes = new String[4];
                 if ((bitMasks & Context.SUBSTITUTE_LANGUAGE) != 0) substitutes[n++] = "language";
@@ -436,14 +437,16 @@ abstract class Pooled {
                 if ((bitMasks & Context.SUBSTITUTE_MIMETYPE) != 0) substitutes[n++] = "mimetype";
                 return (n != 0) ? ArraysExt.resize(substitutes, n) : null;
             }
-            if (name.equals(LegacyNamespaces.APPLY_NAMESPACE_REPLACEMENTS)) {
+            case LegacyNamespaces.APPLY_NAMESPACE_REPLACEMENTS: {
                 switch (xmlnsReplaceCode) {
                     case 1:  return Boolean.TRUE;
                     case 2:  return Boolean.FALSE;
                     default: return null;
                 }
             }
-            return getStandardProperty(convertPropertyKey(name));
+            default: {
+                return getStandardProperty(convertPropertyKey(name));
+            }
         }
     }
 

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledMarshaller.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -186,13 +186,10 @@ final class PooledMarshaller extends Poo
     public void marshal(final Object object, final File output) throws JAXBException {
         final FilterVersion version = getFilterVersion();
         if (version != null) try {
-            final OutputStream s = new BufferedOutputStream(new FileOutputStream(output));
-            try {
+            try (OutputStream s = new BufferedOutputStream(new FileOutputStream(output))) {
                 marshal(object, XMLOutputFactory.createXMLStreamWriter(s, getEncoding()), version);
-            } finally {
-                s.close();
             }
-        } catch (Exception e) { // (IOException | XMLStreamException) on the JDK7 branch.
+        } catch (IOException | XMLStreamException e) {
             throw new JAXBException(e);
         } else {
             // Marshalling to the default GML version.

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledUnmarshaller.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -179,13 +179,10 @@ final class PooledUnmarshaller extends P
     public Object unmarshal(final URL input) throws JAXBException {
         final FilterVersion version = getFilterVersion();
         if (version != null) try {
-            final InputStream s = input.openStream();
-            try {
+            try (final InputStream s = input.openStream()) {
                 return unmarshal(XMLInputFactory.createXMLStreamReader(s), version);
-            } finally {
-                s.close();
             }
-        } catch (Exception e) { // (IOException | XMLStreamException) on the JDK7 branch.
+        } catch (IOException | XMLStreamException e) {
             throw new JAXBException(e);
         } else {
             final Context context = begin();
@@ -204,13 +201,10 @@ final class PooledUnmarshaller extends P
     public Object unmarshal(final File input) throws JAXBException {
         final FilterVersion version = getFilterVersion();
         if (version != null) try {
-            final InputStream s = new BufferedInputStream(new FileInputStream(input));
-            try {
+            try (final InputStream s = new BufferedInputStream(new FileInputStream(input))) {
                 return unmarshal(XMLInputFactory.createXMLStreamReader(s), version);
-            } finally {
-                s.close();
             }
-        } catch (Exception e) { // (IOException | XMLStreamException) on the JDK7 branch.
+        } catch (IOException | XMLStreamException e) {
             throw new JAXBException(e);
         } else {
             final Context context = begin();

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -21,6 +21,7 @@ import java.net.URL;
 import java.net.URISyntaxException;
 import java.net.MalformedURLException;
 import java.util.MissingResourceException;
+import java.util.IllformedLocaleException;
 import java.util.Locale;
 import java.util.UUID;
 import java.nio.charset.Charset;
@@ -253,16 +254,15 @@ public class ValueConverter {
      * @param  value The string to convert to a locale, or {@code null}.
      * @return The converted locale, or {@code null} if the given value was null or empty, or
      *         if an exception was thrown and {@code exceptionOccured(…)} returned {@code true}.
-     * @throws RuntimeException If the given string can not be converted to a locale
-     *         ({@code IllformedLocaleException} on the JDK7 branch).
+     * @throws IllformedLocaleException If the given string can not be converted to a locale.
      *
      * @see Locales#parse(String)
      */
-    public Locale toLocale(final MarshalContext context, String value) {
+    public Locale toLocale(final MarshalContext context, String value) throws IllformedLocaleException {
         value = trimWhitespaces(value);
         if (value != null && !value.isEmpty()) try {
             return Locales.parse(value);
-        } catch (RuntimeException e) { // IllformedLocaleException on the JDK7 branch.
+        } catch (IllformedLocaleException e) {
             if (!exceptionOccured(context, value, String.class, Locale.class, e)) {
                 throw e;
             }
@@ -435,12 +435,9 @@ public class ValueConverter {
     public URL toURL(final MarshalContext context, final URI value) throws MalformedURLException {
         if (value != null) try {
             return value.toURL();
-        } catch (Exception e) { // MalformedURLException | IllegalArgumentException
+        } catch (MalformedURLException | IllegalArgumentException e) {
             if (!exceptionOccured(context, value, URI.class, URL.class, e)) {
-                if (e instanceof RuntimeException) {
-                    throw (RuntimeException) e;
-                }
-                throw (MalformedURLException) e;
+                throw e;
             }
         }
         return null;

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




Mime
View raw message