[maven-shared-utils] branch MSHARED-826 created (now 392c19c)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-shared-utils] branch MSHARED-826 created (now 392c19c)

rfscholte
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git.


      at 392c19c  [MSHARED-826] Apply Java 7 syntax

This branch includes the following new commits:

     new 392c19c  [MSHARED-826] Apply Java 7 syntax

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Reply | Threaded
Open this post in threaded view
|

[maven-shared-utils] 01/01: [MSHARED-826] Apply Java 7 syntax

rfscholte
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git

commit 392c19c947db0085e47650d1443e0491b378cbb3
Author: rfscholte <[hidden email]>
AuthorDate: Wed Jun 12 20:26:18 2019 +0200

    [MSHARED-826] Apply Java 7 syntax
---
 .../java/org/apache/maven/shared/utils/Expand.java |  26 +--
 .../org/apache/maven/shared/utils/PathTool.java    |   4 +
 .../apache/maven/shared/utils/PropertyUtils.java   |  92 +++-----
 .../org/apache/maven/shared/utils/StringUtils.java |   7 +-
 .../apache/maven/shared/utils/WriterFactory.java   |   1 -
 .../shared/utils/cli/CommandLineCallable.java      |   4 +-
 .../shared/utils/cli/CommandLineException.java     |   1 -
 .../utils/cli/CommandLineTimeOutException.java     |   1 -
 .../maven/shared/utils/cli/CommandLineUtils.java   |  12 +-
 .../apache/maven/shared/utils/cli/Commandline.java |  35 +---
 .../maven/shared/utils/cli/DefaultConsumer.java    |   5 -
 .../maven/shared/utils/cli/StreamFeeder.java       |   1 -
 .../maven/shared/utils/cli/StreamPumper.java       |   1 +
 .../shared/utils/cli/WriterStreamConsumer.java     |   4 -
 .../utils/cli/javatool/AbstractJavaTool.java       |  50 +----
 .../cli/javatool/AbstractJavaToolRequest.java      |  16 +-
 .../utils/cli/javatool/JavaToolException.java      |   1 -
 .../maven/shared/utils/cli/shell/BourneShell.java  |  12 +-
 .../maven/shared/utils/cli/shell/CmdShell.java     |   1 +
 .../apache/maven/shared/utils/cli/shell/Shell.java |   4 +-
 .../maven/shared/utils/introspection/ClassMap.java |   3 +-
 .../shared/utils/introspection/MethodMap.java      |   9 +-
 .../introspection/ReflectionValueExtractor.java    |   1 -
 .../shared/utils/io/DirectoryWalkListener.java     |   2 -
 .../maven/shared/utils/io/DirectoryWalker.java     |   8 +-
 .../apache/maven/shared/utils/io/FileUtils.java    | 233 ++++++---------------
 .../org/apache/maven/shared/utils/io/IOUtil.java   |  15 ++
 .../apache/maven/shared/utils/io/Java7Support.java | 171 +++------------
 .../maven/shared/utils/io/WalkCollector.java       |  10 +-
 .../shared/utils/logging/AnsiMessageBuilder.java   |  17 ++
 .../shared/utils/logging/PlainMessageBuilder.java  |  17 ++
 .../maven/shared/utils/reflection/Reflector.java   |  52 +----
 .../shared/utils/xml/PrettyPrintXMLWriter.java     |  14 +-
 .../maven/shared/utils/xml/XmlStreamReader.java    |   4 +-
 .../maven/shared/utils/xml/XmlWriterUtil.java      |   3 +-
 .../org/apache/maven/shared/utils/xml/Xpp3Dom.java |   8 +-
 .../maven/shared/utils/xml/Xpp3DomBuilder.java     |  21 +-
 .../maven/shared/utils/xml/Xpp3DomUtils.java       |   2 +-
 .../shared/utils/cli/CommandLineUtilsTest.java     |   1 -
 .../ReflectionValueExtractorTest.java              |   2 +-
 .../shared/utils/testhelpers/ExceptionHelper.java  |   2 +
 .../shared/utils/xml/PrettyPrintXmlWriterTest.java |   1 -
 .../maven/shared/utils/xml/XmlWriterUtilTest.java  |   3 +-
 43 files changed, 263 insertions(+), 614 deletions(-)

diff --git a/src/main/java/org/apache/maven/shared/utils/Expand.java b/src/main/java/org/apache/maven/shared/utils/Expand.java
index 28c01ed..8eb2bc3 100644
--- a/src/main/java/org/apache/maven/shared/utils/Expand.java
+++ b/src/main/java/org/apache/maven/shared/utils/Expand.java
@@ -30,7 +30,6 @@ import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
 import org.apache.maven.shared.utils.io.FileUtils;
-import org.apache.maven.shared.utils.io.IOUtil;
 
 /**
  * Expand will unpack the given zip archive.
@@ -126,11 +125,8 @@ class Expand
             destDir = new File( System.getProperty( "user.dir" ) );
         }
 
-        ZipInputStream in = null;
-        try
+        try ( ZipInputStream in = new ZipInputStream( new FileInputStream( srcFile ) ) )
         {
-            in = new ZipInputStream( new FileInputStream( srcFile ) );
-
             for ( ZipEntry zipEntry = in.getNextEntry(); zipEntry != null; zipEntry = in.getNextEntry() )
             {
                 String zipEntryName = zipEntry.getName();
@@ -138,13 +134,6 @@ class Expand
 
                 extractFile( source, destDir, in, zipEntryName, zipEntryDate, zipEntry.isDirectory() );
             }
-
-            in.close();
-            in = null;
-        }
-        finally
-        {
-            IOUtil.close( in );
         }
     }
 
@@ -188,23 +177,14 @@ class Expand
             else
             {
                 byte[] buffer = new byte[BUFFER_SIZE];
-                OutputStream out = null;
-                try
+                
+                try ( OutputStream out = new FileOutputStream( targetFile ) )
                 {
-                    out = new FileOutputStream( targetFile );
-
                     int len;
                     while ( ( len = compressedInputStream.read( buffer ) ) >= 0 )
                     {
                         out.write( buffer, 0, len );
                     }
-
-                    out.close();
-                    out = null;
-                }
-                finally
-                {
-                    IOUtil.close( out );
                 }
                 targetFile.setLastModified( entryDate.getTime() );
             }
diff --git a/src/main/java/org/apache/maven/shared/utils/PathTool.java b/src/main/java/org/apache/maven/shared/utils/PathTool.java
index b616211..a273f14 100644
--- a/src/main/java/org/apache/maven/shared/utils/PathTool.java
+++ b/src/main/java/org/apache/maven/shared/utils/PathTool.java
@@ -20,6 +20,7 @@ package org.apache.maven.shared.utils;
  */
 
 import java.io.File;
+import java.nio.file.Path;
 import java.util.StringTokenizer;
 
 import javax.annotation.Nonnull;
@@ -32,7 +33,10 @@ import javax.annotation.Nullable;
  * This class originally got developed at Apache Anakia and later maintained
  * in maven-utils of Apache Maven-1.
  * Some external fixes by Apache Committers have been applied later.
+ *
+ * @deprecated Use {@link Path} instead
  */
+@Deprecated
 public class PathTool
 {
     /**
diff --git a/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java b/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java
index 4c211d5..6eed0ac 100644
--- a/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java
@@ -29,8 +29,6 @@ import java.util.Properties;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
-import org.apache.maven.shared.utils.io.IOUtil;
-
 /**
  *
  */
@@ -108,7 +106,7 @@ public class PropertyUtils
             Properties result = new Properties();
             if ( is != null )
             {
-                try
+                try ( InputStream in = is )
                 {
                     result.load( is );
                 }
@@ -123,10 +121,6 @@ public class PropertyUtils
         {
             // ignore
         }
-        finally
-        {
-            IOUtil.close( is );
-        }
         return null;
     }
 
@@ -145,29 +139,21 @@ public class PropertyUtils
      */
     @Nonnull public static Properties loadOptionalProperties( final @Nullable URL url )
     {
-        InputStream in = null;
-        try
-        {
-            final Properties properties = new Properties();
+        final Properties properties = new Properties();
 
-            if ( url != null )
+        if ( url != null )
+        {
+            try ( InputStream in = url.openStream() )
             {
-                in = url.openStream();
                 properties.load( in );
-                in.close();
-                in = null;
             }
-
-            return properties;
-        }
-        catch ( final IOException e )
-        {
-            throw new AssertionError( e );
-        }
-        finally
-        {
-            IOUtil.close( in );
+            catch ( final IOException e )
+            {
+                throw new AssertionError( e );
+            }
         }
+
+        return properties;
     }
 
     /**
@@ -185,29 +171,21 @@ public class PropertyUtils
      */
     @Nonnull public static Properties loadOptionalProperties( final @Nullable File file )
     {
-        InputStream in = null;
-        try
-        {
-            final Properties properties = new Properties();
+        final Properties properties = new Properties();
 
-            if ( file != null )
+        if ( file != null )
+        {
+            try ( InputStream in = new FileInputStream( file ) )
             {
-                in = new FileInputStream( file );
                 properties.load( in );
-                in.close();
-                in = null;
             }
-
-            return properties;
-        }
-        catch ( final IOException e )
-        {
-            throw new AssertionError( e );
-        }
-        finally
-        {
-            IOUtil.close( in );
+            catch ( final IOException e )
+            {
+                throw new AssertionError( e );
+            }
         }
+
+        return properties;
     }
 
     /**
@@ -225,29 +203,21 @@ public class PropertyUtils
      */
     @Nonnull public static Properties loadOptionalProperties( final @Nullable InputStream inputStream )
     {
-        InputStream in = null;
-        try
-        {
-            final Properties properties = new Properties();
+        final Properties properties = new Properties();
 
-            if ( inputStream != null )
+        if ( inputStream != null )
+        {
+            try ( InputStream in = inputStream )
             {
-                in = inputStream;
                 properties.load( in );
-                in.close();
-                in = null;
             }
-
-            return properties;
-        }
-        catch ( final IOException e )
-        {
-            throw new AssertionError( e );
-        }
-        finally
-        {
-            IOUtil.close( in );
+            catch ( final IOException e )
+            {
+                throw new AssertionError( e );
+            }
         }
+
+        return properties;
     }
 
 }
diff --git a/src/main/java/org/apache/maven/shared/utils/StringUtils.java b/src/main/java/org/apache/maven/shared/utils/StringUtils.java
index 6b9a55a..b6b92c4 100644
--- a/src/main/java/org/apache/maven/shared/utils/StringUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/StringUtils.java
@@ -24,6 +24,7 @@ import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.StringTokenizer;
 
 import javax.annotation.Nonnull;
@@ -49,8 +50,6 @@ import javax.annotation.Nullable;
  * @author <a href="mailto:[hidden email]">Fredrik Westermarck</a>
  * @author Holger Krauth
  * @author <a href="mailto:[hidden email]">Alexander Day Chaffee</a>
- * @version $Id$
- *
  */
 public class StringUtils
 {
@@ -1890,7 +1889,7 @@ public class StringUtils
      */
     @Nonnull public static String defaultString( Object obj )
     {
-        return defaultString( obj, "" );
+        return Objects.toString( obj, "" );
     }
 
     /**
@@ -1906,7 +1905,7 @@ public class StringUtils
      */
     @Nonnull public static String defaultString( Object obj, @Nonnull String defaultString )
     {
-        return ( obj == null ) ? defaultString : obj.toString();
+        return Objects.toString( obj, defaultString );
     }
 
     // Reversing
diff --git a/src/main/java/org/apache/maven/shared/utils/WriterFactory.java b/src/main/java/org/apache/maven/shared/utils/WriterFactory.java
index 7e33c8f..fb2f213 100644
--- a/src/main/java/org/apache/maven/shared/utils/WriterFactory.java
+++ b/src/main/java/org/apache/maven/shared/utils/WriterFactory.java
@@ -40,7 +40,6 @@ import javax.annotation.Nonnull;
  * @author HervĂ© Boutemy
  * @see java.nio.charset.Charset
  * @see <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html">Supported encodings</a>
- * @version $Id$
  */
 public class WriterFactory
 {
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineCallable.java b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineCallable.java
index b4e4586..1a54b27 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineCallable.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineCallable.java
@@ -29,9 +29,7 @@ import java.util.concurrent.Callable;
 public interface CommandLineCallable
     extends Callable<Integer>
 {
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     Integer call()
         throws CommandLineException;
 }
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineException.java b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineException.java
index 77a50ee..9954e35 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineException.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineException.java
@@ -21,7 +21,6 @@ package org.apache.maven.shared.utils.cli;
 
 /**
  * @author <a href="mailto:[hidden email]">Trygve Laugst&oslash;l</a>
- * @version $Id$
  */
 public class CommandLineException
     extends Exception
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineTimeOutException.java b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineTimeOutException.java
index 5d83494..c1f8209 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineTimeOutException.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineTimeOutException.java
@@ -21,7 +21,6 @@ package org.apache.maven.shared.utils.cli;
 
 /**
  * @author Olivier Lamy
- * @version $Id$
  *
  */
 public class CommandLineTimeOutException
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java
index 3a745ab..476eee5 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/CommandLineUtils.java
@@ -36,7 +36,6 @@ import org.apache.maven.shared.utils.StringUtils;
 
 /**
  * @author <a href="mailto:[hidden email]">Trygve Laugst&oslash;l </a>
- * @version $Id$
  */
 public abstract class CommandLineUtils
 {
@@ -50,17 +49,12 @@ public abstract class CommandLineUtils
         implements StreamConsumer
     {
 
-        private final StringBuffer string = new StringBuffer();
-
-        private static final String LS = System.getProperty( "line.separator", "\n" );
-
-        /**
-         * {@inheritDoc}
-         */
+        private final StringBuilder string = new StringBuilder();
+      
         @Override
         public void consumeLine( String line )
         {
-            string.append( line ).append( LS );
+            string.append( line ).append( System.lineSeparator() );
         }
 
         /**
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java b/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
index db13770..75606e7 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
@@ -28,7 +28,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Vector;
 
 import org.apache.maven.shared.utils.Os;
 import org.apache.maven.shared.utils.StringUtils;
@@ -68,7 +67,7 @@ import org.apache.maven.shared.utils.cli.shell.Shell;
 public class Commandline
     implements Cloneable
 {
-    private final List<Arg> arguments = new Vector<Arg>();
+    private final List<Argument> arguments = new ArrayList<>();
 
     //protected Vector envVars = new Vector();
     // synchronized added to preserve synchronize of Vector class
@@ -96,7 +95,7 @@ public class Commandline
     {
         setDefaultShell();
         String[] tmp = CommandLineUtils.translateCommandline( toProcess );
-        if ( ( tmp.length > 0 ) )
+        if ( tmp.length > 0 )
         {
             setExecutable( tmp[0] );
             for ( int i = 1; i < tmp.length; i++ )
@@ -165,7 +164,7 @@ public class Commandline
      */
     public Arg createArg( boolean insertAtStart )
     {
-        Arg argument = new Argument();
+        Argument argument = new Argument();
         if ( insertAtStart )
         {
             arguments.add( 0, argument );
@@ -309,10 +308,9 @@ public class Commandline
      */
     public String[] getArguments( boolean mask )
     {
-        List<String> result = new ArrayList<String>( arguments.size() * 2 );
-        for ( Arg argument : arguments )
+        List<String> result = new ArrayList<>( arguments.size() * 2 );
+        for ( Argument arg : arguments )
         {
-            Argument arg = (Argument) argument;
             String[] s = arg.getParts();
             if ( s != null )
             {
@@ -335,16 +333,13 @@ public class Commandline
         return result.toArray( new String[result.size()] );
     }
 
-    /** {@inheritDoc}
-     */
+    @Override
     public String toString()
     {
         return StringUtils.join( getShellCommandline( true ), " " );
     }
 
-
-    /** {@inheritDoc}
-     */
+    @Override
     public Object clone()
     {
         throw new RuntimeException( "Do we ever clone a commandline?" );
@@ -462,9 +457,7 @@ public class Commandline
 
         private boolean mask;
 
-        /**
-         * {@inheritDoc}
-         */
+        @Override
         public void setValue( String value )
         {
             if ( value != null )
@@ -473,9 +466,7 @@ public class Commandline
             }
         }
 
-        /**
-         * {@inheritDoc}
-         */
+        @Override
         public void setLine( String line ) throws CommandLineException
         {
             if ( line == null )
@@ -493,17 +484,13 @@ public class Commandline
             }
         }
 
-        /**
-         * {@inheritDoc}
-         */
+        @Override
         public void setFile( File value )
         {
             parts = new String[]{ value.getAbsolutePath() };
         }
 
-        /**
-         * {@inheritDoc}
-         */
+        @Override
         public void setMask( boolean mask )
         {
             this.mask = mask;
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/DefaultConsumer.java b/src/main/java/org/apache/maven/shared/utils/cli/DefaultConsumer.java
index 5104877..ad33a55 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/DefaultConsumer.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/DefaultConsumer.java
@@ -23,15 +23,10 @@ import java.io.IOException;
 
 /**
  * @author <a href="mailto:[hidden email]">Emmanuel Venisse</a>
- * @version $Id$
  */
 public class DefaultConsumer
     implements StreamConsumer
 {
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void consumeLine( String line ) throws IOException
     {
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/StreamFeeder.java b/src/main/java/org/apache/maven/shared/utils/cli/StreamFeeder.java
index 26e9de3..6f6723c 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/StreamFeeder.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/StreamFeeder.java
@@ -28,7 +28,6 @@ import java.util.concurrent.atomic.AtomicReference;
  * Read from an InputStream and write the output to an OutputStream.
  *
  * @author <a href="mailto:[hidden email]">Trygve Laugst&oslash;l</a>
- * @version $Id$
  */
 class StreamFeeder
     extends AbstractStreamHandler
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/StreamPumper.java b/src/main/java/org/apache/maven/shared/utils/cli/StreamPumper.java
index 980bfb6..052b980 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/StreamPumper.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/StreamPumper.java
@@ -75,6 +75,7 @@ public class StreamPumper
     }
 
     /** run it. */
+    @Override
     public void run()
     {
         try
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/WriterStreamConsumer.java b/src/main/java/org/apache/maven/shared/utils/cli/WriterStreamConsumer.java
index f8ce0d8..ec90ff3 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/WriterStreamConsumer.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/WriterStreamConsumer.java
@@ -25,7 +25,6 @@ import java.io.Writer;
 
 /**
  * @author <a href="mailto:[hidden email]">Jason van Zyl</a>
- * @version $Id$
  */
 public class WriterStreamConsumer
     implements StreamConsumer
@@ -42,9 +41,6 @@ public class WriterStreamConsumer
         this.writer = new BufferedWriter( writer );
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void consumeLine( String line ) throws IOException
     {
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java
index 2282680..dbbc6c7 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java
@@ -29,7 +29,6 @@ import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.io.File;
 import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Map;
 
@@ -79,25 +78,19 @@ public abstract class AbstractJavaTool<Request extends JavaToolRequest>
     protected abstract Commandline createCommandLine( Request request, String javaToolFileLocation )
         throws JavaToolException;
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getJavaToolName()
     {
         return javaToolName;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public void setToolchain( Object toolchain )
     {
         this.toolchain = toolchain;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public JavaToolResult execute( Request request )
         throws JavaToolException
     {
@@ -134,10 +127,7 @@ public abstract class AbstractJavaTool<Request extends JavaToolRequest>
     {
         InputStream systemIn = new InputStream()
         {
-
-            /**
-             * {@inheritDoc}
-             */
+            @Override
             public int read()
             {
                 return -1;
@@ -195,10 +185,6 @@ public abstract class AbstractJavaTool<Request extends JavaToolRequest>
         {
             systemErr = new StreamConsumer()
             {
-
-                /**
-                 * {@inheritDoc}
-                 */
                 @Override
                 public void consumeLine( final String line )
                 {
@@ -223,10 +209,6 @@ public abstract class AbstractJavaTool<Request extends JavaToolRequest>
 
             systemOut = new StreamConsumer()
             {
-
-                /**
-                 * {@inheritDoc}
-                 */
                 @Override
                 public void consumeLine( final String line )
                 {
@@ -302,30 +284,10 @@ public abstract class AbstractJavaTool<Request extends JavaToolRequest>
             Method m = toolchain.getClass().getMethod( "findTool", String.class );
             return (String) m.invoke( toolchain, javaToolName );
         }
-        catch ( NoSuchMethodException e )
+        catch ( ReflectiveOperationException | SecurityException | IllegalArgumentException e )
         {
             // should not happen if toolchain is really a Toolchain object
-            getLogger().warn( "unexpected NoSuchMethodException", e );
-        }
-        catch ( SecurityException e )
-        {
-            // should not happen
-            getLogger().warn( "unexpected SecurityException", e );
-        }
-        catch ( IllegalAccessException e )
-        {
-            // should not happen
-            getLogger().warn( "unexpected IllegalAccessException", e );
-        }
-        catch ( IllegalArgumentException e )
-        {
-            // should not happen: parameter is the right type
-            getLogger().warn( "unexpected IllegalArgumentException", e );
-        }
-        catch ( InvocationTargetException e )
-        {
-            // not expected...
-            getLogger().warn( "unexpected InvocationTargetException", e );
+            getLogger().warn( "unexpected exception", e );
         }
         return null;
     }
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java
index 6e18178..7efaccc 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java
@@ -41,33 +41,25 @@ public class AbstractJavaToolRequest
      */
     private StreamConsumer systemErrorStreamConsumer;
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public StreamConsumer getSystemOutStreamConsumer()
     {
         return systemOutStreamConsumer;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public StreamConsumer getSystemErrorStreamConsumer()
     {
         return systemErrorStreamConsumer;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public void setSystemOutStreamConsumer( StreamConsumer systemOutStreamConsumer )
     {
         this.systemOutStreamConsumer = systemOutStreamConsumer;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public void setSystemErrorStreamConsumer( StreamConsumer systemErrorStreamConsumer )
     {
         this.systemErrorStreamConsumer = systemErrorStreamConsumer;
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java
index 6b6946c..5ff0af9 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java
@@ -27,7 +27,6 @@ package org.apache.maven.shared.utils.cli.javatool;
  * non-zero exit code.
  *
  * @author Tony Chemit <[hidden email]>
- * @version $Id$
  * @see JavaToolResult#getExitCode()
  * @since 0.5
  */
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java b/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
index 1793cbb..60138c3 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
@@ -49,9 +49,7 @@ public class BourneShell
         setQuotedExecutableEnabled( true );
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getExecutable()
     {
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
@@ -62,7 +60,7 @@ public class BourneShell
         return unifyQuotes( super.getExecutable() );
     }
 
-    /** {@inheritDoc} */
+    @Override
     public List<String> getShellArgsList()
     {
         List<String> shellArgs = new ArrayList<String>();
@@ -78,7 +76,7 @@ public class BourneShell
         return shellArgs;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public String[] getShellArgs()
     {
         String[] shellArgs = super.getShellArgs();
@@ -100,7 +98,7 @@ public class BourneShell
         return shellArgs;
     }
 
-    /** {@inheritDoc} */
+    @Override
     protected String getExecutionPreamble()
     {
         if ( getWorkingDirectoryAsString() == null )
@@ -118,7 +116,7 @@ public class BourneShell
         return sb.toString();
     }
 
-    /** {@inheritDoc} */
+    @Override
     protected char[] getQuotingTriggerChars()
     {
         return BASH_QUOTING_TRIGGER_CHARS;
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java b/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java
index 7c27ac1..867e8b6 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java
@@ -86,6 +86,7 @@ public class CmdShell
      * @param arguments The arguments for the executable.
      * @return The resulting command line.
      */
+    @Override
     public List<String> getCommandLine( String executable, String... arguments )
     {
         StringBuilder sb = new StringBuilder();
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java b/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
index 5809610..c819c65 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
@@ -273,7 +273,7 @@ public class Shell
     public List<String> getShellCommandLine( String... arguments )
     {
 
-        List<String> commandLine = new ArrayList<String>();
+        List<String> commandLine = new ArrayList<>();
 
         if ( getShellCommand() != null )
         {
@@ -377,7 +377,7 @@ public class Shell
         return workingDir;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public Object clone()
     {
         throw new RuntimeException( "Do we ever clone this?" );
diff --git a/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java b/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java
index 7d0120c..01fc400 100644
--- a/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java
+++ b/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java
@@ -33,7 +33,6 @@ import java.util.Map;
  * @author <a href="mailto:[hidden email]">Bob McWhirter</a>
  * @author <a href="mailto:[hidden email]">Attila Szegedi</a>
  * @author <a href="mailto:[hidden email]">Geir Magnusson Jr.</a>
- * @version $Id$
  */
 public class ClassMap
 {
@@ -56,7 +55,7 @@ public class ClassMap
      * Cache of Methods, or CACHE_MISS, keyed by method
      * name and actual arguments used to find it.
      */
-    private final Map<String, Object> methodCache = new Hashtable<String, Object>();
+    private final Map<String, Object> methodCache = new Hashtable<>();
 
     private MethodMap methodMap = new MethodMap();
 
diff --git a/src/main/java/org/apache/maven/shared/utils/introspection/MethodMap.java b/src/main/java/org/apache/maven/shared/utils/introspection/MethodMap.java
index 16df95c..fe98d09 100644
--- a/src/main/java/org/apache/maven/shared/utils/introspection/MethodMap.java
+++ b/src/main/java/org/apache/maven/shared/utils/introspection/MethodMap.java
@@ -33,7 +33,6 @@ import java.util.Map;
  * @author <a href="mailto:[hidden email]">Christoph Reck</a>
  * @author <a href="mailto:[hidden email]">Geir Magnusson Jr.</a>
  * @author <a href="mailto:[hidden email]">Attila Szegedi</a>
- * @version $Id$
  */
 class MethodMap
 {
@@ -46,7 +45,7 @@ class MethodMap
     /**
      * Keep track of all methods with the same name.
      */
-    private final Map<String, List<Method>> methodByNameMap = new Hashtable<String, List<Method>>();
+    private final Map<String, List<Method>> methodByNameMap = new Hashtable<>();
 
     /**
      * Add a method to a list of methods by name.
@@ -63,7 +62,7 @@ class MethodMap
 
         if ( l == null )
         {
-            l = new ArrayList<Method>();
+            l = new ArrayList<>();
             methodByNameMap.put( methodName, l );
         }
 
@@ -169,7 +168,7 @@ class MethodMap
          * (the most specific method) otherwise we have ambiguity.
          */
 
-        LinkedList<Method> maximals = new LinkedList<Method>();
+        LinkedList<Method> maximals = new LinkedList<>();
 
         for ( Method app : applicables )
         {
@@ -283,7 +282,7 @@ class MethodMap
      */
     private static LinkedList<Method> getApplicables( List<Method> methods, Class<?>... classes )
     {
-        LinkedList<Method> list = new LinkedList<Method>();
+        LinkedList<Method> list = new LinkedList<>();
 
         for ( Method method : methods )
         {
diff --git a/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java b/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java
index 014f10c..11d6383 100644
--- a/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java
+++ b/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java
@@ -41,7 +41,6 @@ import javax.annotation.Nullable;
  *
  * @author <a href="mailto:[hidden email]">Jason van Zyl </a>
  * @author <a href="mailto:[hidden email]">Vincent Siveton</a>
- * @version $Id$
  * @see <a href="http://struts.apache.org/1.x/struts-taglib/indexedprops.html">
  * http://struts.apache.org/1.x/struts-taglib/indexedprops.html</a>
  */
diff --git a/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalkListener.java b/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalkListener.java
index cf28080..71c688d 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalkListener.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalkListener.java
@@ -23,8 +23,6 @@ import java.io.File;
 
 /**
  * DirectoryWalkListener
- *
- * @version $Id$
  */
 public interface DirectoryWalkListener
 {
diff --git a/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalker.java b/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalker.java
index 3713fe2..65fa2c6 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalker.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/DirectoryWalker.java
@@ -27,7 +27,6 @@ import java.util.Stack;
 /**
  * DirectoryWalker
  *
- * @version $Id$
  */
 class DirectoryWalker
 {
@@ -104,6 +103,7 @@ class DirectoryWalker
             return (int) Math.floor( percentageOffset + ( percentageWithinDir * percentageSize ) );
         }
 
+        @Override
         public String toString()
         {
             return "DirStackEntry[" + "dir=" + dir.getAbsolutePath() + ",count=" + count + ",index=" + index
@@ -127,9 +127,9 @@ class DirectoryWalker
 
     DirectoryWalker()
     {
-        this.includes = new ArrayList<String>();
-        this.excludes = new ArrayList<String>();
-        this.listeners = new ArrayList<DirectoryWalkListener>();
+        this.includes = new ArrayList<>();
+        this.excludes = new ArrayList<>();
+        this.listeners = new ArrayList<>();
     }
 
     public void addDirectoryWalkListener( DirectoryWalkListener listener )
diff --git a/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java b/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
index 63a5aa3..7b9f4d5 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
@@ -41,6 +41,7 @@ import java.io.Reader;
 import java.io.Writer;
 import java.net.URL;
 import java.nio.channels.FileChannel;
+import java.nio.file.Files;
 import java.security.SecureRandom;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
@@ -84,7 +85,6 @@ import java.util.Random;
  * @author <a href="mailto:[hidden email]">Christoph.Reck</a>
  * @author <a href="mailto:[hidden email]">Peter Donald</a>
  * @author <a href="mailto:[hidden email]">Jeff Turner</a>
- * @version $Id$
  */
 public class FileUtils
 {
@@ -117,11 +117,6 @@ public class FileUtils
     private static final long FILE_COPY_BUFFER_SIZE = ONE_MB * 30;
 
     /**
-     * The vm line separator
-     */
-    private static final String FS = System.getProperty( "file.separator" );
-
-    /**
      * Non-valid Characters for naming files, folders under Windows: <code>":", "*", "?", "\"", "<", ">", "|"</code>
      *
      * @see <a href="http://support.microsoft.com/?scid=kb%3Ben-us%3B177506&x=12&y=13">
@@ -277,34 +272,30 @@ public class FileUtils
     {
         StringBuilder buf = new StringBuilder();
 
-        Reader reader = null;
-
-        try
+        try ( Reader reader = getReader( file, encoding ) )
         {
-            if ( encoding != null )
-            {
-                reader = new InputStreamReader( new FileInputStream( file ), encoding );
-            }
-            else
-            {
-                reader = new InputStreamReader( new FileInputStream( file ) );
-            }
             int count;
             char[] b = new char[512];
             while ( ( count = reader.read( b ) ) >= 0 )  // blocking read
             {
                 buf.append( b, 0, count );
             }
-            reader.close();
-            reader = null;
-        }
-        finally
-        {
-            IOUtil.close( reader );
         }
 
         return buf.toString();
     }
+    
+    private static Reader getReader( @Nonnull File file, @Nullable String encoding ) throws IOException
+    {
+        if ( encoding != null )
+        {
+            return new InputStreamReader( new FileInputStream( file ), encoding );
+        }
+        else
+        {
+            return new InputStreamReader( new FileInputStream( file ) );
+        }
+    }
 
     /**
      * @param file the file path
@@ -345,10 +336,8 @@ public class FileUtils
     public static void fileAppend( @Nonnull String fileName, @Nullable String encoding, @Nonnull String data )
         throws IOException
     {
-        FileOutputStream out = null;
-        try
+        try ( FileOutputStream out = new FileOutputStream( fileName, true ) )
         {
-            out = new FileOutputStream( fileName, true );
             if ( encoding != null )
             {
                 out.write( data.getBytes( encoding ) );
@@ -357,12 +346,6 @@ public class FileUtils
             {
                 out.write( data.getBytes() );
             }
-            out.close();
-            out = null;
-        }
-        finally
-        {
-            IOUtil.close( out );
         }
     }
 
@@ -406,24 +389,21 @@ public class FileUtils
     public static void fileWrite( @Nonnull File file, @Nullable String encoding, @Nonnull String data )
         throws IOException
     {
-        Writer writer = null;
-        try
+        try ( Writer writer = getWriter( file, encoding ) )
         {
-            if ( encoding != null )
-            {
-                writer = new OutputStreamWriter( new FileOutputStream( file ), encoding );
-            }
-            else
-            {
-                writer = new OutputStreamWriter( new FileOutputStream( file ) );
-            }
             writer.write( data );
-            writer.close();
-            writer = null;
         }
-        finally
+    }
+    
+    private static Writer getWriter( @Nonnull File file, @Nullable String encoding ) throws IOException
+    {
+        if ( encoding != null )
+        {
+            return new OutputStreamWriter( new FileOutputStream( file ), encoding );
+        }
+        else
         {
-            IOUtil.close( writer );
+            return new OutputStreamWriter( new FileOutputStream( file ) );
         }
     }
 
@@ -452,18 +432,8 @@ public class FileUtils
     public static void fileWriteArray( @Nonnull File file, @Nullable String encoding, @Nullable String... data )
         throws IOException
     {
-        Writer writer = null;
-        try
+        try ( Writer writer = getWriter( file, encoding ) )
         {
-            if ( encoding != null )
-            {
-                writer = new OutputStreamWriter( new FileOutputStream( file ), encoding );
-            }
-            else
-            {
-                writer = new OutputStreamWriter( new FileOutputStream( file ) );
-            }
-
             for ( int i = 0; data != null && i < data.length; i++ )
             {
                 writer.write( data[i] );
@@ -472,13 +442,6 @@ public class FileUtils
                     writer.write( "\n" );
                 }
             }
-
-            writer.close();
-            writer = null;
-        }
-        finally
-        {
-            IOUtil.close( writer );
         }
     }
 
@@ -508,7 +471,7 @@ public class FileUtils
      */
     public static String[] getFilesFromExtension( @Nonnull String directory, @Nonnull String... extensions )
     {
-        List<String> files = new ArrayList<String>();
+        List<String> files = new ArrayList<>();
 
         File currentDir = new File( directory );
 
@@ -521,7 +484,7 @@ public class FileUtils
 
         for ( String unknownFile : unknownFiles )
         {
-            String currentFileName = directory + System.getProperty( "file.separator" ) + unknownFile;
+            String currentFileName = directory + File.separator + unknownFile;
             File currentFile = new File( currentFileName );
 
             if ( currentFile.isDirectory() )
@@ -645,25 +608,11 @@ public class FileUtils
             return false;
         }
 
-        InputStream input1 = null;
-        InputStream input2 = null;
-        boolean equals = false;
-        try
+        try ( InputStream input1 = new FileInputStream( file1 );
+              InputStream input2 = new FileInputStream( file2 ) )
         {
-            input1 = new FileInputStream( file1 );
-            input2 = new FileInputStream( file2 );
-            equals = IOUtil.contentEquals( input1, input2 );
-            input1.close();
-            input1 = null;
-            input2.close();
-            input2 = null;
+            return IOUtil.contentEquals( input1, input2 );
         }
-        finally
-        {
-            IOUtil.close( input1 );
-            IOUtil.close( input2 );
-        }
-        return equals;
     }
 
     /**
@@ -828,9 +777,9 @@ public class FileUtils
             final String message = "File " + source + " does not exist";
             throw new IOException( message );
         }
-        if ( Java7Support.isAtLeastJava7() && Java7Support.isSymLink( source ) )
+        if ( Files.isSymbolicLink( source.toPath() ) )
         {
-            File target = Java7Support.readSymbolicLink( source );
+            File target = Files.readSymbolicLink( source.toPath() ).toFile();
             Java7Support.createSymbolicLink( destination, target );
             return;
         }
@@ -866,16 +815,12 @@ public class FileUtils
     private static void doCopyFile( @Nonnull File source, @Nonnull File destination )
         throws IOException
     {
-        FileInputStream fis = null;
-        FileOutputStream fos = null;
-        FileChannel input = null;
-        FileChannel output = null;
-        try
+        
+        try ( FileInputStream fis = new FileInputStream( source );
+              FileOutputStream fos = new FileOutputStream( destination );
+              FileChannel input = fis.getChannel();
+              FileChannel output = fos.getChannel();  )
         {
-            fis = new FileInputStream( source );
-            fos = new FileOutputStream( destination );
-            input = fis.getChannel();
-            output = fos.getChannel();
             long size = input.size();
             long pos = 0;
             long count;
@@ -884,21 +829,6 @@ public class FileUtils
                 count = size - pos > FILE_COPY_BUFFER_SIZE ? FILE_COPY_BUFFER_SIZE : size - pos;
                 pos += output.transferFrom( input, pos, count );
             }
-            output.close();
-            output = null;
-            fos.close();
-            fos = null;
-            input.close();
-            input = null;
-            fis.close();
-            fis = null;
-        }
-        finally
-        {
-            IOUtil.close( output );
-            IOUtil.close( fos );
-            IOUtil.close( input );
-            IOUtil.close( fis );
         }
     }
 
@@ -968,35 +898,24 @@ public class FileUtils
                                           @Nonnull final File destination )
         throws IOException
     {
-        InputStream in = source;
-        OutputStream out = null;
-        try
+        //does destination directory exist ?
+        if ( destination.getParentFile() != null && !destination.getParentFile().exists() )
         {
-            //does destination directory exist ?
-            if ( destination.getParentFile() != null && !destination.getParentFile().exists() )
-            {
-                //noinspection ResultOfMethodCallIgnored
-                destination.getParentFile().mkdirs();
-            }
-
-            //make sure we can write to destination
-            if ( destination.exists() && !destination.canWrite() )
-            {
-                final String message = "Unable to open file " + destination + " for writing.";
-                throw new IOException( message );
-            }
+            //noinspection ResultOfMethodCallIgnored
+            destination.getParentFile().mkdirs();
+        }
 
-            out = new FileOutputStream( destination );
-            IOUtil.copy( in, out );
-            out.close();
-            out = null;
-            in.close();
-            in = null;
+        //make sure we can write to destination
+        if ( destination.exists() && !destination.canWrite() )
+        {
+            final String message = "Unable to open file " + destination + " for writing.";
+            throw new IOException( message );
         }
-        finally
+
+        try ( InputStream in = source;
+              OutputStream out = new FileOutputStream( destination ) )
         {
-            IOUtil.close( out );
-            IOUtil.close( in );
+            IOUtil.copy( in, out );
         }
     }
 
@@ -1488,7 +1407,7 @@ public class FileUtils
     {
         List<String> fileNames = getFileNames( directory, includes, excludes, includeBasedir );
 
-        List<File> files = new ArrayList<File>();
+        List<File> files = new ArrayList<>();
 
         for ( String filename : fileNames )
         {
@@ -1607,7 +1526,7 @@ public class FileUtils
 
         scanner.scan();
 
-        List<String> list = new ArrayList<String>();
+        List<String> list = new ArrayList<>();
 
         if ( getFiles )
         {
@@ -1617,7 +1536,7 @@ public class FileUtils
             {
                 if ( includeBasedir )
                 {
-                    list.add( directory + FileUtils.FS + file );
+                    list.add( directory + File.separator + file );
                 }
                 else
                 {
@@ -1634,7 +1553,7 @@ public class FileUtils
             {
                 if ( includeBasedir )
                 {
-                    list.add( directory + FileUtils.FS + directory1 );
+                    list.add( directory + File.separator + directory1 );
                 }
                 else
                 {
@@ -1974,15 +1893,12 @@ public class FileUtils
     @Nonnull public static List<String> loadFile( @Nonnull File file )
         throws IOException
     {
-        List<String> lines = new ArrayList<String>();
+        List<String> lines = new ArrayList<>();
 
         if ( file.exists() )
         {
-            BufferedReader reader = null;
-            try
+            try ( BufferedReader reader = new BufferedReader( new FileReader( file ) ) )
             {
-                reader = new BufferedReader( new FileReader( file ) );
-
                 for ( String line = reader.readLine(); line != null; line = reader.readLine() )
                 {
                     line = line.trim();
@@ -1992,13 +1908,6 @@ public class FileUtils
                         lines.add( line );
                     }
                 }
-
-                reader.close();
-                reader = null;
-            }
-            finally
-            {
-                IOUtil.close( reader );
             }
         }
 
@@ -2035,41 +1944,33 @@ public class FileUtils
     /**
      * Checks whether a given file is a symbolic link.
      *
-     * This only works reliably on java7 and higher. For earlier version we use a highly crappy heuristic
-     * that mostly does not work.
-     * <p>
-     * It doesn't really test for symbolic links but whether the canonical and absolute paths of the file are identical
-     * - this may lead to false positives on some platforms.
-     * </p>
-     *
      * @param file the file to check
      * @throws IOException in case of failure.
      * @return true if symbolic link false otherwise.
-     *
+     * @deprecated Use {@link Files#isSymbolicLink(java.nio.file.Path)} instead
      */
+    @Deprecated
     public static boolean isSymbolicLink( @Nonnull final File file )
         throws IOException
     {
-        if ( Java7Support.isAtLeastJava7() )
-        {
-            return Java7Support.isSymLink( file );
-        }
-        return isSymbolicLinkLegacy( file );
+        return Files.isSymbolicLink( file.toPath() );
     }
 
     /**
      * Checks whether a given file is a symbolic link.
      *
      * @param file the file to check
-     * @return true if and only if we reliably can say this is a symlink. This will
-     *         always return false for java versions prior to 1.7.
+     * @return true if and only if we reliably can say this is a symlink.
      *
      * @throws IOException in case of failure.
+     * @deprecated Use {@link Files#isSymbolicLink(java.nio.file.Path)} instead
      */
+    @Deprecated
     public static boolean isSymbolicLinkForSure( @Nonnull final File file )
         throws IOException
     {
-        return Java7Support.isAtLeastJava7() && Java7Support.isSymLink( file );
+        // Used to return false for Java 6 and older
+        return Files.isSymbolicLink( file.toPath() );
     }
 
     /**
diff --git a/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java b/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java
index c0e421d..f0aea3f 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java
@@ -844,7 +844,10 @@ public final class IOUtil
      * </p>
      *
      * @param channel The channel to close or {@code null}.
+     * @deprecated Use try-with-resources instead
+     * @see {@link AutoCloseable}
      */
+    @Deprecated
     public static void close( @Nullable Channel channel )
     {
         try
@@ -948,7 +951,10 @@ public final class IOUtil
      * </p>
      *
      * @param inputStream The stream to close or {@code null}.
+     * @deprecated Use try-with-resources instead
+     * @see {@link AutoCloseable}
      */
+    @Deprecated
     public static void close( @Nullable InputStream inputStream )
     {
         try
@@ -1052,7 +1058,10 @@ public final class IOUtil
      * </p>
      *
      * @param outputStream The stream to close or {@code null}.
+     * @deprecated Use try-with-resources instead
+     * @see {@link AutoCloseable}
      */
+    @Deprecated
     public static void close( @Nullable OutputStream outputStream )
     {
         try
@@ -1156,7 +1165,10 @@ public final class IOUtil
      * </p>
      *
      * @param reader The reader to close or {@code null}.
+     * @deprecated Use try-with-resources instead
+     * @see {@link AutoCloseable}
      */
+    @Deprecated
     public static void close( @Nullable Reader reader )
     {
         try
@@ -1260,7 +1272,10 @@ public final class IOUtil
      * </p>
      *
      * @param writer The writer to close or {@code null}.
+     * @deprecated Use try-with-resources instead
+     * @see {@link AutoCloseable}
      */
+    @Deprecated
     public static void close( @Nullable Writer writer )
     {
         try
diff --git a/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java b/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java
index 550de2f..7645de8 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/Java7Support.java
@@ -22,90 +22,26 @@ package org.apache.maven.shared.utils.io;
 import javax.annotation.Nonnull;
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
+import java.nio.file.Files;
 
 /**
  * Java7 feature detection
  *
  * @author Kristian Rosenvold
+ * @deprecated Java 7 is the minimum, so no need to have this class
  */
+@Deprecated
 public class Java7Support
 {
-
-    private static final boolean IS_JAVA7;
-
-    private static Method isSymbolicLink;
-
-    private static Method delete;
-
-    private static Method toPath;
-
-    private static Method exists;
-
-    private static Method toFile;
-
-    private static Method readSymlink;
-
-    private static Method createSymlink;
-
-    private static Object emptyLinkOpts;
-
-    private static Object emptyFileAttributes;
-
-    static
-    {
-        boolean isJava7x = true;
-        try
-        {
-            ClassLoader cl = Thread.currentThread().getContextClassLoader();
-            Class<?> files = cl.loadClass( "java.nio.file.Files" );
-            Class<?> path = cl.loadClass( "java.nio.file.Path" );
-            Class<?> fa = cl.loadClass( "java.nio.file.attribute.FileAttribute" );
-            Class<?> linkOption = cl.loadClass( "java.nio.file.LinkOption" );
-            isSymbolicLink = files.getMethod( "isSymbolicLink", path );
-            delete = files.getMethod( "delete", path );
-            readSymlink = files.getMethod( "readSymbolicLink", path );
-
-            emptyFileAttributes = Array.newInstance( fa, 0 );
-            final Object o = emptyFileAttributes;
-            createSymlink = files.getMethod( "createSymbolicLink", path, path, o.getClass() );
-            emptyLinkOpts = Array.newInstance( linkOption, 0 );
-            exists = files.getMethod( "exists", path, emptyLinkOpts.getClass() );
-            toPath = File.class.getMethod( "toPath" );
-            toFile = path.getMethod( "toFile" );
-        }
-        catch ( ClassNotFoundException e )
-        {
-            isJava7x = false;
-        }
-        catch ( NoSuchMethodException e )
-        {
-            isJava7x = false;
-        }
-        IS_JAVA7 = isJava7x;
-    }
-
     /**
      * @param file The file to check for being a symbolic link.
      * @return true if the file is a symlink false otherwise.
+     *
+     * @deprecated Instead use {@link Files#isSymbolicLink(java.nio.file.Path)}
      */
     public static boolean isSymLink( @Nonnull File file )
     {
-        try
-        {
-            Object path = toPath.invoke( file );
-            return (Boolean) isSymbolicLink.invoke( null, path );
-        }
-        catch ( IllegalAccessException e )
-        {
-            throw new RuntimeException( e );
-        }
-        catch ( InvocationTargetException e )
-        {
-            throw new RuntimeException( e );
-        }
+        return Files.isSymbolicLink( file.toPath() );
     }
 
 
@@ -113,24 +49,12 @@ public class Java7Support
      * @param symlink The sym link.
      * @return The file.
      * @throws IOException in case of error.
+     * @deprecated Instead use {@link Files#readSymbolicLink(java.nio.file.Path)}
      */
     @Nonnull public static File readSymbolicLink( @Nonnull File symlink )
         throws IOException
     {
-        try
-        {
-            Object path = toPath.invoke( symlink );
-            Object resultPath =  readSymlink.invoke( null, path );
-            return (File) toFile.invoke( resultPath );
-        }
-        catch ( IllegalAccessException e )
-        {
-            throw new RuntimeException( e );
-        }
-        catch ( InvocationTargetException e )
-        {
-            throw new RuntimeException( e );
-        }
+        return Files.readSymbolicLink( symlink.toPath() ).toFile();
     }
 
 
@@ -138,107 +62,60 @@ public class Java7Support
      * @param file The file to check.
      * @return true if exist false otherwise.
      * @throws IOException in case of failure.
+     * @deprecated Instead use {@link Files#exists(java.nio.file.Path, java.nio.file.LinkOption...)}
      */
     public static boolean exists( @Nonnull File file )
         throws IOException
     {
-        try
-        {
-            Object path = toPath.invoke( file );
-            final Object invoke = exists.invoke( null, path, emptyLinkOpts );
-            return (Boolean) invoke;
-        }
-        catch ( IllegalAccessException e )
-        {
-            throw new RuntimeException( e );
-        }
-        catch ( InvocationTargetException e )
-        {
-            throw (RuntimeException) e.getTargetException();
-        }
-
+        return Files.exists( file.toPath() );
     }
 
+    // CHECKSTYLE_OFF: LineLength
     /**
      * @param symlink The link name.
      * @param target The target.
      * @return The linked file.
      * @throws IOException in case of an error.
+     * @deprecated Instead use
+     *             {@link Files#createSymbolicLink(java.nio.file.Path, java.nio.file.Path, java.nio.file.attribute.FileAttribute...)}
      */
+    // CHECKSTYLE_ON: LineLength
     @Nonnull public static File createSymbolicLink( @Nonnull File symlink,  @Nonnull File target )
         throws IOException
     {
-        try
-        {
-            if ( !exists( symlink ) )
-            {
-                Object link = toPath.invoke( symlink );
-                Object path = createSymlink.invoke( null, link, toPath.invoke( target ), emptyFileAttributes );
-                return (File) toFile.invoke( path );
-            }
-            return symlink;
-        }
-        catch ( IllegalAccessException e )
+        if ( !exists( symlink ) )
         {
-            throw new RuntimeException( e );
+            return Files.createSymbolicLink( symlink.toPath(), target.toPath() ).toFile();
         }
-        catch ( InvocationTargetException e )
-        {
-            final Throwable targetException = e.getTargetException();
-            if ( targetException instanceof IOException )
-            {
-                throw (IOException) targetException;
-            }
-            else if ( targetException instanceof RuntimeException )
-            {
-                // java.lang.UnsupportedOperationException: Symbolic links not supported on this operating system
-                // java.lang.SecurityException: denies certain permissions see Javadoc
-                throw ( RuntimeException ) targetException;
-            }
-            else
-            {
-                throw new IOException( targetException.getClass() + ": " + targetException.getLocalizedMessage() );
-            }
-        }
-
+        return symlink;
     }
+
     /**
      * Performs a nio delete
      * @param file the file to delete
      * @throws IOException in case of error.
+     * @deprecated Instead use {@link Files#delete(java.nio.file.Path)}
      */
     public static void delete( @Nonnull File file )
         throws IOException
     {
-        try
-        {
-            Object path = toPath.invoke( file );
-            delete.invoke( null, path );
-        }
-        catch ( IllegalAccessException e )
-        {
-            throw new RuntimeException( e );
-        }
-        catch ( InvocationTargetException e )
-        {
-            throw (IOException) e.getTargetException();
-        }
+        Files.delete( file.toPath() );
     }
 
     /**
-     * @return true in case of Java 7.
+     * @return true
      */
     public static boolean isJava7()
     {
-        return IS_JAVA7;
+        return true;
     }
 
     /**
-     * @return true in case of Java7 or greater.
+     * @return true
      */
     public static boolean isAtLeastJava7()
     {
-        return IS_JAVA7;
+        return true;
     }
 
 }
diff --git a/src/main/java/org/apache/maven/shared/utils/io/WalkCollector.java b/src/main/java/org/apache/maven/shared/utils/io/WalkCollector.java
index 5d48d4a..e9deb2b 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/WalkCollector.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/WalkCollector.java
@@ -46,27 +46,27 @@ public class WalkCollector
      */
     public WalkCollector()
     {
-        steps = new ArrayList<File>();
+        steps = new ArrayList<>();
         startCount = 0;
         finishCount = 0;
         percentageLow = 0;
         percentageHigh = 0;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void debug( String message )
     {
         // can be used to set some message
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void directoryWalkStarting( File basedir )
     {
         startingDir = basedir;
         startCount++;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void directoryWalkStep( int percentage, File file )
     {
         steps.add( file );
@@ -74,7 +74,7 @@ public class WalkCollector
         percentageHigh = Math.max( percentageHigh, percentage );
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void directoryWalkFinished()
     {
         finishCount++;
diff --git a/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java b/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java
index 2d59bc9..c947843 100644
--- a/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java
+++ b/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java
@@ -50,98 +50,115 @@ class AnsiMessageBuilder
         this.ansi = ansi;
     }
 
+    @Override
     public String debug( String level )
     {
         return Style.DEBUG.apply( ansi ).a( level ).reset().toString();
     }
 
+    @Override
     public String info( String level )
     {
         return Style.INFO.apply( ansi ).a( level ).reset().toString();
     }
 
+    @Override
     public String warning( String level )
     {
         return Style.WARNING.apply( ansi ).a( level ).reset().toString();
     }
 
+    @Override
     public String error( String level )
     {
         return Style.ERROR.apply( ansi ).a( level ).reset().toString();
     }
 
+    @Override
     public AnsiMessageBuilder success( Object message )
     {
         Style.SUCCESS.apply( ansi ).a( message ).reset();
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder warning( Object message )
     {
         Style.WARNING.apply( ansi ).a( message ).reset();
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder failure( Object message )
     {
         Style.FAILURE.apply( ansi ).a( message ).reset();
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder strong( Object message )
     {
         Style.STRONG.apply( ansi ).a( message ).reset();
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder mojo( Object message )
     {
         Style.MOJO.apply( ansi ).a( message ).reset();
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder project( Object message )
     {
         Style.PROJECT.apply( ansi ).a( message ).reset();
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder a( char[] value, int offset, int len )
     {
         ansi.a( value, offset, len );
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder a( char[] value )
     {
         ansi.a( value );
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder a( CharSequence value, int start, int end )
     {
         ansi.a( value, start, end );
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder a( CharSequence value )
     {
         ansi.a( value );
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder a( Object value )
     {
         ansi.a( value );
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder newline()
     {
         ansi.newline();
         return this;
     }
 
+    @Override
     public AnsiMessageBuilder format( String pattern, Object... args )
     {
         ansi.format( pattern, args );
diff --git a/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java b/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java
index 6a7b56e..92a7fb9 100644
--- a/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java
+++ b/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java
@@ -42,92 +42,109 @@ class PlainMessageBuilder
         buffer = new StringBuilder( size );
     }
 
+    @Override
     public String debug( String level )
     {
         return a( level ).toString();
     }
 
+    @Override
     public String info( String level )
     {
         return a( level ).toString();
     }
 
+    @Override
     public String warning( String level )
     {
         return a( level ).toString();
     }
 
+    @Override
     public String error( String level )
     {
         return a( level ).toString();
     }
 
+    @Override
     public PlainMessageBuilder success( Object message )
     {
         return a( message );
     }
 
+    @Override
     public PlainMessageBuilder warning( Object message )
     {
         return a( message );
     }
 
+    @Override
     public PlainMessageBuilder failure( Object message )
     {
         return a( message );
     }
 
+    @Override
     public PlainMessageBuilder strong( Object message )
     {
         return a( message );
     }
 
+    @Override
     public PlainMessageBuilder mojo( Object message )
     {
         return a( message );
     }
 
+    @Override
     public PlainMessageBuilder project( Object message )
     {
         return a( message );
     }
 
+    @Override
     public PlainMessageBuilder a( char[] value, int offset, int len )
     {
         buffer.append( value, offset, len );
         return this;
     }
 
+    @Override
     public PlainMessageBuilder a( char[] value )
     {
         buffer.append( value );
         return this;
     }
 
+    @Override
     public PlainMessageBuilder a( CharSequence value, int start, int end )
     {
         buffer.append( value, start, end );
         return this;
     }
 
+    @Override
     public PlainMessageBuilder a( CharSequence value )
     {
         buffer.append( value );
         return this;
     }
 
+    @Override
     public PlainMessageBuilder a( Object value )
     {
         buffer.append( value );
         return this;
     }
 
+    @Override
     public PlainMessageBuilder newline()
     {
         buffer.append( System.getProperty( "line.separator" ) );
         return this;
     }
 
+    @Override
     public PlainMessageBuilder format( String pattern, Object... args )
     {
         buffer.append( String.format( pattern, args ) );
diff --git a/src/main/java/org/apache/maven/shared/utils/reflection/Reflector.java b/src/main/java/org/apache/maven/shared/utils/reflection/Reflector.java
index c4cb3b7..6beecc8 100644
--- a/src/main/java/org/apache/maven/shared/utils/reflection/Reflector.java
+++ b/src/main/java/org/apache/maven/shared/utils/reflection/Reflector.java
@@ -39,8 +39,7 @@ final class Reflector
 
     private static final String GET_INSTANCE_METHOD_NAME = "getInstance";
 
-    private final Map<String, Map<String, Map<String, Member>>> classMaps =
-        new HashMap<String, Map<String, Map<String, Member>>>();
+    private final Map<String, Map<String, Map<String, Member>>> classMaps = new HashMap<>();
 
     /**
      * Ensure no instances of Reflector are created...this is a utility.
@@ -79,15 +78,7 @@ final class Reflector
 
             return con.newInstance( params );
         }
-        catch ( InstantiationException ex )
-        {
-            throw new ReflectorException( ex );
-        }
-        catch ( InvocationTargetException ex )
-        {
-            throw new ReflectorException( ex );
-        }
-        catch ( IllegalAccessException ex )
+        catch ( ReflectiveOperationException ex )
         {
             throw new ReflectorException( ex );
         }
@@ -118,11 +109,7 @@ final class Reflector
 
             return method.invoke( null, initParams );
         }
-        catch ( InvocationTargetException ex )
-        {
-            throw new ReflectorException( ex );
-        }
-        catch ( IllegalAccessException ex )
+        catch ( ReflectiveOperationException ex )
         {
             throw new ReflectorException( ex );
         }
@@ -158,11 +145,7 @@ final class Reflector
 
             return method.invoke( target, params );
         }
-        catch ( InvocationTargetException ex )
-        {
-            throw new ReflectorException( ex );
-        }
-        catch ( IllegalAccessException ex )
+        catch ( ReflectiveOperationException ex )
         {
             throw new ReflectorException( ex );
         }
@@ -177,19 +160,7 @@ final class Reflector
 
             return field.get( null );
         }
-        catch ( SecurityException e )
-        {
-            throw new ReflectorException( e );
-        }
-        catch ( NoSuchFieldException e )
-        {
-            throw new ReflectorException( e );
-        }
-        catch ( IllegalArgumentException e )
-        {
-            throw new ReflectorException( e );
-        }
-        catch ( IllegalAccessException e )
+        catch ( SecurityException | ReflectiveOperationException | IllegalArgumentException e )
         {
             throw new ReflectorException( e );
         }
@@ -278,11 +249,7 @@ final class Reflector
 
             return method.invoke( null, params );
         }
-        catch ( InvocationTargetException ex )
-        {
-            throw new ReflectorException( ex );
-        }
-        catch ( IllegalAccessException ex )
+        catch ( ReflectiveOperationException ex )
         {
             throw new ReflectorException( ex );
         }
@@ -395,12 +362,7 @@ final class Reflector
             {
                 returnValue = method.invoke( target, new Object[] {} );
             }
-            catch ( IllegalAccessException e )
-            {
-                throw new ReflectorException( "Error retrieving property \'" + propertyName + "\' from \'"
-                    + targetClass + "\'", e );
-            }
-            catch ( InvocationTargetException e )
+            catch ( IllegalAccessException | InvocationTargetException e )
             {
                 throw new ReflectorException( "Error retrieving property \'" + propertyName + "\' from \'"
                     + targetClass + "\'", e );
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/PrettyPrintXMLWriter.java b/src/main/java/org/apache/maven/shared/utils/xml/PrettyPrintXMLWriter.java
index 6623a82..3dbd503 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/PrettyPrintXMLWriter.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/PrettyPrintXMLWriter.java
@@ -173,7 +173,7 @@ public class PrettyPrintXMLWriter
         assert !writer.checkError() : "Unexpected error state PrintWriter passed to PrettyPrintXMLWriter.";
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void addAttribute( String key, String value ) throws IOException
     {
         if ( !processingElement )
@@ -191,7 +191,7 @@ public class PrettyPrintXMLWriter
         }
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void setEncoding( String encoding )
     {
         if ( documentStarted )
@@ -202,7 +202,7 @@ public class PrettyPrintXMLWriter
         this.encoding = encoding;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void setDocType( String docType )
     {
         if ( documentStarted )
@@ -239,7 +239,7 @@ public class PrettyPrintXMLWriter
         this.lineIndent = lineIndentParameter.toCharArray();
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void startElement( String elementName ) throws IOException
     {
         boolean firstLine = ensureDocumentStarted();
@@ -263,7 +263,7 @@ public class PrettyPrintXMLWriter
         elementStack.add( depth++, elementName );
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void writeText( String text ) throws IOException
     {
         ensureDocumentStarted();
@@ -280,7 +280,7 @@ public class PrettyPrintXMLWriter
         }
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void writeMarkup( String markup ) throws IOException
     {
         ensureDocumentStarted();
@@ -295,7 +295,7 @@ public class PrettyPrintXMLWriter
         }
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void endElement() throws IOException
     {
         String chars = elementStack.get( --depth );
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReader.java b/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReader.java
index 11a5777..c54cbab 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReader.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReader.java
@@ -155,14 +155,14 @@ public class XmlStreamReader
         return reader.getEncoding();
     }
 
-    /** {@inheritDoc} */
+    @Override
     public int read( char[] buf, int offset, int len )
             throws IOException
     {
         return reader.read( buf, offset, len );
     }
 
-    /** {@inheritDoc} */
+    @Override
     public void close()
             throws IOException
     {
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/XmlWriterUtil.java b/src/main/java/org/apache/maven/shared/utils/xml/XmlWriterUtil.java
index e83d1cf..826ab8f 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/XmlWriterUtil.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/XmlWriterUtil.java
@@ -26,12 +26,11 @@ import org.apache.maven.shared.utils.StringUtils;
  * Utility class for the <code>XmlWriter</code> class.
  *
  * @author <a href="mailto:[hidden email]">Vincent Siveton</a>
- * @version $Id$
  */
 public class XmlWriterUtil
 {
     /** The vm line separator */
-    public static final String LS = System.getProperty( "line.separator" );
+    public static final String LS = System.lineSeparator();
 
     /** The default line indenter size i.e. 2. */
     public static final int DEFAULT_INDENTATION_SIZE = 2;
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3Dom.java b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3Dom.java
index 5efa8fc..6442bd2 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3Dom.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3Dom.java
@@ -341,7 +341,7 @@ public class Xpp3Dom
         return Xpp3DomUtils.mergeXpp3Dom( dominant, recessive );
     }
 
-    /** {@inheritDoc} */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )
@@ -362,7 +362,7 @@ public class Xpp3Dom
             && !( childList == null ? dom.childList != null : !childList.equals( dom.childList ) );
     }
 
-    /** {@inheritDoc} */
+    @Override
     public int hashCode()
     {
         int result = 17;
@@ -373,7 +373,7 @@ public class Xpp3Dom
         return result;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public String toString()
     {
         try
@@ -430,7 +430,7 @@ public class Xpp3Dom
         return str == null || str.trim().length() == 0;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public Iterator<Xpp3Dom> iterator()
     {
         return getChildrenList().iterator();
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
index 0798e4f..a4861f3 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomBuilder.java
@@ -19,7 +19,6 @@ package org.apache.maven.shared.utils.xml;
  * under the License.
  */
 
-import org.apache.maven.shared.utils.io.IOUtil;
 import org.apache.maven.shared.utils.xml.pull.XmlPullParserException;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -99,21 +98,15 @@ public class Xpp3DomBuilder
     public static Xpp3Dom build( @WillClose Reader reader, boolean trim )
         throws XmlPullParserException
     {
-        try
+        try ( Reader r = reader )
         {
-            DocHandler docHandler = parseSax( new InputSource( reader ), trim );
-            reader.close();
-            reader = null;
+            DocHandler docHandler = parseSax( new InputSource( r ), trim );
             return docHandler.result;
         }
         catch ( final IOException e )
         {
             throw new XmlPullParserException( e );
         }
-        finally
-        {
-            IOUtil.close( reader );
-        }
     }
 
     private static DocHandler parseSax( @Nonnull InputSource inputSource, boolean trim )
@@ -190,16 +183,16 @@ public class Xpp3DomBuilder
     private static class DocHandler
         extends DefaultHandler
     {
-        private final List<Xpp3Dom> elemStack = new ArrayList<Xpp3Dom>();
+        private final List<Xpp3Dom> elemStack = new ArrayList<>();
 
-        private final List<StringBuilder> values = new ArrayList<StringBuilder>();
+        private final List<StringBuilder> values = new ArrayList<>();
 
         // Todo: Use these for something smart !
-        private final List<SAXParseException> warnings = new ArrayList<SAXParseException>();
+        private final List<SAXParseException> warnings = new ArrayList<>();
 
-        private final List<SAXParseException> errors = new ArrayList<SAXParseException>();
+        private final List<SAXParseException> errors = new ArrayList<>();
 
-        private final List<SAXParseException> fatals = new ArrayList<SAXParseException>();
+        private final List<SAXParseException> fatals = new ArrayList<>();
 
 
         Xpp3Dom result = null;
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
index 1b10dc8..f42eb12 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
@@ -117,7 +117,7 @@ public class Xpp3DomUtils
 
     private static Map<String, Iterator<Xpp3Dom>> getCommonChildren( Xpp3Dom dominant, Xpp3Dom recessive )
     {
-        Map<String, Iterator<Xpp3Dom>> commonChildren = new HashMap<String, Iterator<Xpp3Dom>>();
+        Map<String, Iterator<Xpp3Dom>> commonChildren = new HashMap<>();
 
         for ( String childName : recessive.childMap.keySet() )
         {
diff --git a/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java b/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java
index 5b5ec2a..4483527 100644
--- a/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java
@@ -19,7 +19,6 @@ package org.apache.maven.shared.utils.cli;
  * under the License.
  */
 
-import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
diff --git a/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java b/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java
index e082617..97b0f31 100644
--- a/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java
@@ -30,13 +30,13 @@ import junit.framework.TestCase;
 
 /**
  * @author <a href="mailto:[hidden email]">Jason van Zyl</a>
- * @version $Id$
  */
 public class ReflectionValueExtractorTest
     extends TestCase
 {
     private Project project;
 
+    @Override
     protected void setUp()
         throws Exception
     {
diff --git a/src/test/java/org/apache/maven/shared/utils/testhelpers/ExceptionHelper.java b/src/test/java/org/apache/maven/shared/utils/testhelpers/ExceptionHelper.java
index 8d153b4..93a032d 100644
--- a/src/test/java/org/apache/maven/shared/utils/testhelpers/ExceptionHelper.java
+++ b/src/test/java/org/apache/maven/shared/utils/testhelpers/ExceptionHelper.java
@@ -49,6 +49,7 @@ public class ExceptionHelper
             this.cause = cause;
         }
 
+        @Override
         public boolean matches( Object item )
         {
             Throwable throwable = (Throwable) item;
@@ -59,6 +60,7 @@ public class ExceptionHelper
             return cause.isInstance( throwable );
         }
 
+        @Override
         public void describeTo( Description description )
         {
             description.appendText( "was caused by a " ).appendValue( cause ).appendText( " being thrown" );
diff --git a/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java b/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java
index f272332..3aa1930 100644
--- a/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java
@@ -36,7 +36,6 @@ import org.junit.Test;
  * Test of {@link PrettyPrintXMLWriter}
  *
  * @author <a href="mailto:[hidden email]">Vincent Siveton</a>
- * @version $Id$
  */
 public class PrettyPrintXmlWriterTest
 {
diff --git a/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java b/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java
index 894774a..7e1b7ef 100644
--- a/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java
@@ -29,7 +29,6 @@ import junit.framework.TestCase;
 
 /**
  * @author <a href="mailto:[hidden email]">Vincent Siveton</a>
- * @version $Id$
  */
 public class XmlWriterUtilTest
     extends TestCase
@@ -41,6 +40,7 @@ public class XmlWriterUtilTest
     private XMLWriter xmlWriter;
 
     /** {@inheritDoc} */
+    @Override
     protected void setUp()
         throws Exception
     {
@@ -52,6 +52,7 @@ public class XmlWriterUtilTest
     }
 
     /** {@inheritDoc} */
+    @Override
     protected void tearDown()
         throws Exception
     {