sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762629 [8/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-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -76,7 +76,7 @@ import org.apache.sis.util.resources.Voc
 import org.apache.sis.util.resources.Errors;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 import org.apache.sis.internal.jdk8.JDK8;
 import org.apache.sis.internal.jdk8.Predicate;
 
@@ -335,16 +335,13 @@ class CoordinateOperationRegistry {
                     }
                     return operation;
                 }
-            } catch (IllegalArgumentException e) {
+            } catch (IllegalArgumentException | ConversionException e) {
                 String message = Errors.format(Errors.Keys.CanNotInstantiate_1, new CRSPair(sourceCRS, targetCRS));
                 String details = e.getLocalizedMessage();
                 if (details != null) {
                     message = message + ' ' + details;
                 }
                 throw new FactoryException(message, e);
-            } catch (ConversionException e) {
-                throw new FactoryException(Errors.format(
-                        Errors.Keys.CanNotInstantiate_1, new CRSPair(sourceCRS, targetCRS)), e);
             }
         }
     }
@@ -405,7 +402,7 @@ class CoordinateOperationRegistry {
                     return null;
                 }
             }
-        } catch (NoSuchAuthorityCodeException exception) {
+        } catch (NoSuchAuthorityCodeException | MissingFactoryResourceException exception) {
             /*
              * sourceCode or targetCode is unknown to the underlying authority factory.
              * Ignores the exception and fallback on the generic algorithm provided by
@@ -413,9 +410,6 @@ class CoordinateOperationRegistry {
              */
             log(exception);
             return null;
-        } catch (MissingFactoryResourceException exception) {
-            log(exception);
-            return null;
         }
         /*
          * We will loop over all coordinate operations and select the one having the largest intersection
@@ -714,7 +708,7 @@ class CoordinateOperationRegistry {
         CoordinateReferenceSystem crs;
         if (Utilities.equalsApproximatively(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
         if (Utilities.equalsApproximatively(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
-        final Map<String,Object> properties = new HashMap<String,Object>(derivedFrom(operation));
+        final Map<String,Object> properties = new HashMap<>(derivedFrom(operation));
         /*
          * Determine whether the operation to create is a Conversion or a Transformation
          * (could also be a Conversion subtype like Projection, but this is less important).
@@ -748,11 +742,8 @@ class CoordinateOperationRegistry {
                     try {
                         method = factorySIS.getOperationMethod(method.getName().getCode());
                         method = DefaultOperationMethod.redimension(method, sourceDimensions, targetDimensions);
-                    } catch (NoSuchIdentifierException se) {
-                        // ex.addSuppressed(se) on the JDK7 branch.
-                        throw ex;
-                    } catch (IllegalArgumentException se) {
-                        // ex.addSuppressed(se) on the JDK7 branch.
+                    } catch (NoSuchIdentifierException | IllegalArgumentException se) {
+                        ex.addSuppressed(se);
                         throw ex;
                     }
                 }
@@ -791,7 +782,7 @@ class CoordinateOperationRegistry {
                                                   final CoordinateOperation operation)
             throws IllegalArgumentException, FactoryException
     {
-        final List<CoordinateOperation> operations = new ArrayList<CoordinateOperation>();
+        final List<CoordinateOperation> operations = new ArrayList<>();
         if (operation instanceof ConcatenatedOperation) {
             operations.addAll(((ConcatenatedOperation) operation).getOperations());
         } else {
@@ -970,7 +961,7 @@ class CoordinateOperationRegistry {
      * @return a modifiable map containing the given name. Callers can put other entries in this map.
      */
     static Map<String,Object> properties(final Identifier name) {
-        final Map<String,Object> properties = new HashMap<String,Object>(4);
+        final Map<String,Object> properties = new HashMap<>(4);
         properties.put(CoordinateOperation.NAME_KEY, name);
         if ((name == DATUM_SHIFT) || (name == ELLIPSOID_CHANGE)) {
             properties.put(CoordinateOperation.COORDINATE_OPERATION_ACCURACY_KEY, new PositionalAccuracy[] {

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -42,7 +42,7 @@ import org.apache.sis.io.wkt.Formatter;
 import static org.apache.sis.util.Utilities.deepEquals;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 import org.opengis.referencing.operation.SingleOperation;
 
 
@@ -111,7 +111,7 @@ final class DefaultConcatenatedOperation
     {
         super(properties);
         ArgumentChecks.ensureNonNull("operations", operations);
-        final List<CoordinateOperation> flattened = new ArrayList<CoordinateOperation>(operations.length);
+        final List<CoordinateOperation> flattened = new ArrayList<>(operations.length);
         initialize(properties, operations, flattened, mtFactory,
                 (coordinateOperationAccuracy == null), (domainOfValidity == null));
         if (flattened.size() < 2) {
@@ -405,7 +405,7 @@ final class DefaultConcatenatedOperation
      * Invoked by JAXB for setting the operations.
      */
     private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
-        final List<CoordinateOperation> flattened = new ArrayList<CoordinateOperation>(steps.length);
+        final List<CoordinateOperation> flattened = new ArrayList<>(steps.length);
         initialize(null, steps, flattened, DefaultFactories.forBuildin(MathTransformFactory.class),
                 (coordinateOperationAccuracy == null), (domainOfValidity == null));
         operations = UnmodifiableArrayList.wrap(flattened.toArray(new SingleOperation[flattened.size()]));

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -159,7 +159,7 @@ public class DefaultCoordinateOperationF
         } else {
             String key   = null;
             Object value = null;
-            properties   = new HashMap<String,Object>(properties);
+            properties   = new HashMap<>(properties);
             /*
              * Following use of properties is an undocumented feature for now. Current version documents only
              * MathTransformFactory because math transforms are intimately related to coordinate operations.
@@ -178,8 +178,8 @@ public class DefaultCoordinateOperationF
         if (factory != null) {
             mtFactory = factory;
         }
-        pool = new WeakHashSet<IdentifiedObject>(IdentifiedObject.class);
-        cache = new Cache<CRSPair,CoordinateOperation>(12, 50, true);
+        pool = new WeakHashSet<>(IdentifiedObject.class);
+        cache = new Cache<>(12, 50, true);
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -29,7 +29,7 @@ import org.apache.sis.util.iso.Types;
 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-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -61,7 +61,7 @@ import org.apache.sis.io.wkt.Formattable
 import static org.apache.sis.util.ArgumentChecks.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -322,7 +322,7 @@ public class DefaultOperationMethod exte
      * @return The identified object properties in a mutable map.
      */
     private static Map<String,Object> getProperties(final IdentifiedObject info, final Citation authority) {
-        final Map<String,Object> properties = new HashMap<String,Object>(IdentifiedObjects.getProperties(info));
+        final Map<String,Object> properties = new HashMap<>(IdentifiedObjects.getProperties(info));
         properties.put(NAME_KEY, new NamedIdentifier(authority, info.getName().getCode()));
         properties.remove(IDENTIFIERS_KEY);
         return properties;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -40,7 +40,7 @@ import org.apache.sis.io.wkt.Formatter;
 import static org.apache.sis.util.Utilities.deepEquals;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.SingleOperation;
 

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -93,7 +93,7 @@ final class InverseOperationMethod exten
             if (!useSameParameters) {
                 Identifier name = method.getName();
                 name = new ImmutableIdentifier(null, null, "Inverse of " + name.getCode());
-                final Map<String,Object> properties = new HashMap<String,Object>(6);
+                final Map<String,Object> properties = new HashMap<>(6);
                 properties.put(NAME_KEY,    name);
                 properties.put(FORMULA_KEY, method.getFormula());
                 properties.put(REMARKS_KEY, method.getRemarks());

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubOperationInfo.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubOperationInfo.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubOperationInfo.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubOperationInfo.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -130,7 +130,7 @@ final class SubOperationInfo {
                                 if (failure == null) {
                                     failure = exception;
                                 } else {
-                                    // failure.addSuppressed(exception) on the JDK7 branch.
+                                    failure.addSuppressed(exception);
                                 }
                                 continue;
                             }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -32,9 +32,6 @@ import org.apache.sis.util.ArgumentCheck
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.Debug;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.JDK7;
-
 
 /**
  * Creates a linear (usually affine) transform which will map approximatively the given source points to
@@ -226,7 +223,7 @@ public class LinearTransformBuilder {
         }
         buffer.append(']');
         if (transform != null) {
-            final String lineSeparator = JDK7.lineSeparator();
+            final String lineSeparator = System.lineSeparator();
             buffer.append(':').append(lineSeparator);
             final TableAppender table = new TableAppender(buffer, " ");
             table.setMultiLinesCells(true);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -34,8 +34,7 @@ import org.apache.sis.internal.metadata.
 import org.apache.sis.internal.referencing.ExtendedPrecisionMatrix;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.JDK7;
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -1134,7 +1133,7 @@ public final class Matrices extends Stat
          * Now append the formatted elements with the appropriate amount of spaces before each value,
          * and trailling zeros after each value except ±0, ±1, NaN and infinities.
          */
-        final String   lineSeparator = JDK7.lineSeparator();
+        final String   lineSeparator = System.lineSeparator();
         final CharSequence whiteLine = CharSequences.spaces(totalWidth);
         final StringBuilder   buffer = new StringBuilder((totalWidth + 2 + lineSeparator.length()) * (numRow + 2));
         buffer.append('┌').append(whiteLine).append('┐').append(lineSeparator);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/AlbersEqualArea.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/AlbersEqualArea.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/AlbersEqualArea.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/AlbersEqualArea.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -95,8 +95,7 @@ public class AlbersEqualArea extends Equ
     @SuppressWarnings("fallthrough")
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
-        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
-                new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
+        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class);
         roles.put(ParameterRole.FALSE_EASTING,    EASTING_AT_FALSE_ORIGIN);
         roles.put(ParameterRole.FALSE_NORTHING,   NORTHING_AT_FALSE_ORIGIN);
         roles.put(ParameterRole.CENTRAL_MERIDIAN, LONGITUDE_OF_FALSE_ORIGIN);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -113,8 +113,7 @@ public class CylindricalEqualArea extend
     @SuppressWarnings("fallthrough")
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
-        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
-                new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
+        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class);
         /*
          * "Longitude of origin" and "scale factor" are intentionally omitted from this map because they will
          * be handled in a special way. See comments in Mercator.initializer(…) method for more details.

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -165,8 +165,7 @@ public class LambertConicConformal exten
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
         final byte variant = getVariant(method);
-        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
-                new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
+        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class);
         /*
          * "Scale factor" is not formally a "Lambert Conformal (2SP)" argument, but we accept it
          * anyway for all Lambert projections since it may be used in some Well Known Text (WKT).

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -153,8 +153,7 @@ public class Mercator extends ConformalP
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
         final byte variant = getVariant(method);
-        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
-                new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
+        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class);
         /*
          * "Longitude of origin" is a parameter of all Mercator projections, but is intentionally omitted from
          * this map because it will be handled in a special way by the Mercator constructor. The "scale factor"

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -54,7 +54,7 @@ import org.apache.sis.util.resources.Err
 import static java.lang.Math.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 import org.opengis.referencing.ReferenceIdentifier;
 
 
@@ -175,7 +175,7 @@ public abstract class NormalizedProjecti
      * used only by {@link #getParameterDescriptors()}, which is itself invoked mostly for debugging purpose.</p>
      */
     @Debug
-    private static final Map<Class<?>,ParameterDescriptorGroup> DESCRIPTORS = new HashMap<Class<?>,ParameterDescriptorGroup>();
+    private static final Map<Class<?>,ParameterDescriptorGroup> DESCRIPTORS = new HashMap<>();
 
     /**
      * The parameters used for creating this projection. They are used for formatting <cite>Well Known Text</cite> (WKT)

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -110,8 +110,7 @@ public class ObliqueStereographic extend
      */
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
-        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
-                new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
+        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class);
         roles.put(ParameterRole.CENTRAL_MERIDIAN, LONGITUDE_OF_ORIGIN);
         roles.put(ParameterRole.SCALE_FACTOR,     SCALE_FACTOR);
         roles.put(ParameterRole.FALSE_EASTING,    FALSE_EASTING);

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -116,8 +116,7 @@ public class PolarStereographic extends
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
         final byte variant = getVariant(method);
-        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
-                new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
+        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class);
         ParameterDescriptor<Double> falseEasting  = PolarStereographicA.FALSE_EASTING;
         ParameterDescriptor<Double> falseNorthing = PolarStereographicA.FALSE_NORTHING;
         if (variant == C) {

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -110,8 +110,7 @@ public class TransverseMercator extends
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
         final boolean isSouth = identMatch(method, "(?i).*\\bSouth\\b.*", TransverseMercatorSouth.IDENTIFIER);
-        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
-                new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
+        final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class);
         ParameterRole xOffset = ParameterRole.FALSE_EASTING;
         ParameterRole yOffset = ParameterRole.FALSE_NORTHING;
         if (isSouth) {

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -451,6 +451,7 @@ public abstract class AbstractMathTransf
                     failure = exception; // Keep only the first failure.
                     blockStart = srcOff;
                 } else {
+                    failure.addSuppressed(exception);
                     if (Math.abs(srcOff - blockStart) > MAXIMUM_BUFFER_SIZE) {
                         failureCount = 0; // We started a new block of coordinates.
                         blockStart = srcOff;
@@ -586,6 +587,8 @@ public abstract class AbstractMathTransf
                     throw exception;
                 } else if (failure == null) {
                     failure = exception; // Keep only the first exception.
+                } else {
+                    failure.addSuppressed(exception);
                 }
             }
             for (int i=0; i<dstStop; i++) {
@@ -648,6 +651,8 @@ public abstract class AbstractMathTransf
                     throw exception;
                 } else if (failure == null) {
                     failure = exception;
+                } else {
+                    failure.addSuppressed(exception);
                 }
             }
             for (int i=0; i<dstLength; i++) {
@@ -721,6 +726,8 @@ public abstract class AbstractMathTransf
                     throw exception;
                 } else if (failure == null) {
                     failure = exception;
+                } else {
+                    failure.addSuppressed(exception);
                 }
             }
             dstOff += dstLength;

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -426,7 +426,7 @@ class ConcatenatedTransform extends Abst
      * @see MathTransforms#getSteps(MathTransform)
      */
     public final List<MathTransform> getSteps() {
-        final List<MathTransform> transforms = new ArrayList<MathTransform>(5);
+        final List<MathTransform> transforms = new ArrayList<>(5);
         getSteps(transforms);
         return transforms;
     }
@@ -438,7 +438,7 @@ class ConcatenatedTransform extends Abst
      * (<var>projection</var>) elements, which does not need to be instances of {@link MathTransform}.
      */
     private List<Object> getPseudoSteps() {
-        final List<Object> transforms = new ArrayList<Object>();
+        final List<Object> transforms = new ArrayList<>();
         getSteps(transforms);
         /*
          * Pre-process the transforms before to format. Some steps may be merged, or new

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -21,6 +21,7 @@ import java.util.Arrays;
 import java.util.Map;
 import java.util.IdentityHashMap;
 import java.util.Iterator;
+import java.util.Objects;
 import java.io.Serializable;
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.GeneralParameterValue;
@@ -54,9 +55,6 @@ import org.apache.sis.util.resources.Err
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
-
 
 /**
  * The parameters that describe a sequence of
@@ -536,8 +534,7 @@ public class ContextualParameters extend
          * Some WKT parsers other than SIS may also require the parameter values to be listed in that specific
          * order. We proceed by first copying all parameters in a temporary HashMap:
          */
-        final Map<ParameterDescriptor<?>, ParameterValue<?>> parameters =
-                new IdentityHashMap<ParameterDescriptor<?>, ParameterValue<?>>(values.length);
+        final Map<ParameterDescriptor<?>, ParameterValue<?>> parameters = new IdentityHashMap<>(values.length);
         for (ParameterValue<?> p : values) {
             if (p == null) {
                 break;                      // The first null value in the array indicates the end of sequence.
@@ -588,7 +585,6 @@ public class ContextualParameters extend
      * @throws ParameterNotFoundException if there is no parameter of the given name.
      */
     @Override
-    @SuppressWarnings({"unchecked", "rawtypes"})
     public synchronized ParameterValue<?> parameter(final String name) throws ParameterNotFoundException {
         final GeneralParameterDescriptor desc = descriptor.descriptor(name);
         if (!(desc instanceof ParameterDescriptor<?>)) {
@@ -601,7 +597,7 @@ public class ContextualParameters extend
         for (int i=0; i < values.length; i++) {
             ParameterValue<?> p = values[i];
             if (p == null) {
-                values[i] = p = new ContextualParameter((ParameterDescriptor<?>) desc);
+                values[i] = p = new ContextualParameter<>((ParameterDescriptor<?>) desc);
                 return p;
             }
             if (p.getDescriptor() == desc) {                    // Identity comparison should be okay here.

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -204,9 +204,7 @@ abstract class CoordinateSystemTransform
                 return factory.createConcatenatedTransform(before,
                        factory.createConcatenatedTransform(tr, after));
             }
-        } catch (IllegalArgumentException e) {
-            cause = e;
-        } catch (ConversionException e) {
+        } catch (IllegalArgumentException | ConversionException e) {
             cause = e;
         }
         throw new OperationNotFoundException(Errors.format(Errors.Keys.CoordinateOperationNotFound_2,

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DatumShiftTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DatumShiftTransform.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DatumShiftTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DatumShiftTransform.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -31,7 +31,7 @@ import org.apache.sis.util.ComparisonMod
 import org.apache.sis.util.Debug;
 
 // Branch-specific imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -304,11 +304,11 @@ public class DefaultMathTransformFactory
     public DefaultMathTransformFactory(final Iterable<? extends OperationMethod> methods) {
         ArgumentChecks.ensureNonNull("methods", methods);
         this.methods  = methods;
-        methodsByName = new ConcurrentHashMap<String, OperationMethod>();
-        methodsByType = new IdentityHashMap<Class<?>, OperationMethodSet>();
-        lastMethod    = new ThreadLocal<OperationMethod>();
-        pool          = new WeakHashSet<MathTransform>(MathTransform.class);
-        parser        = new AtomicReference<Parser>();
+        methodsByName = new ConcurrentHashMap<>();
+        methodsByType = new IdentityHashMap<>();
+        lastMethod    = new ThreadLocal<>();
+        pool          = new WeakHashSet<>(MathTransform.class);
+        parser        = new AtomicReference<>();
     }
 
     /**
@@ -662,9 +662,7 @@ public class DefaultMathTransformFactory
                 } else {
                     return CoordinateSystems.swapAndScaleAxes(specified, normalized);
                 }
-            } catch (IllegalArgumentException cause) {
-                throw new InvalidGeodeticParameterException(cause.getLocalizedMessage(), cause);
-            } catch (ConversionException cause) {
+            } catch (IllegalArgumentException | ConversionException cause) {
                 throw new InvalidGeodeticParameterException(cause.getLocalizedMessage(), cause);
             }
         }
@@ -798,7 +796,7 @@ public class DefaultMathTransformFactory
                         mismatchedParam = bp;
                         mismatchedValue = b;
                     }
-                } catch (RuntimeException e) {  // (IllegalArgumentException | IllegalStateException) on the JDK7 branch.
+                } catch (IllegalArgumentException | IllegalStateException e) {
                     /*
                      * Parameter not found, or is not numeric, or unit of measurement is not linear.
                      * Do not touch to the parameters. We will see if createParameterizedTransform(…)
@@ -808,7 +806,7 @@ public class DefaultMathTransformFactory
                     if (failure == null) {
                         failure = e;
                     } else {
-                        // failure.addSuppressed(e) on the JDK7 branch.
+                        failure.addSuppressed(e);
                     }
                 }
                 final boolean isIvfDefinitive;
@@ -915,7 +913,7 @@ public class DefaultMathTransformFactory
                         if (p.getValue() == null) {
                             p.setValue(sourceCS.getDimension());
                         }
-                    } catch (RuntimeException e) {  // (IllegalArgumentException | IllegalStateException e) on the JDK7 branch.
+                    } catch (IllegalArgumentException | IllegalStateException e) {
                         failure = e;
                     }
                     failure = setEllipsoid(getSourceEllipsoid(), "src_semi_major", "src_semi_minor", false, failure);
@@ -1008,8 +1006,6 @@ public class DefaultMathTransformFactory
                 method = getOperationMethod(methodName);
                 Logging.recoverableException(Logging.getLogger(Loggers.COORDINATE_OPERATION),
                         DefaultMathTransformFactory.class, "createParameterizedTransform", exception);
-            } catch (IllegalStateException e) {
-                failure = e;
             }
             if (!(method instanceof MathTransformProvider)) {
                 throw new NoSuchIdentifierException(Errors.format(          // For now, handle like an unknown operation.
@@ -1031,7 +1027,7 @@ public class DefaultMathTransformFactory
                     method     = context.provider;
                 }
                 transform = ((MathTransformProvider) method).createMathTransform(this, parameters);
-            } catch (RuntimeException exception) {  // (IllegalArgumentException | IllegalStateException) on the JDK7 branch.
+            } catch (IllegalArgumentException | IllegalStateException exception) {
                 throw new InvalidGeodeticParameterException(exception.getLocalizedMessage(), exception);
             }
             /*
@@ -1047,7 +1043,7 @@ public class DefaultMathTransformFactory
             }
         } catch (FactoryException e) {
             if (failure != null) {
-                // e.addSuppressed(failure) on the JDK7 branch.
+                e.addSuppressed(failure);
             }
             throw e;
         } finally {
@@ -1344,7 +1340,7 @@ public class DefaultMathTransformFactory
                 parserConstructor = c;
             }
             p = c.newInstance(this);
-        } catch (Exception e) {                     // (ReflectiveOperationException) on JDK7 branch.
+        } catch (ReflectiveOperationException e) {
             throw new FactoryException(e);
         }
         /*

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransform.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransform.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -794,7 +794,6 @@ next:   while (--numPts >= 0) {
          * Creates the inverse of the enclosing transform.
          */
         Inverse() {
-            EllipsoidToCentricTransform.this.super();
         }
 
         /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -41,7 +41,7 @@ import org.apache.sis.internal.referenci
 import org.apache.sis.internal.referencing.provider.DatumShiftGridFile;
 
 // Branch-specific imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -421,7 +421,6 @@ public class InterpolatedTransform exten
          * Creates an inverse transform.
          */
         Inverse() {
-            InterpolatedTransform.this.super();
             tolerance = grid.getCellPrecision();
             if (!(tolerance > 0)) {         // Use ! for catching NaN.
                 throw new IllegalArgumentException(Errors.format(

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -81,7 +81,7 @@ final class OperationMethodSet extends S
     {
         this.type = type;
         this.methods = methods;
-        cachedMethods = new ArrayList<OperationMethod>();
+        cachedMethods = new ArrayList<>();
         reset();
     }
 

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ProjectiveTransform2D.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ProjectiveTransform2D.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ProjectiveTransform2D.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ProjectiveTransform2D.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -19,9 +19,9 @@ package org.apache.sis.referencing.opera
 import java.awt.Shape;
 import java.awt.geom.Point2D;
 import org.opengis.referencing.operation.Matrix;
-import org.opengis.referencing.operation.MathTransform2D;
 import org.opengis.referencing.operation.NoninvertibleTransformException;
 import org.opengis.referencing.operation.TransformException;
+import org.apache.sis.internal.referencing.j2d.LinearTransform2D;
 
 
 /**
@@ -36,7 +36,7 @@ import org.opengis.referencing.operation
  * @version 0.7
  * @module
  */
-final class ProjectiveTransform2D extends ProjectiveTransform implements MathTransform2D, LinearTransform {
+final class ProjectiveTransform2D extends ProjectiveTransform implements LinearTransform2D {
     /**
      * For cross-version compatibility.
      */
@@ -90,12 +90,7 @@ final class ProjectiveTransform2D extend
      * The inverse shall be linear and two-dimensional.
      */
     @Override
-    public ProjectiveTransform2D inverse() throws NoninvertibleTransformException {
-        final LinearTransform inv = super.inverse();
-        if (inv instanceof ProjectiveTransform2D) {
-            return (ProjectiveTransform2D) inv;
-        } else {
-            return new ProjectiveTransform2D(inv.getMatrix());
-        }
+    public LinearTransform2D inverse() throws NoninvertibleTransformException {
+        return (LinearTransform2D) super.inverse();
     }
 }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameterTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameterTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -112,10 +112,10 @@ public final strictfp class CC_GeneralOp
     private static DefaultParameterDescriptor<Integer> create(final String name, final String remarks,
             final boolean mandatory, final Integer defaultValue)
     {
-        final Map<String,String> properties = new HashMap<String,String>(4);
+        final Map<String,String> properties = new HashMap<>(4);
         assertNull(properties.put(DefaultParameterDescriptor.NAME_KEY, name));
         assertNull(properties.put(DefaultParameterDescriptor.REMARKS_KEY, remarks));
-        return new DefaultParameterDescriptor<Integer>(properties, mandatory ? 1 : 0, 1, Integer.class, null, null, defaultValue);
+        return new DefaultParameterDescriptor<>(properties, mandatory ? 1 : 0, 1, Integer.class, null, null, defaultValue);
     }
 
     /**
@@ -186,7 +186,7 @@ public final strictfp class CC_GeneralOp
     @Test
     @DependsOnMethod("testParameterSubstitution")
     public void testGroupSubstitution() throws JAXBException {
-        final Map<String,String> properties = new HashMap<String,String>(4);
+        final Map<String,String> properties = new HashMap<>(4);
         assertNull(properties.put(DefaultParameterDescriptor.NAME_KEY, "Group"));
         final ParameterDescriptorGroup provided = new DefaultParameterDescriptorGroup(properties, 1, 2,
                 unmarshal("Parameter A", null),
@@ -213,7 +213,7 @@ public final strictfp class CC_GeneralOp
     @Test
     @DependsOnMethod({"testGroupSubstitution", "testParameterMerge"})
     public void testGroupMergeBecauseDifferentProperties() throws JAXBException {
-        final Map<String,String> properties = new HashMap<String,String>(4);
+        final Map<String,String> properties = new HashMap<>(4);
         assertNull(properties.put(DefaultParameterDescriptor.NAME_KEY, "Group"));
         final ParameterDescriptorGroup provided = new DefaultParameterDescriptorGroup(properties, 1, 2,
                 unmarshal("Parameter A", "Remarks A."),
@@ -254,7 +254,7 @@ public final strictfp class CC_GeneralOp
     @Test
     @DependsOnMethod("testGroupMergeBecauseDifferentProperties")
     public void testGroupMergeBecauseMissingParameter() throws JAXBException {
-        final Map<String,String> properties = new HashMap<String,String>(4);
+        final Map<String,String> properties = new HashMap<>(4);
         assertNull(properties.put(DefaultParameterDescriptor.NAME_KEY, "Group"));
         final ParameterDescriptorGroup provided = new DefaultParameterDescriptorGroup(properties, 1, 2,
                 unmarshal("Parameter A", null),
@@ -296,7 +296,7 @@ public final strictfp class CC_GeneralOp
     @Test
     @DependsOnMethod("testGroupMergeBecauseDifferentProperties")
     public void testGroupMergeBecauseExtraParameter() throws JAXBException {
-        final Map<String,String> properties = new HashMap<String,String>(4);
+        final Map<String,String> properties = new HashMap<>(4);
         assertNull(properties.put(DefaultParameterDescriptor.NAME_KEY, "Group"));
         final ParameterDescriptorGroup provided = new DefaultParameterDescriptorGroup(properties, 1, 2,
                 unmarshal("Parameter A", "Remarks A."),

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameterGroupTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameterGroupTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameterGroupTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CC_OperationParameterGroupTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -114,8 +114,7 @@ public final strictfp class CC_Operation
         final ParameterDescriptor<?>[]         expected   = create(REMARK);
         final List<GeneralParameterDescriptor> fromXML    = unmarshal().descriptors();
         final List<GeneralParameterDescriptor> fromValues = UnmodifiableArrayList.<GeneralParameterDescriptor>wrap(expected);
-        final Map<GeneralParameterDescriptor,GeneralParameterDescriptor> replacements =
-                new IdentityHashMap<GeneralParameterDescriptor,GeneralParameterDescriptor>(4);
+        final Map<GeneralParameterDescriptor,GeneralParameterDescriptor> replacements = new IdentityHashMap<>(4);
         final GeneralParameterDescriptor[] merged = CC_OperationParameterGroup.merge(fromXML,
                 fromValues.toArray(new GeneralParameterDescriptor[fromValues.size()]), replacements);
 
@@ -139,8 +138,7 @@ public final strictfp class CC_Operation
     public void testMerge() throws JAXBException {
         final ParameterDescriptorGroup fromXML = unmarshal();
         final ParameterDescriptor<?>[] fromValues = create(null);
-        final Map<GeneralParameterDescriptor,GeneralParameterDescriptor> replacements =
-                new IdentityHashMap<GeneralParameterDescriptor,GeneralParameterDescriptor>(4);
+        final Map<GeneralParameterDescriptor,GeneralParameterDescriptor> replacements = new IdentityHashMap<>(4);
         final GeneralParameterDescriptor[] merged = CC_OperationParameterGroup.merge(fromXML.descriptors(), fromValues.clone(), replacements);
         assertNotSame(fromValues, merged);
         /*

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolationTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolationTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolationTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolationTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -33,8 +33,8 @@ import org.junit.Test;
 import static org.opengis.test.Assert.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Paths;
-import org.apache.sis.internal.jdk7.Path;
+import java.nio.file.Paths;
+import java.nio.file.Path;
 import org.apache.sis.internal.jdk8.JDK8;
 
 
@@ -145,11 +145,8 @@ public final strictfp class FranceGeocen
         assertNotNull("Test file \"" + TEST_FILE + "\" not found.", url);
         final Path file = Paths.get(url.toURI());
         final DatumShiftGridFile.Float<Angle,Length> grid;
-        final BufferedReader in = JDK8.newBufferedReader(file);
-        try {
+        try (final BufferedReader in = JDK8.newBufferedReader(file)) {
             grid = FranceGeocentricInterpolation.load(in, file);
-        } finally {
-            in.close();
         }
         assertEquals("cellPrecision",   0.005, grid.getCellPrecision(), STRICT);
         assertEquals("getCellMean",  168.2587, grid.getCellMean(0), 0.0001);

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NADCONTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NADCONTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NADCONTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NADCONTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -35,8 +35,8 @@ import org.junit.Test;
 import static org.apache.sis.test.Assert.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Path;
-import org.apache.sis.internal.jdk7.Paths;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import org.apache.sis.internal.jdk8.JDK8;
 
 
@@ -234,8 +234,7 @@ public final strictfp class NADCONTest e
     {
         Envelope envelope = new Envelope2D(null, gridX, gridY, nx - 1, ny - 1);
         envelope = Envelopes.transform(grid.getCoordinateToGrid().inverse(), envelope);
-        final BufferedWriter out = JDK8.newBufferedWriter(file);
-        try {
+        try (final BufferedWriter out = JDK8.newBufferedWriter(file)) {
             out.write("NADCON EXTRACTED REGION\n");
             out.write(String.format(Locale.US, "%4d %3d %3d %11.5f %11.5f %11.5f %11.5f %11.5f\n", nx, ny, 1,
                     envelope.getMinimum(0), envelope.getSpan(0) / (nx - 1),
@@ -247,8 +246,6 @@ public final strictfp class NADCONTest e
                 }
                 out.write('\n');
             }
-        } finally {
-            out.close();
         }
     }
 }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -19,20 +19,28 @@ package org.apache.sis.internal.referenc
 import java.net.URL;
 import java.net.URISyntaxException;
 import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.channels.WritableByteChannel;
+import java.nio.charset.StandardCharsets;
 import javax.measure.unit.NonSI;
 import javax.measure.quantity.Angle;
 import org.opengis.geometry.Envelope;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.operation.TransformException;
 import org.apache.sis.referencing.operation.matrix.Matrix3;
+import org.apache.sis.geometry.Envelope2D;
+import org.apache.sis.geometry.Envelopes;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Path;
-import org.apache.sis.internal.jdk7.Paths;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.Files;
+import java.nio.file.StandardOpenOption;
 
 
 /**
@@ -156,4 +164,98 @@ public final strictfp class NTv2Test ext
                 FranceGeocentricInterpolationTest.ANGULAR_TOLERANCE * DatumShiftGridLoader.DEGREES_TO_SECONDS);
         assertSame("Grid should be cached.", grid, NTv2.getOrLoad(file));
     }
+
+
+
+
+    //////////////////////////////////////////////////
+    ////////                                  ////////
+    ////////        TEST FILE CREATION        ////////
+    ////////                                  ////////
+    //////////////////////////////////////////////////
+
+    /**
+     * Writes a sub-grid of the given grid in pseudo-NTv2 format. This method is used only for creating the test file.
+     * The file created by this method is not fully NTv2 compliant (in particular, we do not write complete header),
+     * but we take this opportunity for testing {@code NTv2.Loader} capability to be lenient.
+     *
+     * <p>This method has been executed once for creating the {@code "NTF_R93-extract.gsb"} test file and should not
+     * be needed anymore, but we keep it around in case we have new test files to generate. The parameter used for
+     * creating the test file are:</p>
+     *
+     * <ul>
+     *   <li>{@code gridX} = 72</li>
+     *   <li>{@code gridY} = 74</li>
+     *   <li>{@code nx}    =  6</li>
+     *   <li>{@code ny}    =  7</li>
+     * </ul>
+     *
+     * This ensure that the grid indices (75.7432814, 78.4451225) is included in the test file.
+     * Those grid indices is the location of the (2°25′32.4187″N 48°50′40.2441″W) test point to interpolate.
+     *
+     * <div class="section">Limitations</div>
+     * This method assumes that bounding box and increments have integer values, and that any fractional part
+     * is rounding errors. This is usually the case when using the {@code "SECONDS"} unit of measurement.
+     * This assumption does not apply to the shift values.
+     *
+     * @param grid  The full grid from which to extract a few values.
+     * @param out   Where to write the test file.
+     * @param gridX Index along the longitude axis of the first cell to write.
+     * @param gridY Index along the latitude axis of the first cell to write.
+     * @param nx    Number of cells to write along the longitude axis.
+     * @param ny    Number of cells to write along the latitude axis.
+     * @throws TransformException if an error occurred while computing the envelope.
+     * @throws IOException if an error occurred while writing the test file.
+     */
+    public static void writeSubGrid(final DatumShiftGridFile<Angle,Angle> grid, final Path out,
+            final int gridX, final int gridY, final int nx, final int ny) throws IOException, TransformException
+    {
+        Envelope envelope = new Envelope2D(null, gridX, gridY, nx - 1, ny - 1);
+        envelope = Envelopes.transform(grid.getCoordinateToGrid().inverse(), envelope);
+        final ByteBuffer buffer = ByteBuffer.allocate(4096);
+        buffer.order(ByteOrder.LITTLE_ENDIAN);
+        writeString(buffer, "NUM_OREC"); buffer.putInt(5); nextRecord(buffer);
+        writeString(buffer, "NUM_SREC"); buffer.putInt(7); nextRecord(buffer);
+        writeString(buffer, "NUM_FILE"); buffer.putInt(1); nextRecord(buffer);
+        writeString(buffer, "GS_TYPE");  writeString(buffer, "SECONDS");
+        writeString(buffer, "VERSION");  writeString(buffer, "SIS_TEST");   // Last overview record.
+        writeString(buffer, "S_LAT");    buffer.putDouble(Math.rint( envelope.getMinimum(1)));
+        writeString(buffer, "N_LAT");    buffer.putDouble(Math.rint( envelope.getMaximum(1)));
+        writeString(buffer, "E_LONG");   buffer.putDouble(Math.rint(-envelope.getMaximum(0)));  // Sign reversed.
+        writeString(buffer, "W_LONG");   buffer.putDouble(Math.rint(-envelope.getMinimum(0)));
+        writeString(buffer, "LAT_INC");  buffer.putDouble(Math.rint( envelope.getSpan(1) / (ny - 1)));
+        writeString(buffer, "LONG_INC"); buffer.putDouble(Math.rint( envelope.getSpan(0) / (nx - 1)));
+        writeString(buffer, "GS_COUNT"); buffer.putInt(nx * ny); nextRecord(buffer);
+        for (int y=0; y<ny; y++) {
+            for (int x=0; x<nx; x++) {
+                buffer.putFloat((float) grid.getCellValue(1, gridX + x, gridY + y));
+                buffer.putFloat((float) grid.getCellValue(0, gridX + x, gridY + y));
+                buffer.putFloat(ACCURACY);
+                buffer.putFloat(ACCURACY);
+            }
+        }
+        writeString(buffer, "END");
+        nextRecord(buffer);
+        try (final WritableByteChannel c = Files.newByteChannel(out, StandardOpenOption.CREATE, StandardOpenOption.WRITE)) {
+            buffer.flip();
+            c.write(buffer);
+        }
+    }
+
+    /**
+     * Writes the given string in the given buffer. It is caller's responsibility to ensure that the
+     * string does not occupy more than 8 bytes in US-ASCII encoding.
+     */
+    private static void writeString(final ByteBuffer buffer, final String keyword) {
+        final int upper = buffer.position() + 8;    // "8" is the space allowed for strings in NTv2 format.
+        buffer.put(keyword.getBytes(StandardCharsets.US_ASCII));
+        while (buffer.position() != upper) buffer.put((byte) ' ');
+    }
+
+    /**
+     * Moves the buffer position to the next record.
+     */
+    private static void nextRecord(final ByteBuffer buffer) {
+        buffer.position(((buffer.position() / 16) + 1) * 16);   // "16" is the length of records in NTv2 format.
+    }
 }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -129,13 +129,13 @@ public final strictfp class ProvidersTes
      * Ensures that every parameter instance is unique. Actually this test is not strong requirement.
      * This is only for sharing existing resources by avoiding unnecessary objects duplication.
      *
-     * @throws Exception if the instantiation of a service provider failed.
+     * @throws ReflectiveOperationException if the instantiation of a service provider failed.
      */
     @Test
-    public void ensureParameterUniqueness() throws Exception {
-        final Map<GeneralParameterDescriptor, String> groupNames = new IdentityHashMap<GeneralParameterDescriptor, String>();
-        final Map<GeneralParameterDescriptor, GeneralParameterDescriptor> parameters = new HashMap<GeneralParameterDescriptor, GeneralParameterDescriptor>();
-        final Map<Object, Object> namesAndIdentifiers = new HashMap<Object, Object>();
+    public void ensureParameterUniqueness() throws ReflectiveOperationException {
+        final Map<GeneralParameterDescriptor, String> groupNames = new IdentityHashMap<>();
+        final Map<GeneralParameterDescriptor, GeneralParameterDescriptor> parameters = new HashMap<>();
+        final Map<Object, Object> namesAndIdentifiers = new HashMap<>();
         for (final Class<?> c : methods()) {
             final OperationMethod method = (OperationMethod) c.newInstance();
             final ParameterDescriptorGroup group = method.getParameters();
@@ -184,7 +184,7 @@ public final strictfp class ProvidersTes
      */
     @Test
     public void testRedimension() {
-        final Map<Class<?>,Boolean> redimensionables = new HashMap<Class<?>,Boolean>(100);
+        final Map<Class<?>,Boolean> redimensionables = new HashMap<>(100);
         for (final Class<?> type : methods()) {
             assertNull(type.getName(), redimensionables.put(type, Boolean.FALSE));
         }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -60,12 +60,12 @@ public final strictfp class DefaultParam
     public static final DefaultParameterDescriptorGroup M1_M1_O1_O2;
     static {
         final Class<Integer> type = Integer.class;
-        final Map<String,Object> properties = new HashMap<String,Object>(4);
+        final Map<String,Object> properties = new HashMap<>(4);
         M1_M1_O1_O2 = new DefaultParameterDescriptorGroup(singletonMap(NAME_KEY, "Test group"), 0, 1,
-            new DefaultParameterDescriptor<Integer>(name(properties, "Mandatory 1", "Ambiguity"), 1, 1, type, null, null, DEFAULT_VALUE),
-            new DefaultParameterDescriptor<Integer>(name(properties, "Mandatory 2", "Alias 2"),   1, 1, type, null, null, DEFAULT_VALUE),
-            new DefaultParameterDescriptor<Integer>(name(properties, "Optional 3",  "Alias 3"),   0, 1, type, null, null, DEFAULT_VALUE),
-            new DefaultParameterDescriptor<Integer>(name(properties, "Optional 4",  "Ambiguity"), 0, 2, type, null, null, DEFAULT_VALUE)
+            new DefaultParameterDescriptor<>(name(properties, "Mandatory 1", "Ambiguity"), 1, 1, type, null, null, DEFAULT_VALUE),
+            new DefaultParameterDescriptor<>(name(properties, "Mandatory 2", "Alias 2"),   1, 1, type, null, null, DEFAULT_VALUE),
+            new DefaultParameterDescriptor<>(name(properties, "Optional 3",  "Alias 3"),   0, 1, type, null, null, DEFAULT_VALUE),
+            new DefaultParameterDescriptor<>(name(properties, "Optional 4",  "Ambiguity"), 0, 2, type, null, null, DEFAULT_VALUE)
         );
     }
 
@@ -84,10 +84,10 @@ public final strictfp class DefaultParam
     @Test
     public void testConstruction() {
         final Class<Integer> type = Integer.class;
-        final Map<String,Object> properties = new HashMap<String,Object>(4);
+        final Map<String,Object> properties = new HashMap<>(4);
         final DefaultParameterDescriptor<Integer> p1, p2;
-        p1 = new DefaultParameterDescriptor<Integer>(name(properties,   "Name",  null), 1, 1, type, null, null, null);
-        p2 = new DefaultParameterDescriptor<Integer>(name(properties, "  NAME ", null), 1, 1, type, null, null, null);
+        p1 = new DefaultParameterDescriptor<>(name(properties,   "Name",  null), 1, 1, type, null, null, null);
+        p2 = new DefaultParameterDescriptor<>(name(properties, "  NAME ", null), 1, 1, type, null, null, null);
         try {
             new DefaultParameterDescriptorGroup(singletonMap(NAME_KEY, "Test group"), 0, 1, p1, p2);
             fail("Constructor should have detected the duplicated names.");

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -55,7 +55,7 @@ public final strictfp class DefaultParam
      * @return The properties to be given to descriptor constructor.
      */
     private static Map<String,Object> properties(final String name) {
-        final Map<String,Object> properties = new HashMap<String,Object>(4);
+        final Map<String,Object> properties = new HashMap<>(4);
         assertNull(properties.put(DefaultParameterDescriptor.NAME_KEY, name));
         assertNull(properties.put(DefaultParameterDescriptor.LOCALE_KEY, Locale.US));
         return properties;
@@ -69,7 +69,7 @@ public final strictfp class DefaultParam
      * @return The parameter descriptor.
      */
     static <T> DefaultParameterDescriptor<T> createSimpleOptional(final String name, final Class<T> type) {
-        return new DefaultParameterDescriptor<T>(properties(name), 0, 1, type, null, null, null);
+        return new DefaultParameterDescriptor<>(properties(name), 0, 1, type, null, null, null);
     }
 
     /**
@@ -84,7 +84,7 @@ public final strictfp class DefaultParam
     static DefaultParameterDescriptor<Integer> create(final String name,
             final int minimumValue, final int maximumValue, final int defaultValue)
     {
-        return new DefaultParameterDescriptor<Integer>(properties(name), 1, 1, Integer.class,
+        return new DefaultParameterDescriptor<>(properties(name), 1, 1, Integer.class,
                 NumberRange.create(minimumValue, true, maximumValue, true), null, defaultValue);
     }
 
@@ -101,7 +101,7 @@ public final strictfp class DefaultParam
     static DefaultParameterDescriptor<Double> create(final String name,
             final double minimumValue, final double maximumValue, final double defaultValue, final Unit<?> unit)
     {
-        return new DefaultParameterDescriptor<Double>(properties(name), 1, 1, Double.class,
+        return new DefaultParameterDescriptor<>(properties(name), 1, 1, Double.class,
                 MeasurementRange.create(minimumValue, true, maximumValue, true, unit), null,
                 Double.isNaN(defaultValue) ? null : defaultValue);
     }
@@ -119,7 +119,7 @@ public final strictfp class DefaultParam
     static <T> DefaultParameterDescriptor<T> create(final String name, final Class<T> type,
             final T[] validValues, final T defaultValue)
     {
-        return new DefaultParameterDescriptor<T>(properties(name), 1, 1, type, null, validValues, defaultValue);
+        return new DefaultParameterDescriptor<>(properties(name), 1, 1, type, null, validValues, defaultValue);
     }
 
     /**
@@ -135,7 +135,7 @@ public final strictfp class DefaultParam
             final double minimumValue, final double maximumValue, final Unit<?> unit)
     {
         final MeasurementRange<Double> valueDomain = MeasurementRange.create(minimumValue, true, maximumValue, true, unit);
-        return new DefaultParameterDescriptor<double[]>(properties(name), 1, 1, double[].class, valueDomain, null, null);
+        return new DefaultParameterDescriptor<>(properties(name), 1, 1, double[].class, valueDomain, null, null);
     }
 
     /**
@@ -149,7 +149,7 @@ public final strictfp class DefaultParam
         final Map<String, Object> properties = properties(name);
         assertNull(properties.put(DefaultParameterDescriptor.IDENTIFIERS_KEY,
                 new ImmutableIdentifier(Citations.EPSG, Constants.EPSG, Short.toString(code))));
-        return new DefaultParameterDescriptor<Double>(properties, 0, 1, Double.class, null, null, null);
+        return new DefaultParameterDescriptor<>(properties, 0, 1, Double.class, null, null, null);
     }
 
     /**
@@ -228,8 +228,8 @@ public final strictfp class DefaultParam
      */
     @Test
     public void testStringType() {
-        final Range<String> valueDomain = new Range<String>(String.class, "AAA", true, "BBB", true);
-        final DefaultParameterDescriptor<String> descriptor = new DefaultParameterDescriptor<String>(
+        final Range<String> valueDomain = new Range<>(String.class, "AAA", true, "BBB", true);
+        final DefaultParameterDescriptor<String> descriptor = new DefaultParameterDescriptor<>(
                 properties("String param"), 0, 1, String.class, valueDomain, null, "ABC");
         assertEquals("name", "String param",     descriptor.getName().getCode());
         assertEquals("valueClass", String.class, descriptor.getValueClass());
@@ -299,7 +299,7 @@ public final strictfp class DefaultParam
          * Invalid operation: wrong type of range value.
          */
         try {
-            DefaultParameterDescriptor<double[]> p = new DefaultParameterDescriptor<double[]>(properties("Array param"),
+            DefaultParameterDescriptor<double[]> p = new DefaultParameterDescriptor<>(properties("Array param"),
                     0, 1, double[].class, NumberRange.create(4, true, 9, true), null, null);
             fail("Should not be allowed to create " + p);
         } catch (IllegalArgumentException e) {

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -72,12 +72,11 @@ public final strictfp class DefaultParam
      * and assigns to them an integer value in sequence with the given step. For example if {@code step} is 10,
      * then this method will create parameters with values 10, 20, 30 and 40.
      */
-    @SuppressWarnings({"unchecked", "rawtypes"})
     private DefaultParameterValue<?>[] createValues(final int step) {
         final List<GeneralParameterDescriptor> descriptors = descriptor.descriptors();
         final DefaultParameterValue<?>[] parameters = new DefaultParameterValue<?>[descriptors.size()];
         for (int i=0; i<parameters.length;) {
-            parameters[i] = new DefaultParameterValue((ParameterDescriptor<?>) descriptors.get(i));
+            parameters[i] = new DefaultParameterValue<>((ParameterDescriptor<?>) descriptors.get(i));
             parameters[i].setValue(++i * step);
         }
         return parameters;
@@ -240,8 +239,7 @@ public final strictfp class DefaultParam
     @DependsOnMethod({"testValuesAddAll", "testAddGroup", "testEqualsAndHashCode"})
     public void testValuesAddAllWithSubgroups() {
         final DefaultParameterDescriptorGroup group, subGroup;
-        final List<GeneralParameterDescriptor> descriptors =
-                new ArrayList<GeneralParameterDescriptor>(descriptor.descriptors());
+        final List<GeneralParameterDescriptor> descriptors = new ArrayList<>(descriptor.descriptors());
         subGroup = new DefaultParameterDescriptorGroup(singletonMap(NAME_KEY, "theSubGroup"),
                 2, 4, descriptors.toArray(new GeneralParameterDescriptor[descriptors.size()]));
         descriptors.add(subGroup);
@@ -266,7 +264,7 @@ public final strictfp class DefaultParam
         g1.parameter("Mandatory 1").setValue(3);
         g2.parameter( "Optional 4").setValue(7);
         g3.parameter("Mandatory 2").setValue(5);
-        final List<GeneralParameterValue> expected = new ArrayList<GeneralParameterValue>(6);
+        final List<GeneralParameterValue> expected = new ArrayList<>(6);
         assertTrue(expected.add(v2));
         assertTrue(expected.add(v3));
         assertTrue(expected.add(g1));
@@ -297,7 +295,7 @@ public final strictfp class DefaultParam
     public void testValuesAddWrongParameter() {
         final DefaultParameterValueGroup    group = createGroup(10);
         final List<GeneralParameterValue>  values = group.values();
-        final ParameterValue<Integer> nonExistent = new DefaultParameterDescriptor<Integer>(
+        final ParameterValue<Integer> nonExistent = new DefaultParameterDescriptor<>(
                 singletonMap(NAME_KEY, "Optional 5"), 0, 1, Integer.class, null, null, null).createValue();
         try {
             values.add(nonExistent);
@@ -426,7 +424,7 @@ public final strictfp class DefaultParam
     public void testEqualsIgnoreMetadata() {
         final DefaultParameterValueGroup g1 = createGroup(10);
         final DefaultParameterValueGroup g2 = new DefaultParameterValueGroup(g1.getDescriptor());
-        final List<GeneralParameterValue> values = new ArrayList<GeneralParameterValue>(g1.values());
+        final List<GeneralParameterValue> values = new ArrayList<>(g1.values());
         Collections.swap(values, 2, 3);
         g2.values().addAll(values);
 

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -94,7 +94,7 @@ public final strictfp class DefaultParam
      * @return A new parameter instance for the given name and value.
      */
     private static Watcher<Integer> createOptional(final String name, final int value) {
-        final Watcher<Integer> parameter = new Watcher<Integer>(
+        final Watcher<Integer> parameter = new Watcher<>(
                 DefaultParameterDescriptorTest.createSimpleOptional(name, Integer.class));
         parameter.setValue(value, null);
         return parameter;
@@ -109,7 +109,7 @@ public final strictfp class DefaultParam
      * @return A new parameter instance for the given name and value.
      */
     private static Watcher<Double> create(final String name, final double value, final Unit<?> unit) {
-        final Watcher<Double> parameter = new Watcher<Double>(DefaultParameterDescriptorTest.create(
+        final Watcher<Double> parameter = new Watcher<>(DefaultParameterDescriptorTest.create(
                 name, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN, unit));
         parameter.setValue(value, unit);
         return parameter;
@@ -179,7 +179,7 @@ public final strictfp class DefaultParam
     @Test
     @DependsOnMethod("testInteger")
     public void testBoundedInteger() {
-        final Watcher<Integer> parameter = new Watcher<Integer>(
+        final Watcher<Integer> parameter = new Watcher<>(
                 DefaultParameterDescriptorTest.create("Bounded param", -30, +40, 15));
         assertEquals(Integer.class, parameter.getDescriptor().getValueClass());
         assertEquals(      "value", Integer.valueOf(15), parameter.getValue());
@@ -299,7 +299,7 @@ public final strictfp class DefaultParam
     @Test
     @DependsOnMethod("testMeasure")
     public void testBoundedDouble() {
-        final Watcher<Double> parameter = new Watcher<Double>(
+        final Watcher<Double> parameter = new Watcher<>(
                 DefaultParameterDescriptorTest.create("Bounded param", -30.0, +40.0, 15.0, null));
         assertEquals(Double.class, parameter.getDescriptor().getValueClass());
         assertEquals(      "value", Double.valueOf(15), parameter.getValue());
@@ -343,7 +343,7 @@ public final strictfp class DefaultParam
     @Test
     @DependsOnMethod({"testMeasure", "testBoundedDouble"})
     public void testBoundedMeasure() {
-        final Watcher<Double> parameter = new Watcher<Double>(
+        final Watcher<Double> parameter = new Watcher<>(
                 DefaultParameterDescriptorTest.create("Length measure", 4, 20, 12, SI.METRE));
         assertEquals("value",    Double.valueOf(12), parameter.getValue());
         assertEquals("intValue", 12,                 parameter.intValue());
@@ -390,7 +390,7 @@ public final strictfp class DefaultParam
     @Test
     public void testArray() {
         double[] values = {5, 10, 15};
-        final Watcher<double[]> parameter = new Watcher<double[]>(
+        final Watcher<double[]> parameter = new Watcher<>(
                 DefaultParameterDescriptorTest.createForArray("myValues", 4, 4000, SI.METRE));
         parameter.setValue(values);
         assertArrayEquals(values, parameter.getValue(), 0);
@@ -435,7 +435,7 @@ public final strictfp class DefaultParam
         };
         final ParameterDescriptor<AxisDirection> descriptor = DefaultParameterDescriptorTest.create(
                 "Direction", AxisDirection.class, directions, AxisDirection.NORTH);
-        final DefaultParameterValue<AxisDirection> parameter = new DefaultParameterValue<AxisDirection>(descriptor);
+        final DefaultParameterValue<AxisDirection> parameter = new DefaultParameterValue<>(descriptor);
         validate(parameter);
 
         assertEquals     ("name",         "Direction",         descriptor.getName().getCode());
@@ -627,7 +627,7 @@ public final strictfp class DefaultParam
     @Test
     @DependsOnMethod("testWKT")
     public void testIdentifiedParameterWKT() {
-        final Watcher<Double> parameter = new Watcher<Double>(DefaultParameterDescriptorTest.createEPSG("A0", Constants.EPSG_A0));
+        final Watcher<Double> parameter = new Watcher<>(DefaultParameterDescriptorTest.createEPSG("A0", Constants.EPSG_A0));
         assertWktEquals(Convention.WKT2, "PARAMETER[“A0”, null, ID[“EPSG”, 8623]]", parameter);
     }
 }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MapProjectionParametersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MapProjectionParametersTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MapProjectionParametersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MapProjectionParametersTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -68,7 +68,7 @@ public final strictfp class MapProjectio
 
     /** Creates a parameter of the given name. */
     private static DefaultParameterDescriptor<?> parameter(final String name) {
-        return new DefaultParameterDescriptor<Double>(name(name), 1, 1, Double.class, null, null, null);
+        return new DefaultParameterDescriptor<>(name(name), 1, 1, Double.class, null, null, null);
     }
 
     /** Returns properties map for an object of the given name. */



Mime
View raw message