creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1465005 - in /creadur/rat/trunk/apache-rat-tasks/src: main/java/org/apache/rat/anttasks/ test/java/org/apache/rat/anttasks/
Date Fri, 05 Apr 2013 15:17:32 GMT
Author: sebb
Date: Fri Apr  5 15:17:31 2013
New Revision: 1465005

URL: http://svn.apache.org/r1465005
Log:
Fix up generics and missing tags

Modified:
    creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
    creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java
    creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/SubstringLicenseMatcher.java
    creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/AbstractRatAntTaskTest.java
    creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java

Modified: creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java?rev=1465005&r1=1465004&r2=1465005&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java (original)
+++ creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java Fri
Apr  5 15:17:31 2013
@@ -71,9 +71,9 @@ public class Report extends Task {
     /**
      * The licenses we want to match on.
      */
-    private ArrayList licenseMatchers = new ArrayList();
+    private ArrayList<IHeaderMatcher> licenseMatchers = new ArrayList<IHeaderMatcher>();
 
-    private ArrayList licenseNames = new ArrayList();
+    private ArrayList<ILicenseFamily> licenseNames = new ArrayList<ILicenseFamily>();
 
     /**
      * Whether to add the default list of license matchers.
@@ -176,6 +176,7 @@ public class Report extends Task {
     /**
      * Generates the report.
      */
+    @Override
     public void execute() {
         validate();
 
@@ -295,8 +296,7 @@ public class Report extends Task {
                                  nestedSize, Defaults.DEFAULT_MATCHERS.length);
             }
         } else {
-            matchers = (IHeaderMatcher[])
-                licenseMatchers.toArray(new IHeaderMatcher[0]);
+            matchers = licenseMatchers.toArray(new IHeaderMatcher[0]);
         }
         return matchers;
     }
@@ -305,7 +305,7 @@ public class Report extends Task {
         // TODO: add support for adding default licenses
         ILicenseFamily[] results = null;
         if (licenseNames.size() > 0) {
-            results = (ILicenseFamily[]) licenseNames.toArray(new ILicenseFamily[0]);
+            results = licenseNames.toArray(new ILicenseFamily[0]);
         }
         return results;
     }
@@ -327,6 +327,7 @@ public class Report extends Task {
             setValue(s);
         }
 
+        @Override
         public String[] getValues() {
             return new String[] {
                 XML_KEY, STYLED_KEY, PLAIN_KEY
@@ -348,6 +349,7 @@ public class Report extends Task {
         }
         
         
+        @Override
         public String[] getValues() {
             return new String[] {
                 TRUE, FALSE, FORCED

Modified: creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java?rev=1465005&r1=1465004&r2=1465005&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java
(original)
+++ creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java
Fri Apr  5 15:17:31 2013
@@ -48,7 +48,7 @@ class ResourceCollectionContainer implem
 
     public void run(RatReport report) throws RatException {
         ResourceDocument document = new ResourceDocument();
-        for (Iterator iter = rc.iterator(); iter.hasNext(); ) {
+        for (Iterator<?> iter = rc.iterator(); iter.hasNext(); ) {
             Resource r = (Resource) iter.next();
             if (!r.isDirectory()) {
                 document.setResource(r);

Modified: creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/SubstringLicenseMatcher.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/SubstringLicenseMatcher.java?rev=1465005&r1=1465004&r2=1465005&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/SubstringLicenseMatcher.java
(original)
+++ creadur/rat/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/SubstringLicenseMatcher.java
Fri Apr  5 15:17:31 2013
@@ -30,7 +30,7 @@ import org.apache.tools.ant.BuildExcepti
  * @since Rat Antlib 0.8
  */
 public class SubstringLicenseMatcher extends SimplePatternBasedLicense {
-    private List/*<String>*/ patterns = new ArrayList();
+    private List<String> patterns = new ArrayList<String>();
     private boolean validated = false;
 
     public void addConfiguredPattern(Pattern p) {
@@ -40,7 +40,7 @@ public class SubstringLicenseMatcher ext
     @Override
     public String[] getPatterns() {
         validate();
-        return (String[]) patterns.toArray(new String[0]);
+        return patterns.toArray(new String[0]);
     }
 
     private void validate() {

Modified: creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/AbstractRatAntTaskTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/AbstractRatAntTaskTest.java?rev=1465005&r1=1465004&r2=1465005&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/AbstractRatAntTaskTest.java
(original)
+++ creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/AbstractRatAntTaskTest.java
Fri Apr  5 15:17:31 2013
@@ -34,6 +34,7 @@ public abstract class AbstractRatAntTask
         return tempDir;
     }
 
+    @Override
     public void setUp() {
         configureProject(getAntFile().getPath());
     }

Modified: creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java?rev=1465005&r1=1465004&r2=1465005&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java
(original)
+++ creadur/rat/trunk/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java
Fri Apr  5 15:17:31 2013
@@ -29,6 +29,7 @@ import junit.framework.Assert;
 public class ReportTest extends AbstractRatAntTaskTest {
     private static final File antFile = new File("src/test/resources/antunit/report-junit.xml").getAbsoluteFile();
 
+    @Override
     protected File getAntFile() {
         return antFile;
     }



Mime
View raw message