Author: adangel Date: Sun Aug 7 09:46:39 2016 New Revision: 1755428 URL: http://svn.apache.org/viewvc?rev=1755428&view=rev Log: Java 7 updates
Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdViolationCheckMojo.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdViolationCheckMojo.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportGenerator.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojo.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/ViolationDetails.java maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/CpdReportTest.java maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java Sun Aug 7 09:46:39 2016 @@ -282,7 +282,7 @@ public abstract class AbstractPmdReport excludeRoots = new File[0]; } - Collection<File> excludeRootFiles = new HashSet<File>( excludeRoots.length ); + Collection<File> excludeRootFiles = new HashSet<>( excludeRoots.length ); for ( File file : excludeRoots ) { @@ -292,7 +292,7 @@ public abstract class AbstractPmdReport } } - List<PmdFileInfo> directories = new ArrayList<PmdFileInfo>(); + List<PmdFileInfo> directories = new ArrayList<>(); if ( compileSourceRoots != null ) { @@ -360,7 +360,7 @@ public abstract class AbstractPmdReport String including = getIncludes(); getLog().debug( "Inclusions: " + including ); - Map<File, PmdFileInfo> files = new TreeMap<File, PmdFileInfo>(); + Map<File, PmdFileInfo> files = new TreeMap<>(); for ( PmdFileInfo finfo : directories ) { @@ -411,7 +411,7 @@ public abstract class AbstractPmdReport */ private String getIncludes() { - Collection<String> patterns = new LinkedHashSet<String>(); + Collection<String> patterns = new LinkedHashSet<>(); if ( includes != null ) { patterns.addAll( includes ); @@ -430,7 +430,7 @@ public abstract class AbstractPmdReport */ private String getExcludes() { - Collection<String> patterns = new LinkedHashSet<String>( FileUtils.getDefaultExcludesAsList() ); + Collection<String> patterns = new LinkedHashSet<>( FileUtils.getDefaultExcludesAsList() ); if ( excludes != null ) { patterns.addAll( excludes ); Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdViolationCheckMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdViolationCheckMojo.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdViolationCheckMojo.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdViolationCheckMojo.java Sun Aug 7 09:46:39 2016 @@ -179,8 +179,8 @@ public abstract class AbstractPmdViolati private ViolationDetails<D> getViolations( final File analysisFile, final int failurePriority ) throws XmlPullParserException, IOException { - final List<D> failures = new ArrayList<D>(); - final List<D> warnings = new ArrayList<D>(); + final List<D> failures = new ArrayList<>(); + final List<D> warnings = new ArrayList<>(); final List<D> violations = getErrorDetails( analysisFile ); Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java Sun Aug 7 09:46:39 2016 @@ -46,7 +46,6 @@ import org.apache.maven.plugins.annotati import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.reporting.MavenReportException; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.WriterFactory; @@ -329,19 +328,11 @@ public class CpdReport } String buffer = r.render( cpd.getMatches() ); - FileOutputStream tStream = null; - Writer writer = null; - try + File targetFile = new File( targetDirectory, "cpd." + format ); + targetDirectory.mkdirs(); + try ( Writer writer = new OutputStreamWriter( new FileOutputStream( targetFile ), getOutputEncoding() ) ) { - targetDirectory.mkdirs(); - File targetFile = new File( targetDirectory, "cpd." + format ); - tStream = new FileOutputStream( targetFile ); - writer = new OutputStreamWriter( tStream, getOutputEncoding() ); writer.write( buffer ); - writer.close(); - writer = null; - tStream.close(); - tStream = null; if ( includeXmlInSite ) { @@ -354,11 +345,6 @@ public class CpdReport { throw new MavenReportException( ioe.getMessage(), ioe ); } - finally - { - IOUtil.close( writer ); - IOUtil.close( tStream ); - } } /** Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdViolationCheckMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdViolationCheckMojo.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdViolationCheckMojo.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdViolationCheckMojo.java Sun Aug 7 09:46:39 2016 @@ -58,7 +58,7 @@ public class CpdViolationCheckMojo @Parameter( property = "cpd.skip", defaultValue = "false" ) private boolean skip; - private final List<Set<String>> exclusionList = new ArrayList<Set<String>>(); + private final List<Set<String>> exclusionList = new ArrayList<>(); /** * Whether to fail the build if the validation check fails. @@ -121,7 +121,7 @@ public class CpdViolationCheckMojo @Override protected boolean isExcludedFromFailure( final Duplication errorDetail ) { - final Set<String> uniquePaths = new HashSet<String>(); + final Set<String> uniquePaths = new HashSet<>(); for ( final CpdFile cpdFile : errorDetail.getFiles() ) { uniquePaths.add( cpdFile.getPath() ); @@ -166,10 +166,8 @@ public class CpdViolationCheckMojo protected void loadExcludeFromFailuresData( final String excludeFromFailureFile ) throws MojoExecutionException { - LineNumberReader reader = null; - try + try ( LineNumberReader reader = new LineNumberReader( new FileReader( excludeFromFailureFile ) ) ) { - reader = new LineNumberReader( new FileReader( excludeFromFailureFile ) ); String line; while ( ( line = reader.readLine() ) != null ) { @@ -180,26 +178,11 @@ public class CpdViolationCheckMojo { throw new MojoExecutionException( "Cannot load file " + excludeFromFailureFile, e ); } - finally - { - if ( reader != null ) - { - try - { - reader.close(); - } - catch ( final IOException e ) - { - getLog().warn( "Cannot close file " + excludeFromFailureFile, e ); - } - } - } - } private Set<String> createSetFromExclusionLine( final String line ) { - final Set<String> result = new HashSet<String>(); + final Set<String> result = new HashSet<>(); for ( final String className : line.split( "," ) ) { result.add( className.trim() ); @@ -216,7 +199,7 @@ public class CpdViolationCheckMojo @Override protected ViolationDetails<Duplication> newViolationDetailsInstance() { - return new ViolationDetails<Duplication>(); + return new ViolationDetails<>(); } @Override Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdCollectingRenderer.java Sun Aug 7 09:46:39 2016 @@ -108,7 +108,7 @@ public class PmdCollectingRenderer exten */ public String getErrorsAsString() { - List<String> errorsAsString = new ArrayList<String>( errors.size() ); + List<String> errorsAsString = new ArrayList<>( errors.size() ); for ( ProcessingError error : errors ) { errorsAsString.add( error.getFile() + ": " + error.getMsg() ); Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java Sun Aug 7 09:46:39 2016 @@ -63,7 +63,6 @@ import org.codehaus.plexus.resource.load import org.codehaus.plexus.resource.loader.FileResourceLoader; import org.codehaus.plexus.resource.loader.ResourceNotFoundException; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; @@ -363,7 +362,7 @@ public class PmdReport } pmdConfiguration.setSourceEncoding( encoding ); - List<DataSource> dataSources = new ArrayList<DataSource>( filesToProcess.size() ); + List<DataSource> dataSources = new ArrayList<>( filesToProcess.size() ); for ( File f : filesToProcess.keySet() ) { dataSources.add( new FileDataSource( f ) ); @@ -411,23 +410,14 @@ public class PmdReport if ( benchmark ) { - PrintStream benchmarkFileStream = null; - try + try ( PrintStream benchmarkFileStream = new PrintStream( benchmarkOutputFilename ) ) { - benchmarkFileStream = new PrintStream( benchmarkOutputFilename ); ( new TextReport() ).generate( Benchmarker.values(), benchmarkFileStream ); } catch ( FileNotFoundException fnfe ) { getLog().error( "Unable to generate benchmark file: " + benchmarkOutputFilename, fnfe ); } - finally - { - if ( null != benchmarkFileStream ) - { - benchmarkFileStream.close(); - } - } } } @@ -502,23 +492,15 @@ public class PmdReport return; } - Writer writer = null; - FileOutputStream tStream = null; - try + File targetFile = new File( targetDirectory, "pmd." + format ); + try ( Writer writer = new OutputStreamWriter( new FileOutputStream( targetFile ), getOutputEncoding() ) ) { targetDirectory.mkdirs(); - File targetFile = new File( targetDirectory, "pmd." + format ); - tStream = new FileOutputStream( targetFile ); - writer = new OutputStreamWriter( tStream, getOutputEncoding() ); r.setWriter( writer ); r.start(); r.renderFileReport( report ); r.end(); - writer.close(); - writer = null; - tStream.close(); - tStream = null; if ( includeXmlInSite ) { @@ -531,11 +513,6 @@ public class PmdReport { throw new MavenReportException( ioe.getMessage(), ioe ); } - finally - { - IOUtil.close( writer ); - IOUtil.close( tStream ); - } } /** Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportGenerator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportGenerator.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportGenerator.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportGenerator.java Sun Aug 7 09:46:39 2016 @@ -52,7 +52,7 @@ public class PmdReportGenerator private ResourceBundle bundle; - private HashSet<RuleViolation> violations = new HashSet<RuleViolation>(); + private HashSet<RuleViolation> violations = new HashSet<>(); private boolean aggregate; @@ -78,12 +78,12 @@ public class PmdReportGenerator public void setViolations( Collection<RuleViolation> violations ) { - this.violations = new HashSet<RuleViolation>( violations ); + this.violations = new HashSet<>( violations ); } public List<RuleViolation> getViolations() { - return new ArrayList<RuleViolation>( violations ); + return new ArrayList<>( violations ); } // public List<Metric> getMetrics() @@ -163,7 +163,7 @@ public class PmdReportGenerator throws IOException { fileCount = files.size(); - ArrayList<RuleViolation> violations2 = new ArrayList<RuleViolation>( violations ); + ArrayList<RuleViolation> violations2 = new ArrayList<>( violations ); Collections.sort( violations2, new Comparator<RuleViolation>() { /** {@inheritDoc} */ Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojo.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojo.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdViolationCheckMojo.java Sun Aug 7 09:46:39 2016 @@ -71,7 +71,7 @@ public class PmdViolationCheckMojo @Parameter( property = "pmd.skip", defaultValue = "false" ) private boolean skip; - private final Map<String, Set<String>> excludeFromFailureClasses = new HashMap<String, Set<String>>(); + private final Map<String, Set<String>> excludeFromFailureClasses = new HashMap<>(); /** * {@inheritDoc} @@ -113,7 +113,7 @@ public class PmdViolationCheckMojo } for ( final Entry<Object, Object> propEntry : props.entrySet() ) { - final Set<String> excludedRuleSet = new HashSet<String>(); + final Set<String> excludedRuleSet = new HashSet<>(); final String className = propEntry.getKey().toString(); final String[] excludedRules = propEntry.getValue().toString().split( "," ); for ( final String excludedRule : excludedRules ) @@ -188,7 +188,7 @@ public class PmdViolationCheckMojo PmdXpp3Reader reader = new PmdXpp3Reader(); PmdErrorDetail details = reader.read( reader1, false ); - List<Violation> violations = new ArrayList<Violation>(); + List<Violation> violations = new ArrayList<>(); for ( PmdFile file : details.getFiles() ) { String fullPath = file.getName(); @@ -216,7 +216,7 @@ public class PmdViolationCheckMojo @Override protected ViolationDetails<Violation> newViolationDetailsInstance() { - return new ViolationDetails<Violation>(); + return new ViolationDetails<>(); } private String getFilename( String fullpath, String pkg ) Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/ViolationDetails.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/ViolationDetails.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/ViolationDetails.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/ViolationDetails.java Sun Aug 7 09:46:39 2016 @@ -31,9 +31,9 @@ import java.util.List; */ public class ViolationDetails<D> { - private List<D> warningDetails = new ArrayList<D>(); + private List<D> warningDetails = new ArrayList<>(); - private List<D> failureDetails = new ArrayList<D>(); + private List<D> failureDetails = new ArrayList<>(); /** * @return the warningDetails, never {@code null} Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/CpdReportTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/CpdReportTest.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/CpdReportTest.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/CpdReportTest.java Sun Aug 7 09:46:39 2016 @@ -194,7 +194,7 @@ public class CpdReportTest TokenEntry tFirstEntry = new TokenEntry( "public java", "MyClass.java", 34 ); TokenEntry tSecondEntry = new TokenEntry( "public java", "MyClass3.java", 55 ); - List<Match> tList = new ArrayList<Match>(); + List<Match> tList = new ArrayList<>(); Mark tFirstMark = new Mark( tFirstEntry ); Mark tSecondMark = new Mark( tSecondEntry ); tFirstMark.setSoureCodeSlice( "// ----- ACCESSEURS avec �l�ments -----" ); Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/PmdReportTest.java Sun Aug 7 09:46:39 2016 @@ -24,6 +24,7 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.Locale; import org.apache.commons.io.IOUtils; @@ -139,10 +140,12 @@ public class PmdReportTest mockServer.start(); String sonarRuleset = - IOUtils.toString( getClass().getClassLoader().getResourceAsStream( "unit/default-configuration/rulesets/sonar-way-ruleset.xml" ) ); + IOUtils.toString( getClass().getClassLoader().getResourceAsStream( "unit/default-configuration/rulesets/sonar-way-ruleset.xml" ), + StandardCharsets.UTF_8 ); String sonarMainPageHtml = - IOUtils.toString( getClass().getClassLoader().getResourceAsStream( "unit/default-configuration/rulesets/sonar-main-page.html" ) ); + IOUtils.toString( getClass().getClassLoader().getResourceAsStream( "unit/default-configuration/rulesets/sonar-main-page.html" ), + StandardCharsets.UTF_8 ); final String sonarBaseUrl = "/profiles"; final String sonarProfileUrl = sonarBaseUrl + "/export?format=pmd&language=java&name=Sonar%2520way"; Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/CustomConfigurationMavenProjectStub.java Sun Aug 7 09:46:39 2016 @@ -41,7 +41,7 @@ public class CustomConfigurationMavenPro { private Build build; - private List<ReportPlugin> reportPlugins = new ArrayList<ReportPlugin>(); + private List<ReportPlugin> reportPlugins = new ArrayList<>(); public CustomConfigurationMavenProjectStub() { @@ -80,7 +80,7 @@ public class CustomConfigurationMavenPro setReportPlugins( model.getReporting().getPlugins() ); String basedir = getBasedir().getAbsolutePath(); - List<String> compileSourceRoots = new ArrayList<String>(); + List<String> compileSourceRoots = new ArrayList<>(); compileSourceRoots.add( basedir + "/src/test/resources/unit/custom-configuration/custom/configuration" ); setCompileSourceRoots( compileSourceRoots ); Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/DefaultConfigurationMavenProjectStub.java Sun Aug 7 09:46:39 2016 @@ -40,7 +40,7 @@ import org.codehaus.plexus.util.IOUtil; public class DefaultConfigurationMavenProjectStub extends MavenProjectStub { - private List<ReportPlugin> reportPlugins = new ArrayList<ReportPlugin>(); + private List<ReportPlugin> reportPlugins = new ArrayList<>(); private Build build; @@ -89,7 +89,7 @@ public class DefaultConfigurationMavenPr .getPlugins() ); String basedir = getBasedir().getAbsolutePath(); - List<String> compileSourceRoots = new ArrayList<String>(); + List<String> compileSourceRoots = new ArrayList<>(); compileSourceRoots.add( basedir + "/src/test/resources/unit/default-configuration/def/configuration" ); setCompileSourceRoots( compileSourceRoots ); Modified: maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java?rev=1755428&r1=1755427&r2=1755428&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/test/java/org/apache/maven/plugin/pmd/stubs/InvalidFormatMavenProjectStub.java Sun Aug 7 09:46:39 2016 @@ -75,7 +75,7 @@ public class InvalidFormatMavenProjectSt setBuild( build ); String basedir = getBasedir().getAbsolutePath(); - List<String> compileSourceRoots = new ArrayList<String>(); + List<String> compileSourceRoots = new ArrayList<>(); compileSourceRoots.add( basedir + "/src/test/resources/unit/invalid-format/invalid/format" ); setCompileSourceRoots( compileSourceRoots );