You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2015/06/21 14:02:24 UTC

svn commit: r1686704 - in /maven/plugins/trunk/maven-checkstyle-plugin/src: main/java/org/apache/maven/plugin/checkstyle/ main/java/org/apache/maven/plugin/checkstyle/exec/ main/java/org/apache/maven/plugin/checkstyle/rss/ test/java/org/apache/maven/pl...

Author: krosenvold
Date: Sun Jun 21 12:02:24 2015
New Revision: 1686704

URL: http://svn.apache.org/r1686704
Log:
Java7 updates

Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleCheckerListener.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResults.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/DefaultCheckstyleRssGenerator.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/VelocityTemplate.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResultsTest.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MinMavenProjectStub.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/ModuleMavenProjectStub.java

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java Sun Jun 21 12:02:24 2015
@@ -517,7 +517,7 @@ public abstract class AbstractCheckstyle
             plugin = mojoExecution.getMojoDescriptor().getPluginDescriptor();
         }
         
-        List<Artifact> artifacts = new ArrayList<Artifact>();
+        List<Artifact> artifacts = new ArrayList<>();
 
         PluginManagement pluginManagement = project.getBuild().getPluginManagement();
         if ( pluginManagement != null )
@@ -532,7 +532,7 @@ public abstract class AbstractCheckstyle
 
     private List<Artifact> getCheckstylePluginDependenciesAsArtifacts( Map<String, Plugin> plugins, String hint )
     {
-        List<Artifact> artifacts = new ArrayList<Artifact>();
+        List<Artifact> artifacts = new ArrayList<>();
         
         Plugin checkstylePlugin = plugins.get( plugin.getGroupId() + ":" + plugin.getArtifactId() );
         if ( checkstylePlugin != null )
@@ -732,7 +732,7 @@ public abstract class AbstractCheckstyle
         }
         else
         {
-            sourceDirs = new ArrayList<File>( sourceDirectories.size() );
+            sourceDirs = new ArrayList<>( sourceDirectories.size() );
             for ( String sourceDir : sourceDirectories )
             {
                 sourceDirs.add( FileUtils.resolveFile( project.getBasedir(), sourceDir ) );
@@ -753,7 +753,7 @@ public abstract class AbstractCheckstyle
         // probably null-check only required due to MavenProjectStubs
         else if ( testSourceDirectories != null )
         {
-            testSourceDirs = new ArrayList<File>( testSourceDirectories.size() );
+            testSourceDirs = new ArrayList<>( testSourceDirectories.size() );
             for ( String testSourceDir : testSourceDirectories )
             {
                 testSourceDirs.add( FileUtils.resolveFile( project.getBasedir(), testSourceDir ) );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java Sun Jun 21 12:02:24 2015
@@ -56,7 +56,7 @@ public class CheckstyleReport
 
     static
     {
-        Map<String, String> fmt2Cfg = new HashMap<String, String>();
+        Map<String, String> fmt2Cfg = new HashMap<>();
 
         fmt2Cfg.put( "sun", "sun_checks.xml" );
         fmt2Cfg.put( "maven", "config/maven_checks.xml" );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java Sun Jun 21 12:02:24 2015
@@ -340,7 +340,7 @@ public class CheckstyleReportGenerator
             sink.text( ruleName );
         }
 
-        List<String> attribnames = new ArrayList<String>( Arrays.asList( checkerConfig.getAttributeNames() ) );
+        List<String> attribnames = new ArrayList<>( Arrays.asList( checkerConfig.getAttributeNames() ) );
         attribnames.remove( "severity" ); // special value (deserves unique column)
         if ( !attribnames.isEmpty() )
         {
@@ -531,7 +531,7 @@ public class CheckstyleReportGenerator
         sink.tableRow_();
 
         // Sort the files before writing them to the report
-        List<String> fileList = new ArrayList<String>( results.getFiles().keySet() );
+        List<String> fileList = new ArrayList<>( results.getFiles().keySet() );
         Collections.sort( fileList );
 
         for ( String filename : fileList )
@@ -579,7 +579,7 @@ public class CheckstyleReportGenerator
         sink.sectionTitle1_();
 
         // Sort the files before writing their details to the report
-        List<String> fileList = new ArrayList<String>( results.getFiles().keySet() );
+        List<String> fileList = new ArrayList<>( results.getFiles().keySet() );
         Collections.sort( fileList );
 
         for ( String file : fileList )
@@ -777,7 +777,7 @@ public class CheckstyleReportGenerator
 
     public List<ConfReference> sortConfiguration( CheckstyleResults results )
     {
-        List<ConfReference> result = new ArrayList<ConfReference>();
+        List<ConfReference> result = new ArrayList<>();
 
         sortConfiguration( result, checkstyleConfig, null, results );
 
@@ -796,7 +796,7 @@ public class CheckstyleReportGenerator
             if ( treeWalkerNames.contains( ruleName ) )
             {
                 // special sub-case: TreeWalker is the parent of multiple rules, not an effective rule
-                sortConfiguration( result, childConfig, new ChainedItem<Configuration>( config, parent ), results );
+                sortConfiguration( result, childConfig, new ChainedItem<>( config, parent ), results );
             }
             else
             {

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java Sun Jun 21 12:02:24 2015
@@ -584,12 +584,7 @@ public class CheckstyleViolationCheckMoj
                 getLog().warn( "checkstyle:check violations detected but failOnViolation set to false" );
             }
         }
-        catch ( IOException e )
-        {
-            throw new MojoExecutionException( "Unable to read Checkstyle results xml: " + outputFile.getAbsolutePath(),
-                                              e );
-        }
-        catch ( XmlPullParserException e )
+        catch ( IOException | XmlPullParserException e )
         {
             throw new MojoExecutionException( "Unable to read Checkstyle results xml: " + outputFile.getAbsolutePath(),
                                               e );
@@ -803,7 +798,7 @@ public class CheckstyleViolationCheckMoj
             plugin = mojoExecution.getMojoDescriptor().getPluginDescriptor();
         }
         
-        List<Artifact> artifacts = new ArrayList<Artifact>();
+        List<Artifact> artifacts = new ArrayList<>();
 
         PluginManagement pluginManagement = project.getBuild().getPluginManagement();
         if ( pluginManagement != null )
@@ -818,7 +813,7 @@ public class CheckstyleViolationCheckMoj
 
     private List<Artifact> getCheckstylePluginDependenciesAsArtifacts( Map<String, Plugin> plugins, String hint )
     {
-        List<Artifact> artifacts = new ArrayList<Artifact>();
+        List<Artifact> artifacts = new ArrayList<>();
         
         Plugin checkstylePlugin = plugins.get( plugin.getGroupId() + ":" + plugin.getArtifactId() );
         if ( checkstylePlugin != null )
@@ -843,7 +838,7 @@ public class CheckstyleViolationCheckMoj
         }
         else
         {
-            sourceDirs = new ArrayList<File>( sourceDirectories.size() );
+            sourceDirs = new ArrayList<>( sourceDirectories.size() );
             for ( String sourceDir : sourceDirectories )
             {
                 sourceDirs.add( FileUtils.resolveFile( project.getBasedir(), sourceDir ) );
@@ -864,7 +859,7 @@ public class CheckstyleViolationCheckMoj
         // probably null-check only required due to MavenProjectStubs
         else if ( testSourceDirectories != null )
         {
-            testSourceDirs = new ArrayList<File>( testSourceDirectories.size() );
+            testSourceDirs = new ArrayList<>( testSourceDirectories.size() );
             for ( String testSourceDir : testSourceDirectories )
             {
                 testSourceDirs.add( FileUtils.resolveFile( project.getBasedir(), testSourceDir ) );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleCheckerListener.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleCheckerListener.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleCheckerListener.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleCheckerListener.java Sun Jun 21 12:02:24 2015
@@ -59,7 +59,7 @@ public class CheckstyleCheckerListener
      */
     public CheckstyleCheckerListener( File sourceDirectory )
     {
-        this.sourceDirectories = new ArrayList<File>();
+        this.sourceDirectories = new ArrayList<>();
         this.sourceDirectories.add( sourceDirectory );
     }
     /**
@@ -69,7 +69,7 @@ public class CheckstyleCheckerListener
      */
     public CheckstyleCheckerListener( File sourceDirectory, Configuration configuration )
     {
-        this.sourceDirectories = new ArrayList<File>();
+        this.sourceDirectories = new ArrayList<>();
         this.sourceDirectories.add( sourceDirectory );
         this.checkstyleConfiguration = configuration;
     }
@@ -80,7 +80,7 @@ public class CheckstyleCheckerListener
      */
     public CheckstyleCheckerListener( Configuration configuration )
     {
-        this.sourceDirectories = new ArrayList<File>();
+        this.sourceDirectories = new ArrayList<>();
         this.checkstyleConfiguration = configuration;
     }
 
@@ -141,7 +141,7 @@ public class CheckstyleCheckerListener
 
         if ( events == null )
         {
-            events = new ArrayList<AuditEvent>();
+            events = new ArrayList<>();
         }
     }
 

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResults.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResults.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResults.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResults.java Sun Jun 21 12:02:24 2015
@@ -43,7 +43,7 @@ public class CheckstyleResults
 
     public CheckstyleResults()
     {
-        files = new HashMap<String, List<AuditEvent>>();
+        files = new HashMap<>();
     }
 
     public List<AuditEvent> getFileViolations( String file )
@@ -56,7 +56,7 @@ public class CheckstyleResults
         }
         else
         {
-            violations = new LinkedList<AuditEvent>();
+            violations = new LinkedList<>();
             if ( file != null )
             {
                 this.files.put( file, violations );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java Sun Jun 21 12:02:24 2015
@@ -120,23 +120,22 @@ public class DefaultCheckstyleExecutor
         Checker checker = new Checker();
 
         // setup classloader, needed to avoid "Unable to get class information for ..." errors
-        List<String> classPathStrings = new ArrayList<String>();
-        List<String> outputDirectories = new ArrayList<String>();
+        List<String> classPathStrings = new ArrayList<>();
+        List<String> outputDirectories = new ArrayList<>();
         
         // stand-alone
         Collection<File> sourceDirectories = null;
         Collection<File> testSourceDirectories = request.getTestSourceDirectories();
         
         // aggregator
-        Map<MavenProject, Collection<File>> sourceDirectoriesByProject = new HashMap<MavenProject, Collection<File>>();
-        Map<MavenProject, Collection<File>> testSourceDirectoriesByProject =
-            new HashMap<MavenProject, Collection<File>>();
+        Map<MavenProject, Collection<File>> sourceDirectoriesByProject = new HashMap<>();
+        Map<MavenProject, Collection<File>> testSourceDirectoriesByProject = new HashMap<>();
         
         if ( request.isAggregate() )
         {
             for ( MavenProject childProject : request.getReactorProjects() )
             {
-                sourceDirectories = new ArrayList<File>( childProject.getCompileSourceRoots().size() );
+                sourceDirectories = new ArrayList<>( childProject.getCompileSourceRoots().size() );
                 List<String> compileSourceRoots = childProject.getCompileSourceRoots();
                 for ( String compileSourceRoot : compileSourceRoots )
                 {
@@ -144,7 +143,7 @@ public class DefaultCheckstyleExecutor
                 }
                 sourceDirectoriesByProject.put( childProject, sourceDirectories );
                 
-                testSourceDirectories = new ArrayList<File>( childProject.getTestCompileSourceRoots().size() );
+                testSourceDirectories = new ArrayList<>( childProject.getTestCompileSourceRoots().size() );
                 List<String> testCompileSourceRoots = childProject.getTestCompileSourceRoots();
                 for ( String testCompileSourceRoot : testCompileSourceRoots )
                 {
@@ -163,7 +162,7 @@ public class DefaultCheckstyleExecutor
                                     testSourceDirectories );
         }
 
-        final List<URL> urls = new ArrayList<URL>( classPathStrings.size() );
+        final List<URL> urls = new ArrayList<>( classPathStrings.size() );
 
         for ( String path : classPathStrings )
         {
@@ -279,7 +278,7 @@ public class DefaultCheckstyleExecutor
 
         if ( nbErrors > 0 )
         {
-            StringBuffer message = new StringBuffer( "There " );
+            StringBuilder message = new StringBuilder( "There " );
             if ( nbErrors == 1 )
             {
                 message.append( "is" );
@@ -569,12 +568,7 @@ public class DefaultCheckstyleExecutor
                         p.setProperty( "checkstyle.header.file", headerFile.getAbsolutePath() );
                     }
                 }
-                catch ( FileResourceCreationException e )
-                {
-                    getLogger().debug( "Unable to process header location: " + headerLocation );
-                    getLogger().debug( "Checkstyle will throw exception if ${checkstyle.header.file} is used" );
-                }
-                catch ( ResourceNotFoundException e )
+                catch ( FileResourceCreationException | ResourceNotFoundException e )
                 {
                     getLogger().debug( "Unable to process header location: " + headerLocation );
                     getLogger().debug( "Checkstyle will throw exception if ${checkstyle.header.file} is used" );
@@ -586,15 +580,7 @@ public class DefaultCheckstyleExecutor
                 p.setProperty( "checkstyle.cache.file", request.getCacheFile() );
             }
         }
-        catch ( IOException e )
-        {
-            throw new CheckstyleExecutorException( "Failed to get overriding properties", e );
-        }
-        catch ( FileResourceCreationException e )
-        {
-            throw new CheckstyleExecutorException( "Failed to get overriding properties", e );
-        }
-        catch ( ResourceNotFoundException e )
+        catch ( IOException | ResourceNotFoundException | FileResourceCreationException e )
         {
             throw new CheckstyleExecutorException( "Failed to get overriding properties", e );
         }
@@ -632,12 +618,12 @@ public class DefaultCheckstyleExecutor
             excludesStr.append( defaultExclude );
         }
 
-        Set<File> files = new LinkedHashSet<File>();
+        Set<File> files = new LinkedHashSet<>();
         if ( request.isAggregate() )
         {
             for ( MavenProject project : request.getReactorProjects() )
             {
-                Set<File> sourceDirectories = new LinkedHashSet<File>();
+                Set<File> sourceDirectories = new LinkedHashSet<>();
                 
                 // CompileSourceRoots are absolute paths
                 List<String> compileSourceRoots = project.getCompileSourceRoots(); 
@@ -646,7 +632,7 @@ public class DefaultCheckstyleExecutor
                     sourceDirectories.add( new File( compileSourceRoot ) );
                 }
 
-                Set<File> testSourceDirectories = new LinkedHashSet<File>();
+                Set<File> testSourceDirectories = new LinkedHashSet<>();
                 // CompileSourceRoots are absolute paths
                 List<String> testCompileSourceRoots = project.getTestCompileSourceRoots(); 
                 for ( String testCompileSourceRoot : testCompileSourceRoots )
@@ -667,7 +653,7 @@ public class DefaultCheckstyleExecutor
 
         getLogger().debug( "Added " + files.size() + " files to process." );
 
-        return new ArrayList<File>( files );
+        return new ArrayList<>( files );
     }
 
     private void addFilesToProcess( CheckstyleExecutorRequest request, Collection<File> sourceDirectories,

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/DefaultCheckstyleRssGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/DefaultCheckstyleRssGenerator.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/DefaultCheckstyleRssGenerator.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/DefaultCheckstyleRssGenerator.java Sun Jun 21 12:02:24 2015
@@ -75,15 +75,7 @@ public class DefaultCheckstyleRssGenerat
         {
             throw new MavenReportException( "Unable to find checkstyle-rss.vm resource.", e );
         }
-        catch ( MojoExecutionException e )
-        {
-            throw new MavenReportException( "Unable to generate checkstyle.rss.", e );
-        }
-        catch ( VelocityException e )
-        {
-            throw new MavenReportException( "Unable to generate checkstyle.rss.", e );
-        }
-        catch ( IOException e )
+        catch ( MojoExecutionException | IOException | VelocityException e )
         {
             throw new MavenReportException( "Unable to generate checkstyle.rss.", e );
         }

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/VelocityTemplate.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/VelocityTemplate.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/VelocityTemplate.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/rss/VelocityTemplate.java Sun Jun 21 12:02:24 2015
@@ -108,11 +108,7 @@ public class VelocityTemplate
         {
             throw new ResourceNotFoundException( "Template not found: " + templateDirectory + "/" + template, e );
         }
-        catch ( VelocityException e )
-        {
-            throw e; // to get past generic catch for Exception.
-        }
-        catch ( IOException e )
+        catch ( VelocityException | IOException e )
         {
             throw e; // to get past generic catch for Exception.
         }

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java Sun Jun 21 12:02:24 2015
@@ -46,7 +46,7 @@ public class CheckstyleReportListenerMul
     protected void setUp()
         throws Exception
     {
-        listenerMap = new HashMap<SeverityLevel, CheckstyleCheckerListener>();
+        listenerMap = new HashMap<>();
 
         CheckstyleCheckerListener listener = new CheckstyleCheckerListener( new File( "/source/path" ) );
         listener.addSourceDirectory( new File( "/source/path2" ) );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java Sun Jun 21 12:02:24 2015
@@ -45,7 +45,7 @@ public class CheckstyleReportListenerTes
     protected void setUp()
         throws Exception
     {
-        listenerMap = new HashMap<SeverityLevel, CheckstyleCheckerListener>();
+        listenerMap = new HashMap<>();
 
         CheckstyleCheckerListener listener = new CheckstyleCheckerListener( new File( "/source/path" ) );
         listener.setSeverityLevelFilter( SeverityLevel.INFO );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResultsTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResultsTest.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResultsTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleResultsTest.java Sun Jun 21 12:02:24 2015
@@ -75,27 +75,27 @@ public class CheckstyleResultsTest
 
     public void testResults()
     {
-        Map<String, List<AuditEvent>> files = new HashMap<String, List<AuditEvent>>();
+        Map<String, List<AuditEvent>> files = new HashMap<>();
 
         LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
         AuditEvent event = new AuditEvent( this, "file1", message );
         files.put( "file1", Collections.singletonList( event ) );
 
         message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null );
-        List<AuditEvent> events = new ArrayList<AuditEvent>();
+        List<AuditEvent> events = new ArrayList<>();
         events.add( new AuditEvent( this, "file2", message ) );
         events.add( new AuditEvent( this, "file2", message ) );
         files.put( "file2", events );
 
         message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null );
-        events = new ArrayList<AuditEvent>();
+        events = new ArrayList<>();
         events.add( new AuditEvent( this, "file3", message ) );
         events.add( new AuditEvent( this, "file3", message ) );
         events.add( new AuditEvent( this, "file3", message ) );
         files.put( "file3", events );
 
         message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null );
-        events = new ArrayList<AuditEvent>();
+        events = new ArrayList<>();
         events.add( new AuditEvent( this, "file4", message ) );
         events.add( new AuditEvent( this, "file4", message ) );
         events.add( new AuditEvent( this, "file4", message ) );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MinMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MinMavenProjectStub.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MinMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MinMavenProjectStub.java Sun Jun 21 12:02:24 2015
@@ -48,7 +48,7 @@ public class MinMavenProjectStub
     public List<String> getTestClasspathElements()
         throws DependencyResolutionRequiredException
     {
-        List<String> list = new ArrayList<String>( getCompileClasspathElements() );
+        List<String> list = new ArrayList<>( getCompileClasspathElements() );
         list.add( PlexusTestCase.getBasedir() + "/target/test-classes" );
         return list;
     }

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/ModuleMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/ModuleMavenProjectStub.java?rev=1686704&r1=1686703&r2=1686704&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/ModuleMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/ModuleMavenProjectStub.java Sun Jun 21 12:02:24 2015
@@ -49,7 +49,7 @@ public class ModuleMavenProjectStub
     public List<String> getTestClasspathElements()
         throws DependencyResolutionRequiredException
     {
-        List<String> list = new ArrayList<String>( getCompileClasspathElements() );
+        List<String> list = new ArrayList<>( getCompileClasspathElements() );
         list.add( PlexusTestCase.getBasedir() + "/target/test-classes" );
         return list;
     }