Author: dennisl
Date: Mon Nov 28 21:10:12 2011
New Revision: 1207612
URL: http://svn.apache.org/viewvc?rev=1207612&view=rev
Log:
[PMD-135] Update to use and require Java 5
o Start using Java 5 features internally
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.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=1207612&r1=1207611&r2=1207612&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
Mon Nov 28 21:10:12 2011
@@ -278,7 +278,7 @@ public abstract class AbstractPmdReport
{
excludeRoots = new File[0];
}
- Collection excludeRootFiles = new HashSet( excludeRoots.length );
+ Collection<File> excludeRootFiles = new HashSet<File>(
excludeRoots.length );
for ( int i = 0; i < excludeRoots.length; i++ )
{
@@ -289,7 +289,7 @@ public abstract class AbstractPmdReport
}
}
- List directories = new ArrayList();
+ List<PmdFileInfo> directories = new ArrayList<PmdFileInfo>();
if ( compileSourceRoots != null )
{
@@ -345,9 +345,8 @@ public abstract class AbstractPmdReport
Map files = new TreeMap();
- for ( Iterator it = directories.iterator(); it.hasNext(); )
+ for ( PmdFileInfo finfo : directories )
{
- PmdFileInfo finfo = (PmdFileInfo) it.next();
File sourceDirectory = finfo.getSourceDirectory();
if ( sourceDirectory.isDirectory() && !excludeRootFiles.contains(
sourceDirectory ) )
{
@@ -369,7 +368,7 @@ public abstract class AbstractPmdReport
*/
private String getIncludes()
{
- Collection patterns = new LinkedHashSet();
+ Collection<String> patterns = new LinkedHashSet<String>();
if ( includes != null )
{
patterns.addAll( Arrays.asList( includes ) );