sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762629 [2/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-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -47,7 +47,7 @@ public final class CodeColorizer {
     /**
      * Lists of Java keywords.
      */
-    public static final Set<String> JAVA_KEYWORDS = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
+    public static final Set<String> JAVA_KEYWORDS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
         "abstract", "continue", "for",        "new",        "switch",
         "assert",   "default",  "goto",       "package",    "synchronized",
         "boolean",  "do",       "if",         "private",    "this",
@@ -106,23 +106,20 @@ public final class CodeColorizer {
      */
     public CodeColorizer(final Document document) throws IOException, BookException {
         this.document = document;
-        identifierSpecifiers = new HashMap<String,Specifier>(1000);
+        identifierSpecifiers = new HashMap<>(1000);
         for (final Specifier specifier : Specifier.values()) {
             final String filename = specifier.name() + ".lst";
             final InputStream in = CodeColorizer.class.getResourceAsStream(filename);
             if (in == null) {
                 throw new FileNotFoundException(filename);
             }
-            final BufferedReader r = new BufferedReader(new InputStreamReader(in, "UTF-8"));
-            try {
+            try (final BufferedReader r = new BufferedReader(new InputStreamReader(in, "UTF-8"))) {
                 String line;
                 while ((line = r.readLine()) != null) {
                     if (identifierSpecifiers.put(line, specifier) != null) {
                         throw new BookException(line + " is defined twice in " + specifier);
                     }
                 }
-            } finally {
-                r.close();
             }
         }
     }

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -28,6 +28,8 @@ import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.nio.file.FileSystemException;
+import java.nio.file.Files;
 import com.sun.javadoc.RootDoc;
 import com.sun.tools.doclets.formats.html.HtmlDoclet;
 
@@ -162,9 +164,9 @@ public final class Doclet extends HtmlDo
              * Copy the standard CSS file, skipping the import of DejaVu font
              * since our custom CSS file does not use it.
              */
-            final BufferedReader in  = openReader(stylesheetFile);
-            final BufferedWriter out = openWriter(standardFile);
-            try {
+            try (final BufferedReader in  = openReader(stylesheetFile);
+                 final BufferedWriter out = openWriter(standardFile))
+            {
                 String line;
                 while ((line = in.readLine()) != null) {
                     if (!line.equals("@import url('resources/fonts/dejavu.css');")) {
@@ -172,17 +174,14 @@ public final class Doclet extends HtmlDo
                         out.newLine();
                     }
                 }
-            } finally {
-                out.close();
-                in.close();
             }
         }
         /*
          * Copy the custom CSS file, skipping comments for more compact file.
          */
-        final BufferedReader in  = openReader(inputFile);
-        final BufferedWriter out = openWriter(stylesheetFile);
-        try {
+        try (final BufferedReader in  = openReader(inputFile);
+             final BufferedWriter out = openWriter(stylesheetFile))
+        {
             String line;
             while ((line = in.readLine()) != null) {
                 if (line.length() < 2 || line.charAt(1) != '*') {
@@ -190,9 +189,6 @@ public final class Doclet extends HtmlDo
                     out.newLine();
                 }
             }
-        } finally {
-            out.close();
-            in.close();
         }
     }
 
@@ -214,18 +210,27 @@ public final class Doclet extends HtmlDo
                        !name.equals(STYLESHEET);
             }
         });
-        final byte[] buffer = new byte[4096];
-        for (final File input : inputFiles) {
-            final FileInputStream  in  = new FileInputStream(input);
-            final FileOutputStream out = new FileOutputStream(new File(outputDirectory, input.getName()));
-            try {
-                int c;
-                while ((c = in.read(buffer)) >= 0) {
-                    out.write(buffer, 0, c);
-                }
-            } finally {
-                out.close();
-                in.close();
+        try {
+            for (final File input : inputFiles) {
+                final File output = new File(outputDirectory, input.getName());
+                if (!output.exists()) { // For avoiding a failure if the target exists.
+                    Files.createLink(output.toPath(), input.toPath());
+                }
+            }
+        } catch (UnsupportedOperationException | FileSystemException e) {
+            /*
+             * If hard links are not supported, performs plain copy instead.
+             */
+            final byte[] buffer = new byte[4096];
+            for (final File input : inputFiles) {
+                try (final FileInputStream  in  = new FileInputStream(input);
+                     final FileOutputStream out = new FileOutputStream(new File(outputDirectory, input.getName())))
+                {
+                    int c;
+                    while ((c = in.read(buffer)) >= 0) {
+                        out.write(buffer, 0, c);
+                    }
+                }
             }
         }
     }

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Rewriter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Rewriter.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Rewriter.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Rewriter.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -123,14 +123,11 @@ final class Rewriter {
         modified = false;
         this.file = file;
         content.setLength(0);
-        final Reader in = new InputStreamReader(new FileInputStream(file), ENCODING);
-        try {
+        try (final Reader in = new InputStreamReader(new FileInputStream(file), ENCODING)) {
             int n;
             while ((n = in.read(buffer)) >= 0) {
                 content.append(buffer, 0, n);
             }
-        } finally {
-            in.close();
         }
     }
 
@@ -140,11 +137,8 @@ final class Rewriter {
      */
     private void save() throws IOException {
         if (modified) {
-            final Writer out = new OutputStreamWriter(new FileOutputStream(file), ENCODING);
-            try {
+            try (final Writer out = new OutputStreamWriter(new FileOutputStream(file), ENCODING)) {
                 out.append(content);
-            } finally {
-                out.close();
             }
         }
     }

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Assembler.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -83,8 +83,7 @@ public class Assembler extends AbstractM
         final String artifactBase = FINALNAME_PREFIX + version;
         try {
             final File targetFile = new File(distributionDirectory(targetDirectory), artifactBase + ".zip");
-            final ZipArchiveOutputStream zip = new ZipArchiveOutputStream(targetFile);
-            try {
+            try (ZipArchiveOutputStream zip = new ZipArchiveOutputStream(targetFile)) {
                 zip.setLevel(9);
                 appendRecursively(sourceDirectory, artifactBase, zip, new byte[8192]);
                 /*
@@ -106,8 +105,6 @@ public class Assembler extends AbstractM
                         zip.closeArchiveEntry();
                     }
                 });
-            } finally {
-                zip.close();
             }
         } catch (IOException e) {
             throw new MojoExecutionException(e.getLocalizedMessage(), e);
@@ -132,14 +129,11 @@ public class Assembler extends AbstractM
         }
         out.putArchiveEntry(entry);
         if (!entry.isDirectory()) {
-            final FileInputStream in = new FileInputStream(file);
-            try {
+            try (FileInputStream in = new FileInputStream(file)) {
                 int n;
                 while ((n = in.read(buffer)) >= 0) {
                     out.write(buffer, 0, n);
                 }
-            } finally {
-                in.close();
             }
         }
         out.closeArchiveEntry();

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/JarCollector.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -36,6 +36,11 @@ import org.apache.maven.artifact.Artifac
 
 import static org.apache.sis.internal.maven.Filenames.*;
 
+// Related to JDK7
+import java.nio.file.Path;
+import java.nio.file.Files;
+import java.nio.file.FileSystemException;
+
 
 /**
  * Collects <code>.jar</code> files in a single "{@code target/binaries}" directory.
@@ -221,6 +226,19 @@ public final class JarCollector extends
      * @param copy The destination file to create.
      */
     private static void linkFileToDirectory(final File file, final File copy) throws IOException {
+        final Path source = file.toPath();
+        final Path target = copy.toPath();
+        try {
+            Files.createLink(target, source);
+            return;
+        } catch (UnsupportedOperationException | FileSystemException e) {
+            /*
+             * If hard links are not supported, edit the "content.txt" file instead.
+             * Note that a hard link may be unsupported because the source and target
+             * are on different Windows drives or mount points, in which case we get
+             * a FileSystemException instead than UnsupportedOperationException.
+             */
+        }
         /*
          * If we can not use hard links, creates or updates a "target/content.txt" file instead.
          * This file will contains the list of all dependencies, without duplicated values.
@@ -229,14 +247,11 @@ public final class JarCollector extends
         final Set<String> dependencies = loadDependencyList(dependenciesFile);
         if (dependencies.add(file.getPath())) {
             // Save the dependencies list only if it has been modified.
-            final BufferedWriter out = new BufferedWriter(new FileWriter(dependenciesFile));
-            try {
+            try (BufferedWriter out = new BufferedWriter(new FileWriter(dependenciesFile))) {
                 for (final String dependency : dependencies) {
                     out.write(dependency);
                     out.newLine();
                 }
-            } finally {
-                out.close();
             }
         }
     }
@@ -247,10 +262,9 @@ public final class JarCollector extends
      * platforms that do not support hard links.
      */
     static Set<String> loadDependencyList(final File dependenciesFile) throws IOException {
-        final Set<String> dependencies = new LinkedHashSet<String>();
+        final Set<String> dependencies = new LinkedHashSet<>();
         if (dependenciesFile.exists()) {
-            final BufferedReader in = new BufferedReader(new FileReader(dependenciesFile));
-            try {
+            try (BufferedReader in = new BufferedReader(new FileReader(dependenciesFile))) {
                 String line;
                 while ((line = in.readLine()) != null) {
                     line = line.trim();
@@ -258,8 +272,6 @@ public final class JarCollector extends
                         dependencies.add(line);
                     }
                 }
-            } finally {
-                in.close();
             }
         }
         return dependencies;

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/PackOutput.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -83,7 +83,7 @@ final class PackOutput implements Closea
      *
      * @see #isMergeAllowed(String)
      */
-    private final Set<String> entriesDone = new HashSet<String>();
+    private final Set<String> entriesDone = new HashSet<>();
 
     /**
      * Returns {@code true} if entries of the given name are allowed to be concatenated
@@ -147,8 +147,7 @@ final class PackOutput implements Closea
         for (final File input : inputJARs.keySet()) {
             if (!input.getName().startsWith("sis-")) {
                 String packageName = null;
-                final JarFile jar = new JarFile(input, false);
-                try {
+                try (JarFile jar = new JarFile(input, false)) {
                     final Enumeration<JarEntry> entries = jar.entries();
                     while (entries.hasMoreElements()) {
                         final JarEntry entry = entries.nextElement();
@@ -183,8 +182,6 @@ final class PackOutput implements Closea
                             manifest.getEntries().put(packageName, attributes);
                         }
                     }
-                } finally {
-                    jar.close();
                 }
             }
         }
@@ -219,8 +216,7 @@ final class PackOutput implements Closea
         for (final Iterator<Map.Entry<File,PackInput>> it = inputJARs.entrySet().iterator(); it.hasNext();) {
             final Map.Entry<File,PackInput> inputJAR = it.next();
             it.remove(); // Needs to be removed before the inner loop below.
-            final PackInput input = inputJAR.getValue();
-            try {
+            try (PackInput input = inputJAR.getValue()) {
                 for (JarEntry entry; (entry = input.nextEntry()) != null;) {
                     final String name = entry.getName();
                     boolean isMergeAllowed = false;
@@ -245,8 +241,6 @@ final class PackOutput implements Closea
                     }
                     outputStream.closeEntry();
                 }
-            } finally {
-                input.close();
             }
         }
     }
@@ -332,16 +326,10 @@ final class PackOutput implements Closea
         p.put(DEFLATE_HINT,       TRUE);            // Ignore all JAR deflation requests.
         p.put(UNKNOWN_ATTRIBUTE,  ERROR);           // Throw an error if an attribute is unrecognized
         p.put(CODE_ATTRIBUTE_PFX+"LocalVariableTable", STRIP);        // discard debug attributes.
-        final JarFile jarFile = new JarFile(inputFile);
-        try {
-            final OutputStream deflater = new GZIPOutputStream(out);
-            try {
+        try (JarFile jarFile = new JarFile(inputFile)) {
+            try (OutputStream deflater = new GZIPOutputStream(out)) {
                 packer.pack(jarFile, deflater);
-            } finally {
-                deflater.close();
             }
-        } finally {
-            jarFile.close();
         }
         if (!inputFile.delete()) {
             throw new IOException("Can't delete temporary file: " + inputFile);

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/maven/Packer.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -92,7 +92,7 @@ final class Packer implements FilenameFi
     private Map<File,PackInput> getInputJARs() throws IOException {
         final Set<String> filenames = JarCollector.loadDependencyList(new File(binariesDirectory, CONTENT_FILE));
         filenames.addAll(Arrays.asList(binariesDirectory.list(this)));
-        final Map<File,PackInput> inputJARs = new LinkedHashMap<File,PackInput>(filenames.size() * 4/3);
+        final Map<File,PackInput> inputJARs = new LinkedHashMap<>(filenames.size() * 4/3);
         for (final String filename : filenames) {
             File file = new File(filename);
             if (!file.isAbsolute()) {

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -97,9 +97,7 @@ public final class Include extends Inlin
         file = new File(file.getParentFile(), reference.substring(0, sep));
         final String anchor = reference.substring(sep + 1);
         final StringBuilder buffer = new StringBuilder();
-        BufferedReader in = null;
-        try {
-            in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
+        try (final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"))) {
             /*
              * Search the anchor.
              */
@@ -133,12 +131,6 @@ public final class Include extends Inlin
             }
         } catch (IOException e) {
             printError(position, "Error reading " + file + ":\n" + e);
-        } finally {
-            if (in != null) try {
-                in.close();
-            } catch (IOException e) {
-                printError(position, "Error reading " + file + ":\n" + e);
-            }
         }
         return buffer.toString();
     }

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -50,10 +50,10 @@ abstract class InlineTaglet implements T
              */
             try {
                 configuration = (Configuration) ConfigurationImpl.class.getMethod("getInstance").invoke(null);
-            } catch (Exception e) { // ReflectiveOperationException on the JDK7 branch
+            } catch (ReflectiveOperationException e) {
                 try {
                     configuration = ConfigurationImpl.class.newInstance();
-                } catch (Exception e2) { // ReflectiveOperationException on the JDK7 branch
+                } catch (ReflectiveOperationException e2) {
                     return null; // Allowed by this method contract.
                 }
             }

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/FilteredJarFile.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -85,9 +85,8 @@ final class FilteredJarFile extends JarF
         if (!ze.getName().equals(JarFile.MANIFEST_NAME)) {
             return in;
         }
-        final List<String> lines = new ArrayList<String>();
-        final BufferedReader reader = new BufferedReader(new InputStreamReader(in, MANIFEST_ENCODING));
-        try {
+        final List<String> lines = new ArrayList<>();
+        try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, MANIFEST_ENCODING))) {
             String line;
             while ((line = reader.readLine()) != null) {
                 if (line.trim().startsWith("SHA1-Digest:")) {
@@ -101,8 +100,6 @@ final class FilteredJarFile extends JarF
                 }
                 lines.add(line);
             }
-        } finally {
-            reader.close();
         }
         /*
          * 'in' has been closed at this point (indirectly, by closing the reader).

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/internal/unopkg/UnoPkg.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -157,8 +157,7 @@ public final class UnoPkg extends Abstra
         final File    manifestFile = new File(sourceDirectory, manifestName);
         final File[]          jars = outputDirectory.listFiles(this);
         final File[]          rdbs = sourceDirectory.listFiles(this);
-        final ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile));
-        try {
+        try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile))) {
             out.setLevel(9);
             if (manifestFile.isFile()) {
                 copyFiltered(manifestFile, out, manifestName);
@@ -207,21 +206,16 @@ public final class UnoPkg extends Abstra
                     }
                     if (packer != null && name.endsWith(".jar")) {
                         name = name.substring(0, name.length()-3) + "pack";
-                        final JarFile jar = new FilteredJarFile(file);
-                        try {
+                        try (JarFile jar = new FilteredJarFile(file)) {
                             out.putNextEntry(new ZipEntry(name));
                             packer.pack(jar, out);
                             out.closeEntry();
-                        } finally {
-                            jar.close();
                         }
                     } else {
                         copy(file, out, name);
                     }
                 }
             }
-        } finally {
-            out.close();
         }
     }
 
@@ -243,15 +237,12 @@ public final class UnoPkg extends Abstra
             entry.setCrc(getCRC32(file));
         }
         out.putNextEntry(entry);
-        final InputStream in = new FileInputStream(file);
-        try {
+        try (InputStream in = new FileInputStream(file)) {
             final byte[] buffer = new byte[4*1024];
             int length;
             while ((length = in.read(buffer)) >= 0) {
                 out.write(buffer, 0, length);
             }
-        } finally {
-            in.close();
         }
         out.closeEntry();
     }
@@ -266,8 +257,7 @@ public final class UnoPkg extends Abstra
         final ZipEntry entry = new ZipEntry(name);
         out.putNextEntry(entry);
         final Writer writer = new OutputStreamWriter(out, ENCODING);
-        final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), ENCODING));
-        try {
+        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), ENCODING))) {
             String line; while ((line=in.readLine()) != null) {
                 int r=-1; while ((r=line.indexOf(SUBSTITUTE, r+1)) >= 0) {
                     line = line.substring(0, r) + finalName + line.substring(r + SUBSTITUTE.length());
@@ -275,8 +265,6 @@ public final class UnoPkg extends Abstra
                 writer.write(line);
                 writer.write('\n');
             }
-        } finally {
-            in.close();
         }
         writer.flush();
         out.closeEntry();
@@ -287,15 +275,12 @@ public final class UnoPkg extends Abstra
      */
     private static long getCRC32(final File file) throws IOException {
         final CRC32 crc = new CRC32();
-        final InputStream in = new FileInputStream(file);
-        try {
+        try (InputStream in = new FileInputStream(file)) {
             final byte[] buffer = new byte[4*1024];
             int length;
             while ((length = in.read(buffer)) >= 0) {
                 crc.update(buffer, 0, length);
             }
-        } finally {
-            in.close();
         }
         return crc.getValue();
     }

Modified: sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java [UTF-8] (original)
+++ sis/trunk/core/sis-build-helper/src/main/java/org/apache/sis/util/resources/IndexedResourceCompiler.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -103,13 +103,13 @@ class IndexedResourceCompiler implements
      * Integer IDs allocated to resource keys. This map will be shared for all languages
      * of a given resource bundle.
      */
-    private final Map<Integer,String> allocatedIDs = new HashMap<Integer,String>();
+    private final Map<Integer,String> allocatedIDs = new HashMap<>();
 
     /**
      * Resource keys and their localized values. This map will be cleared for each language
      * in a resource bundle.
      */
-    private final Map<Object,Object> resources = new HashMap<Object,Object>();
+    private final Map<Object,Object> resources = new HashMap<>();
 
     /**
      * The resources bundle base classes.
@@ -169,8 +169,7 @@ class IndexedResourceCompiler implements
      * @throws IOException If an error occurred while reading the source file.
      */
     private void loadKeyValues() throws IOException {
-        final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(bundleClass), JAVA_ENCODING));
-        try {
+        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(bundleClass), JAVA_ENCODING))) {
             String line;
             while ((line = in.readLine()) != null) {
                 if ((line = line.trim()).startsWith(KEY_MODIFIERS)) {
@@ -189,8 +188,6 @@ class IndexedResourceCompiler implements
                     }
                 }
             }
-        } finally {
-            in.close();
         }
     }
 
@@ -274,12 +271,9 @@ class IndexedResourceCompiler implements
      */
     private static Properties loadRawProperties(final File file) throws IOException {
         final Properties properties;
-        final InputStream input = new FileInputStream(file);
-        try {
+        try (InputStream input = new FileInputStream(file)) {
             properties = new Properties();
             properties.load(input);
-        } finally {
-            input.close();
         }
         return properties;
     }
@@ -439,15 +433,12 @@ search: for (int i=0; i<buffer.length();
             throw new IOException("Can't create the " + directory + " directory.");
         }
         final int count = allocatedIDs.isEmpty() ? 0 : Collections.max(allocatedIDs.keySet()) + 1;
-        final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
-        try {
+        try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
             out.writeInt(count);
             for (int i=0; i<count; i++) {
                 final String value = (String) resources.get(allocatedIDs.get(i));
                 out.writeUTF((value != null) ? value : "");
             }
-        } finally {
-            out.close();
         }
     }
 
@@ -478,8 +469,7 @@ search: for (int i=0; i<buffer.length();
          * on the same line than the class declaration).
          */
         boolean modified;
-        final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), JAVA_ENCODING));
-        try {
+        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), JAVA_ENCODING))) {
             for (int state=0; state<=2; state++) {
                 final String regex;
                 switch (state) {
@@ -584,15 +574,10 @@ search: for (int i=0; i<buffer.length();
                     buffer.append(line).append(lineSeparator);
                 }
             }
-        } finally {
-            in.close();
         }
         if (modified) {
-            final Writer out = new OutputStreamWriter(new FileOutputStream(file), JAVA_ENCODING);
-            try {
+            try (Writer out = new OutputStreamWriter(new FileOutputStream(file), JAVA_ENCODING)) {
                 out.write(buffer.toString());
-            } finally {
-                out.close();
             }
         }
     }

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -33,7 +33,6 @@ import org.apache.sis.util.Classes;
 import org.apache.sis.util.ArgumentChecks;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**
@@ -122,8 +121,8 @@ public abstract class AbstractAttribute<
     public static <V> AbstractAttribute<V> create(final DefaultAttributeType<V> type) {
         ArgumentChecks.ensureNonNull("type", type);
         return isSingleton(type.getMaximumOccurs())
-               ? new SingletonAttribute<V>(type)
-               : new MultiValuedAttribute<V>(type);
+               ? new SingletonAttribute<>(type)
+               : new MultiValuedAttribute<>(type);
     }
 
     /**
@@ -138,8 +137,8 @@ public abstract class AbstractAttribute<
     static <V> AbstractAttribute<V> create(final DefaultAttributeType<V> type, final Object value) {
         ArgumentChecks.ensureNonNull("type", type);
         return isSingleton(type.getMaximumOccurs())
-               ? new SingletonAttribute<V>(type, value)
-               : new MultiValuedAttribute<V>(type, value);
+               ? new SingletonAttribute<>(type, value)
+               : new MultiValuedAttribute<>(type, value);
     }
 
     /**
@@ -465,7 +464,7 @@ public abstract class AbstractAttribute<
         final StringBuilder buffer = FieldType.toString("Attribute", type.getName(),
                 Classes.getShortName(type.getValueClass()), getValues().iterator());
         if (characteristics != null && !characteristics.isEmpty()) {
-            buffer.append(JDK7.lineSeparator());
+            buffer.append(System.lineSeparator());
             String separator = "└─ characteristics: ";
             for (final Map.Entry<String,AbstractAttribute<?>> entry : characteristics.entrySet()) {
                 buffer.append(separator).append(entry.getKey()).append('=').append(entry.getValue().getValue());

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -30,7 +30,7 @@ import org.apache.sis.util.CorruptedObje
 import org.apache.sis.internal.util.CheckedArrayList;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -207,7 +207,6 @@ public abstract class AbstractFeature im
      * @param  value  the value to wrap.
      * @return A {@code Property} wrapping the given value.
      */
-    @SuppressWarnings({"unchecked","rawtypes"})
     final Property createProperty(final String name, final Object value) {
         final AbstractIdentifiedType pt = type.getProperty(name);
         if (pt instanceof DefaultAttributeType<?>) {
@@ -606,7 +605,7 @@ public abstract class AbstractFeature im
      */
     @SuppressWarnings("unchecked")
     private static <V> Collection<V> singletonList(final Class<V> valueClass, final int minimumOccurs, final Object value) {
-        final CheckedArrayList<V> values = new CheckedArrayList<V>(valueClass, Math.max(minimumOccurs, 4));
+        final CheckedArrayList<V> values = new CheckedArrayList<>(valueClass, Math.max(minimumOccurs, 4));
         values.add((V) value); // Type will be checked by CheckedArrayList.
         return values;
     }

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.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-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -30,7 +30,7 @@ import org.apache.sis.util.Classes;
 import org.apache.sis.util.Debug;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 import org.apache.sis.internal.jdk8.UncheckedIOException;
 
 
@@ -90,7 +90,7 @@ public abstract class AbstractOperation
      * @param  identification  the map given by user to sub-class constructor.
      */
     final Map<String,Object> resultIdentification(final Map<String,?> identification) {
-        final Map<String,Object> properties = new HashMap<String,Object>(6);
+        final Map<String,Object> properties = new HashMap<>(6);
         for (final Map.Entry<String,?> entry : identification.entrySet()) {
             final String key = entry.getKey();
             if (key != null && key.startsWith(RESULT_PREFIX)) {

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

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AttributeView.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -22,7 +22,7 @@ import java.util.Collections;
 import org.opengis.util.GenericName;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -74,9 +74,9 @@ class AttributeView<V> extends AbstractA
      */
     static <V> AbstractAttribute<V> create(final AbstractFeature feature, final DefaultAttributeType<V> type) {
         if (isSingleton(type.getMaximumOccurs())) {
-            return new Singleton<V>(feature, type);
+            return new Singleton<>(feature, type);
         } else {
-            return new AttributeView<V>(feature, type);
+            return new AttributeView<>(feature, type);
         }
     }
 

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -52,7 +52,7 @@ final class CharacteristicTypeMap extend
      */
     @SuppressWarnings("unchecked")
     private static final WeakValueHashMap<DefaultAttributeType<?>[],CharacteristicTypeMap> SHARED =
-            new WeakValueHashMap<DefaultAttributeType<?>[],CharacteristicTypeMap>((Class) DefaultAttributeType[].class);
+            new WeakValueHashMap<>((Class) DefaultAttributeType[].class);
 
     /*
      * This class has intentionally no reference to the DefaultAttributeType for which we are providing characteristics.
@@ -108,7 +108,7 @@ final class CharacteristicTypeMap extend
     private CharacteristicTypeMap(final DefaultAttributeType<?> source, final DefaultAttributeType<?>[] characterizedBy) {
         this.characterizedBy = characterizedBy;
         int index = 0;
-        final Map<String,Integer> indices = new HashMap<String,Integer>(Containers.hashMapCapacity(characterizedBy.length));
+        final Map<String,Integer> indices = new HashMap<>(Containers.hashMapCapacity(characterizedBy.length));
         for (int i=0; i<characterizedBy.length; i++) {
             final DefaultAttributeType<?> attribute = characterizedBy[i];
             ensureNonNullElement("characterizedBy", i, attribute);

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociationRole.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -218,7 +218,7 @@ public class DefaultAssociationRole exte
                      * this desired feature in an association of the 'creating' feature, instead than beeing
                      * the 'creating' feature itself. This is a little bit unusual, but not illegal.
                      */
-                    final List<DefaultFeatureType> deferred = new ArrayList<DefaultFeatureType>();
+                    final List<DefaultFeatureType> deferred = new ArrayList<>();
                     resolved = search(creating, name, deferred);
                     if (resolved == null) {
                         /*
@@ -306,7 +306,7 @@ public class DefaultAssociationRole exte
      * @return the feature of the given name, or {@code null} if none.
      */
     private static DefaultFeatureType deepSearch(final List<DefaultFeatureType> deferred, final GenericName name) {
-        final Map<FeatureType,Boolean> done = new IdentityHashMap<FeatureType,Boolean>(8);
+        final Map<FeatureType,Boolean> done = new IdentityHashMap<>(8);
         for (int i=0; i<deferred.size();) {
             DefaultFeatureType valueType = deferred.get(i++);
             if (done.put(valueType, Boolean.TRUE) == null) {

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

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -41,7 +41,7 @@ import org.apache.sis.internal.util.Unmo
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.JDK8;
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -273,7 +273,7 @@ public class DefaultFeatureType extends
          * in case of duplicated values. Opportunistically verify for null values. The same verification could
          * be done in the scanPropertiesFrom(…) method, but doing it here produces a less confusing stacktrace.
          */
-        final List<AbstractIdentifiedType> sourceProperties = new ArrayList<AbstractIdentifiedType>(properties.length);
+        final List<AbstractIdentifiedType> sourceProperties = new ArrayList<>(properties.length);
         for (int i=0; i<properties.length; i++) {
             final AbstractIdentifiedType property = properties[i];
             ArgumentChecks.ensureNonNullElement("properties", i, property);
@@ -343,9 +343,9 @@ public class DefaultFeatureType extends
      */
     private void computeTransientFields(final List<AbstractIdentifiedType> properties) {
         final int capacity = Containers.hashMapCapacity(properties.size());
-        byName       = new LinkedHashMap<String,AbstractIdentifiedType>(capacity);
-        indices      = new LinkedHashMap<String,Integer>(capacity);
-        assignableTo = new HashSet<GenericName>(4);
+        byName       = new LinkedHashMap<>(capacity);
+        indices      = new LinkedHashMap<>(capacity);
+        assignableTo = new HashSet<>(4);
         assignableTo.add(super.getName());
         scanPropertiesFrom(this, properties);
         allProperties = UnmodifiableArrayList.wrap(byName.values().toArray(new AbstractIdentifiedType[byName.size()]));
@@ -389,7 +389,7 @@ public class DefaultFeatureType extends
          *
          * In the 'aliases' map below, null values will be assigned to ambiguous short names.
          */
-        final Map<String, AbstractIdentifiedType> aliases = new LinkedHashMap<String, AbstractIdentifiedType>();
+        final Map<String, AbstractIdentifiedType> aliases = new LinkedHashMap<>();
         for (final AbstractIdentifiedType property : allProperties) {
             final GenericName name = property.getName();
             final LocalName tip = name.tip();
@@ -564,7 +564,7 @@ public class DefaultFeatureType extends
                     final DefaultFeatureType valueType = ((DefaultAssociationRole) property).getValueType();
                     if (valueType != this) {
                         if (previous == null) {
-                            previous = new IdentityHashMap<FeatureType,Boolean>(8);
+                            previous = new IdentityHashMap<>(8);
                         }
                         Boolean r = previous.put(valueType, Boolean.FALSE);
                         if (r == null) {

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -37,8 +37,8 @@ import org.apache.sis.referencing.CRS;
 import org.apache.sis.util.resources.Errors;
 
 // Branch-dependent imports
+import java.util.Objects;
 import org.apache.sis.internal.jdk8.JDK8;
-import org.apache.sis.internal.jdk7.Objects;
 
 
 /**
@@ -130,7 +130,7 @@ final class EnvelopeOperation extends Ab
          * The map values will be the default Coordinate Reference System, or null if none.
          */
         boolean characterizedByCRS = false;
-        final Map<String,CoordinateReferenceSystem> names = new LinkedHashMap<String,CoordinateReferenceSystem>(4);
+        final Map<String,CoordinateReferenceSystem> names = new LinkedHashMap<>(4);
         for (AbstractIdentifiedType property : geometryAttributes) {
             if (AttributeConvention.isGeometryAttribute(property)) {
                 final GenericName name = property.getName();
@@ -193,7 +193,7 @@ final class EnvelopeOperation extends Ab
                 }
             }
         }
-        resultType = FeatureOperations.POOL.unique(new DefaultAttributeType<Envelope>(
+        resultType = FeatureOperations.POOL.unique(new DefaultAttributeType<>(
                 resultIdentification(identification), Envelope.class, 1, 1, null));
         this.crs = crs;
     }

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -79,7 +79,7 @@ public class FeatureFormat extends Tabul
     /**
      * An instance created when first needed and potentially shared.
      */
-    private static final AtomicReference<FeatureFormat> INSTANCE = new AtomicReference<FeatureFormat>();
+    private static final AtomicReference<FeatureFormat> INSTANCE = new AtomicReference<>();
 
     /**
      * The locale for international strings.
@@ -90,8 +90,8 @@ public class FeatureFormat extends Tabul
      * Creates a new formatter for the default locale and timezone.
      */
     public FeatureFormat() {
-        super(Locale.getDefault(), TimeZone.getDefault());
-        displayLocale = super.getLocale(); // This is different on the JDK7 branch.
+        super(Locale.getDefault(Locale.Category.FORMAT), TimeZone.getDefault());
+        displayLocale = Locale.getDefault(Locale.Category.DISPLAY);
         columnSeparator = " │ ";
     }
 
@@ -119,6 +119,22 @@ public class FeatureFormat extends Tabul
     }
 
     /**
+     * Returns the locale for the given category.
+     *
+     * <ul>
+     *   <li>{@link java.util.Locale.Category#FORMAT} specifies the locale to use for values.</li>
+     *   <li>{@link java.util.Locale.Category#DISPLAY} specifies the locale to use for labels.</li>
+     * </ul>
+     *
+     * @param  category The category for which a locale is desired.
+     * @return The locale for the given category (never {@code null}).
+     */
+    @Override
+    public Locale getLocale(final Locale.Category category) {
+        return (category == Locale.Category.DISPLAY) ? displayLocale : super.getLocale(category);
+    }
+
+    /**
      * Invoked when the formatter needs to move to the next column.
      */
     private void nextColumn(final TableAppender table) {

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -112,7 +112,7 @@ public final class FeatureOperations ext
     /**
      * The pool of operations or operation dependencies created so far, for sharing exiting instances.
      */
-    static final WeakHashSet<AbstractIdentifiedType> POOL = new WeakHashSet<AbstractIdentifiedType>(AbstractIdentifiedType.class);
+    static final WeakHashSet<AbstractIdentifiedType> POOL = new WeakHashSet<>(AbstractIdentifiedType.class);
 
     /**
      * Do not allow instantiation of this class.

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -68,7 +68,7 @@ abstract class Field<V> extends Property
      * @return The features or attribute values in a <cite>live</cite> collection.
      */
     public Collection<V> getValues() {
-        return new PropertySingleton<V>(this);
+        return new PropertySingleton<>(this);
     }
 
     /**

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -60,7 +60,7 @@ final class LinkOperation extends Abstra
     static ParameterDescriptorGroup parameters(final String name, final int minimumOccurs,
             final ParameterDescriptor<?>... parameters)
     {
-        final Map<String,Object> properties = new HashMap<String,Object>(4);
+        final Map<String,Object> properties = new HashMap<>(4);
         properties.put(ParameterDescriptorGroup.NAME_KEY, name);
         properties.put(Identifier.AUTHORITY_KEY, Citations.SIS);
         return new DefaultParameterDescriptorGroup(properties, minimumOccurs, 1);

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAssociation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAssociation.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAssociation.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAssociation.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -62,7 +62,7 @@ final class MultiValuedAssociation exten
      */
     public MultiValuedAssociation(final DefaultAssociationRole role) {
         super(role);
-        values = new CheckedArrayList<AbstractFeature>(AbstractFeature.class);
+        values = new CheckedArrayList<>(AbstractFeature.class);
     }
 
     /**
@@ -74,7 +74,7 @@ final class MultiValuedAssociation exten
     MultiValuedAssociation(final DefaultAssociationRole role, final Object values) {
         super(role);
         if (values == null) {
-            this.values = new CheckedArrayList<AbstractFeature>(AbstractFeature.class);
+            this.values = new CheckedArrayList<>(AbstractFeature.class);
         } else {
             this.values = CheckedArrayList.castOrCopy((CheckedArrayList<?>) values, AbstractFeature.class);
         }

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -67,7 +67,7 @@ final class MultiValuedAttribute<V> exte
      */
     public MultiValuedAttribute(final DefaultAttributeType<V> type) {
         super(type);
-        values = new CheckedArrayList<V>(type.getValueClass());
+        values = new CheckedArrayList<>(type.getValueClass());
         final V value = type.getDefaultValue();
         if (value != null) {
             values.add(value);
@@ -86,7 +86,7 @@ final class MultiValuedAttribute<V> exte
         super(type);
         final Class<V> valueClass = type.getValueClass();
         if (values == null) {
-            this.values = new CheckedArrayList<V>(valueClass);
+            this.values = new CheckedArrayList<>(valueClass);
         } else {
             final Class<?> actual = ((CheckedContainer<?>) values).getElementType();
             if (actual == valueClass) {

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

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

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

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/SparseFeature.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/SparseFeature.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/SparseFeature.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/SparseFeature.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -27,7 +27,7 @@ import org.apache.sis.util.CorruptedObje
 import org.apache.sis.util.resources.Errors;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -106,7 +106,7 @@ final class SparseFeature extends Abstra
     public SparseFeature(final DefaultFeatureType type) {
         super(type);
         indices = type.indices();
-        properties = new HashMap<Integer, Object>();
+        properties = new HashMap<>();
     }
 
     /**

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -33,7 +33,7 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.Classes;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -154,7 +154,7 @@ final class StringJoinOperation extends
             attributeNames[i] = name.toString();
             converters[i] = ObjectConverters.find(String.class, ((DefaultAttributeType<?>) attributeType).getValueClass());
         }
-        resultType = FeatureOperations.POOL.unique(new DefaultAttributeType<String>(
+        resultType = FeatureOperations.POOL.unique(new DefaultAttributeType<>(
                 resultIdentification(identification), String.class, 1, 1, null));
         this.delimiter = delimiter;
         this.prefix = (prefix == null) ? "" : prefix;

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -38,7 +38,7 @@ import org.apache.sis.util.ObjectConvert
 import org.apache.sis.util.UnconvertibleObjectException;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -128,7 +128,7 @@ public final class AttributeTypeBuilder<
     AttributeTypeBuilder(final FeatureTypeBuilder owner, final Class<V> valueClass) {
         super(owner, null);
         this.valueClass = valueClass;
-        characteristics = new ArrayList<CharacteristicTypeBuilder<?>>();
+        characteristics = new ArrayList<>();
     }
 
     /**
@@ -144,9 +144,9 @@ public final class AttributeTypeBuilder<
         valueClass    = template.getValueClass();
         defaultValue  = template.getDefaultValue();
         final Map<String, DefaultAttributeType<?>> tc = template.characteristics();
-        characteristics = new ArrayList<CharacteristicTypeBuilder<?>>(tc.size());
+        characteristics = new ArrayList<>(tc.size());
         for (final DefaultAttributeType<?> c : tc.values()) {
-            characteristics.add(new CharacteristicTypeBuilder(this, c));
+            characteristics.add(new CharacteristicTypeBuilder<>(this, c));
         }
     }
 
@@ -269,7 +269,7 @@ public final class AttributeTypeBuilder<
         if (type == valueClass) {
             return (AttributeTypeBuilder<N>) this;
         }
-        final AttributeTypeBuilder<N> newb = new AttributeTypeBuilder<N>(this, type);
+        final AttributeTypeBuilder<N> newb = new AttributeTypeBuilder<>(this, type);
         for (final CharacteristicTypeBuilder<?> c : characteristics) {
             c.owner(newb);
         }
@@ -335,6 +335,7 @@ public final class AttributeTypeBuilder<
      * @see #characteristics()
      * @see AttributeConvention#VALID_VALUES_CHARACTERISTIC
      */
+    @SafeVarargs
     public final AttributeTypeBuilder<V> setValidValues(final V... values) {
         return setCharacteristic(AttributeConvention.VALID_VALUES_CHARACTERISTIC,
                 Set.class, CollectionsExt.immutableSet(false, values));
@@ -459,7 +460,7 @@ public final class AttributeTypeBuilder<
      */
     public <C> CharacteristicTypeBuilder<C> addCharacteristic(final Class<C> type) {
         ensureNonNull("type", type);
-        final CharacteristicTypeBuilder<C> characteristic = new CharacteristicTypeBuilder<C>(this, type);
+        final CharacteristicTypeBuilder<C> characteristic = new CharacteristicTypeBuilder<>(this, type);
         characteristics.add(characteristic);
         clearCache();
         return characteristic;
@@ -481,7 +482,7 @@ public final class AttributeTypeBuilder<
      */
     public <C> CharacteristicTypeBuilder<C> addCharacteristic(final DefaultAttributeType<C> template) {
         ensureNonNull("template", template);
-        final CharacteristicTypeBuilder<C> characteristic = new CharacteristicTypeBuilder<C>(this, template);
+        final CharacteristicTypeBuilder<C> characteristic = new CharacteristicTypeBuilder<>(this, template);
         characteristics.add(characteristic);
         clearCache();
         return characteristic;
@@ -502,7 +503,7 @@ public final class AttributeTypeBuilder<
      * @see #setCRS(CoordinateReferenceSystem)
      */
     public List<CharacteristicTypeBuilder<?>> characteristics() {
-        return new RemoveOnlyList<CharacteristicTypeBuilder<?>>(characteristics);
+        return new RemoveOnlyList<>(characteristics);
     }
 
     /**
@@ -703,7 +704,7 @@ public final class AttributeTypeBuilder<
             for (int i=0; i<chrts.length; i++) {
                 chrts[i] = characteristics.get(i).build();
             }
-            property = new DefaultAttributeType<V>(identification(), valueClass, minimumOccurs, maximumOccurs, defaultValue, chrts);
+            property = new DefaultAttributeType<>(identification(), valueClass, minimumOccurs, maximumOccurs, defaultValue, chrts);
         }
         return property;
     }

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -23,7 +23,7 @@ import org.apache.sis.util.ObjectConvert
 import org.apache.sis.util.UnconvertibleObjectException;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -212,7 +212,7 @@ public final class CharacteristicTypeBui
         if (type == valueClass) {
             return (CharacteristicTypeBuilder<N>) this;
         }
-        final CharacteristicTypeBuilder<N> newb = new CharacteristicTypeBuilder<N>(this, type);
+        final CharacteristicTypeBuilder<N> newb = new CharacteristicTypeBuilder<>(this, type);
         owner.characteristics.set(owner.characteristics.lastIndexOf(this), newb);
         // Note: a negative lastIndexOf(old) would be a bug in our algorithm.
         owner = null;
@@ -293,7 +293,7 @@ public final class CharacteristicTypeBui
     @Override
     public DefaultAttributeType<V> build() {
         if (characteristic == null) {
-            characteristic = new DefaultAttributeType<V>(identification(), valueClass, 0, 1, defaultValue);
+            characteristic = new DefaultAttributeType<>(identification(), valueClass, 0, 1, defaultValue);
         }
         return characteristic;
     }

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -37,9 +37,8 @@ import org.apache.sis.util.resources.Err
 import org.apache.sis.util.ArraysExt;
 
 // Branch-dependent imports
+import java.util.Objects;
 import org.apache.sis.internal.jdk8.JDK8;
-import org.apache.sis.internal.jdk7.JDK7;
-import org.apache.sis.internal.jdk7.Objects;
 import org.apache.sis.feature.AbstractFeature;
 import org.apache.sis.feature.AbstractIdentifiedType;
 import org.apache.sis.feature.DefaultAssociationRole;
@@ -180,8 +179,8 @@ public class FeatureTypeBuilder extends
             factory = DefaultFactories.forBuildin(NameFactory.class);
         }
         nameFactory = factory;
-        properties  = new ArrayList<PropertyTypeBuilder>();
-        superTypes  = new ArrayList<DefaultFeatureType>();
+        properties  = new ArrayList<>();
+        superTypes  = new ArrayList<>();
         idDelimiter = ":";
         defaultMinimumOccurs = 1;
         defaultMaximumOccurs = 1;
@@ -194,11 +193,11 @@ public class FeatureTypeBuilder extends
              * For each operation, wrap them in pseudo-builder only if the operation
              * is not one of the operations automatically generated by this builder.
              */
-            final Map<String,Set<AttributeRole>> propertyRoles = new HashMap<String,Set<AttributeRole>>();
+            final Map<String,Set<AttributeRole>> propertyRoles = new HashMap<>();
             for (final AbstractIdentifiedType property : template.getProperties(false)) {
                 PropertyTypeBuilder builder;
                 if (property instanceof DefaultAttributeType<?>) {
-                    builder = new AttributeTypeBuilder(this, (DefaultAttributeType<?>) property);
+                    builder = new AttributeTypeBuilder<>(this, (DefaultAttributeType<?>) property);
                 } else if (property instanceof DefaultAssociationRole) {
                     builder = new AssociationRoleBuilder(this, (DefaultAssociationRole) property);
                 } else {
@@ -496,7 +495,7 @@ public class FeatureTypeBuilder extends
      * @see #addAssociation(FeatureAssociationRole)
      */
     public List<PropertyTypeBuilder> properties() {
-        return new RemoveOnlyList<PropertyTypeBuilder>(properties);
+        return new RemoveOnlyList<>(properties);
     }
 
     /**
@@ -539,7 +538,7 @@ public class FeatureTypeBuilder extends
             // We disallow Feature.class because that type shall be handled as association instead than attribute.
             throw new IllegalArgumentException(errors().getString(Errors.Keys.IllegalArgumentValue_2, "valueClass", valueClass));
         }
-        final AttributeTypeBuilder<V> property = new AttributeTypeBuilder<V>(this, valueClass);
+        final AttributeTypeBuilder<V> property = new AttributeTypeBuilder<>(this, valueClass);
         properties.add(property);
         clearCache();
         return property;
@@ -560,7 +559,7 @@ public class FeatureTypeBuilder extends
      */
     public <V> AttributeTypeBuilder<V> addAttribute(final DefaultAttributeType<V> template) {
         ensureNonNull("template", template);
-        final AttributeTypeBuilder<V> property = new AttributeTypeBuilder<V>(this, template);
+        final AttributeTypeBuilder<V> property = new AttributeTypeBuilder<>(this, template);
         properties.add(property);
         clearCache();
         return property;
@@ -838,7 +837,7 @@ public class FeatureTypeBuilder extends
             separator = ", ";
         }
         buffer.append(" {");
-        separator = JDK7.lineSeparator();
+        separator = System.lineSeparator();
         for (final PropertyTypeBuilder p : properties) {
             p.toString(buffer.append(separator).append("    ").append(p.getClass().getSimpleName()));
         }

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -31,7 +31,7 @@ import org.apache.sis.util.Classes;
 import org.apache.sis.util.Debug;
 
 // Branch-dependent imports
-import org.apache.sis.internal.jdk7.Objects;
+import java.util.Objects;
 
 
 /**
@@ -71,14 +71,14 @@ public abstract class TypeBuilder implem
      * @param builder  the builder from which to copy information.
      */
     TypeBuilder(final TypeBuilder builder) {
-        identification = new HashMap<String,Object>(builder.identification);
+        identification = new HashMap<>(builder.identification);
     }
 
     /**
      * Creates a new builder initialized to the values of an existing type.
      */
     TypeBuilder(final AbstractIdentifiedType template, final Locale locale) {
-        identification = new HashMap<String,Object>(4);
+        identification = new HashMap<>(4);
         putIfNonNull(Errors.LOCALE_KEY, locale);
         if (template != null) {
             putIfNonNull(AbstractIdentifiedType.NAME_KEY,        template.getName());

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -65,7 +65,7 @@ public final class Geometries extends St
             ymin = envt.getMethod("getMinY", (Class[]) null);
             xmax = envt.getMethod("getMaxX", (Class[]) null);
             ymax = envt.getMethod("getMaxY", (Class[]) null);
-        } catch (Exception e) {     // (ClassNotFoundException | NoSuchMethodException) on the JDK7 branch.
+        } catch (ClassNotFoundException | NoSuchMethodException e) {
             Logging.getLogger(Loggers.GEOMETRY).log(Level.CONFIG, e.toString());
             type = null;
             genv = null;
@@ -125,7 +125,7 @@ public final class Geometries extends St
                 ymin = (Double) MIN_Y.invoke(env, (Object[]) null);
                 xmax = (Double) MAX_X.invoke(env, (Object[]) null);
                 ymax = (Double) MAX_Y.invoke(env, (Object[]) null);
-            } catch (Exception e) {                                     // (ReflectiveOperationException) on JDK7 branch.
+            } catch (ReflectiveOperationException e) {
                 if (e instanceof InvocationTargetException) {
                     final Throwable cause = e.getCause();
                     if (cause instanceof RuntimeException) {

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/AbstractFeatureTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/AbstractFeatureTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/AbstractFeatureTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/AbstractFeatureTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -54,7 +54,7 @@ public final strictfp class AbstractFeat
          * If a feature backed by a {@code java.util.Map} is really wanted, then {@link SparseFeature} should
          * be considered.
          */
-        private HashMap<String,Object> values = new HashMap<String,Object>();
+        private HashMap<String,Object> values = new HashMap<>();
 
         /**
          * Creates a new feature of the given type. This constructor adds immediately the default values into
@@ -66,7 +66,7 @@ public final strictfp class AbstractFeat
                 if (pt instanceof DefaultAttributeType<?>) {
                     Object value = ((DefaultAttributeType<?>) pt).getDefaultValue();
                     if (isMultiValued(pt)) {
-                        value = new ArrayList<Object>(PropertyView.singletonOrEmpty(value));
+                        value = new ArrayList<>(PropertyView.singletonOrEmpty(value));
                     }
                     if (value != null) {
                         values.put(pt.getName().toString(), value);
@@ -105,7 +105,7 @@ public final strictfp class AbstractFeat
             final AbstractIdentifiedType type = getType().getProperty(name);
             final boolean isMultiValued = isMultiValued(type);
             if (isMultiValued && !(value instanceof Collection<?>)) {
-                value = new ArrayList<Object>(PropertyView.singletonOrEmpty(value));
+                value = new ArrayList<>(PropertyView.singletonOrEmpty(value));
             }
             if (value != null) {
                 final Class<?> base;

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicMapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicMapTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicMapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicMapTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -43,7 +43,7 @@ public final strictfp class Characterist
      * @return A {@code "temperature"} attribute with two characteristics: {@code "accuracy"} and {@code "units"}.
      */
     public static AbstractAttribute<Float> temperature() {
-        return new SingletonAttribute<Float>(CharacteristicTypeMapTest.temperature(), 20f);
+        return new SingletonAttribute<>(CharacteristicTypeMapTest.temperature(), 20f);
     }
 
     /**
@@ -53,9 +53,8 @@ public final strictfp class Characterist
      * @param  name Either {@code "accuracy"} or {@code "units"}.
      * @return An attribute for the given name.
      */
-    @SuppressWarnings({"unchecked","rawtypes"})    // Not needed on JDK7 branch.
     private static AbstractAttribute<?> create(final AbstractAttribute<?> temperature, final String name) {
-        return new SingletonAttribute(((DefaultAttributeType<?>) temperature.getType()).characteristics().get(name));
+        return new SingletonAttribute<>(((DefaultAttributeType<?>) temperature.getType()).characteristics().get(name));
     }
 
     /**
@@ -276,8 +275,8 @@ public final strictfp class Characterist
         assertArrayEquals("keySet", new String[] {"accuracy", "units"}, characteristics.keySet().toArray());
         assertArrayEquals("values", new Object[] { accuracy ,  units }, characteristics.values().toArray());
         assertArrayEquals("entrySet", new Object[] {
-                new SimpleEntry<String,AbstractAttribute<?>>("accuracy", accuracy),
-                new SimpleEntry<String,AbstractAttribute<?>>("units",    units)
+                new SimpleEntry<>("accuracy", accuracy),
+                new SimpleEntry<>("units",    units)
             }, characteristics.entrySet().toArray());
     }
 

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicTypeMapTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicTypeMapTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicTypeMapTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/CharacteristicTypeMapTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -44,9 +44,9 @@ public final strictfp class Characterist
      */
     public static DefaultAttributeType<Float> temperature() {
         final DefaultAttributeType<?> units, accuracy;
-        units    = new DefaultAttributeType<String>(singletonMap(NAME_KEY, "units"),      String.class, 1, 1, "°C", (DefaultAttributeType[]) null);
-        accuracy = new DefaultAttributeType<Float> (singletonMap(NAME_KEY, "accuracy"),    Float.class, 1, 1, 0.1f, (DefaultAttributeType[]) null);
-        return     new DefaultAttributeType<Float> (singletonMap(NAME_KEY, "temperature"), Float.class, 1, 1, null, accuracy, units);
+        units    = new DefaultAttributeType<>(singletonMap(NAME_KEY, "units"),      String.class, 1, 1, "°C", (DefaultAttributeType[]) null);
+        accuracy = new DefaultAttributeType<>(singletonMap(NAME_KEY, "accuracy"),    Float.class, 1, 1, 0.1f, (DefaultAttributeType[]) null);
+        return     new DefaultAttributeType<>(singletonMap(NAME_KEY, "temperature"), Float.class, 1, 1, null, accuracy, units);
     }
 
     /**
@@ -91,8 +91,8 @@ public final strictfp class Characterist
         assertArrayEquals("keySet", new String[] {"accuracy", "units"}, characteristics.keySet().toArray());
         assertArrayEquals("values", new Object[] { accuracy ,  units }, characteristics.values().toArray());
         assertArrayEquals("entrySet", new Object[] {
-                new SimpleEntry<String,DefaultAttributeType<?>>("accuracy", accuracy),
-                new SimpleEntry<String,DefaultAttributeType<?>>("units",    units)
+                new SimpleEntry<>("accuracy", accuracy),
+                new SimpleEntry<>("units",    units)
             }, characteristics.entrySet().toArray());
     }
 

Modified: sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java?rev=1762629&r1=1762628&r2=1762629&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java [UTF-8] Wed Sep 28 09:59:44 2016
@@ -64,7 +64,7 @@ public final strictfp class DefaultAttri
         assertNull(identification.put(DefaultAttributeType.DEFINITION_KEY  + "_fr", "Le nom de la ville."));
         assertNull(identification.put(DefaultAttributeType.DEFINITION_KEY  + "_ja", "都市の名前。"));
         assertNull(identification.put(DefaultAttributeType.DESCRIPTION_KEY, "Some verbose description."));
-        final DefaultAttributeType<String> city = new DefaultAttributeType<String>(identification,
+        final DefaultAttributeType<String> city = new DefaultAttributeType<>(identification,
                 String.class, 1, 1, "Utopia");
         identification.clear();
         return city;
@@ -79,7 +79,7 @@ public final strictfp class DefaultAttri
         assertNull(identification.put(DefaultAttributeType.NAME_KEY, "population"));
         // We may add more properties here in a future version.
 
-        final DefaultAttributeType<Integer> population = new DefaultAttributeType<Integer>(
+        final DefaultAttributeType<Integer> population = new DefaultAttributeType<>(
                 identification, Integer.class, 1, 1, null);
         identification.clear();
         return population;
@@ -103,7 +103,7 @@ public final strictfp class DefaultAttri
      * @return An attribute type for university names.
      */
     public static DefaultAttributeType<String> universities() {
-        return new DefaultAttributeType<String>(
+        return new DefaultAttributeType<>(
                 singletonMap(DefaultAttributeType.NAME_KEY, "universities"),
                 String.class, 0, Integer.MAX_VALUE, null);
     }
@@ -113,8 +113,7 @@ public final strictfp class DefaultAttri
      * This is the kind of attribute created by the ShapeFile reader.
      */
     static DefaultAttributeType<String> attribute(final String name) {
-        return new DefaultAttributeType<String>(singletonMap(DefaultAttributeType.NAME_KEY, name),
-                String.class, 1, 1, null);
+        return new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, name), String.class, 1, 1, null);
     }
 
     /**
@@ -153,7 +152,7 @@ public final strictfp class DefaultAttri
     @Test
     @SuppressWarnings("ObjectEqualsNull")
     public void testEquals() {
-        final Map<String,Object> identification = new HashMap<String,Object>(4);
+        final Map<String,Object> identification = new HashMap<>(4);
         final DefaultAttributeType<Integer> a1 = population(identification);
         final DefaultAttributeType<Integer> a2 = population(identification);
         assertFalse ("equals",   a1.equals(null));



Mime
View raw message