creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548438 - in /creadur/rat/branches/gsoc: apache-rat-core/src/main/java/org/apache/rat/analysis/ apache-rat-core/src/main/java/org/apache/rat/analysis/generation/ apache-rat-core/src/main/java/org/apache/rat/analysis/license/ apache-rat-cor...
Date Fri, 06 Dec 2013 09:00:14 GMT
Author: rdonkin
Date: Fri Dec  6 09:00:13 2013
New Revision: 1548438

URL: http://svn.apache.org/r1548438
Log:
Delete RatException that there arenĀ“t used: -RatHeaderAnalysisException -RatReportAnalysisResultException
-RatDocumentAnalysisException -UnsuitableDocumentException

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DocumentHeaderAnalyser.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/HeaderCheckWorker.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/AppliedApacheSoftwareLicense20.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CopyrightHeader.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/FullTextMatchingLicense.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/SimplePatternBasedLicense.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/IDocumentAnalyser.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/util/DocumentAnalyserMultiplexer.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/claim/util/ClaimReporterMultiplexer.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/document/MockDocumentAnalyser.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
    creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/FullTextLicenseMatcher.java
    creadur/rat/branches/gsoc/apache-rat-tasks/src/test/java/org/example/Matcher.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
Fri Dec  6 09:00:13 2013
@@ -21,10 +21,10 @@ package org.apache.rat.analysis;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData;
 import org.apache.rat.document.IDocumentAnalyser;
-import org.apache.rat.document.RatDocumentAnalysisException;
 import org.apache.rat.document.impl.guesser.ArchiveGuesser;
 import org.apache.rat.document.impl.guesser.BinaryGuesser;
 import org.apache.rat.document.impl.guesser.NoteGuesser;
+import java.io.IOException;
 
 final class DefaultAnalyser implements IDocumentAnalyser {
 
@@ -38,8 +38,7 @@ final class DefaultAnalyser implements I
         this.matcher = matcher;
     }
 
-    public void analyse(final Document subject)
-            throws RatDocumentAnalysisException {
+    public void analyse(final Document subject) throws IOException{
         final MetaData.Datum documentCategory;
         if (this.noteGuessor.matches(subject)) {
             documentCategory = MetaData.RAT_DOCUMENT_CATEGORY_DATUM_NOTICE;

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DocumentHeaderAnalyser.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DocumentHeaderAnalyser.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DocumentHeaderAnalyser.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DocumentHeaderAnalyser.java
Fri Dec  6 09:00:13 2013
@@ -23,7 +23,6 @@ import java.io.Reader;
 
 import org.apache.rat.api.Document;
 import org.apache.rat.document.IDocumentAnalyser;
-import org.apache.rat.document.RatDocumentAnalysisException;
 
 public class DocumentHeaderAnalyser implements IDocumentAnalyser {
 
@@ -34,17 +33,13 @@ public class DocumentHeaderAnalyser impl
         this.matcher = matcher;
     }
 
-    public void analyse(Document document) throws RatDocumentAnalysisException {
+    public void analyse(Document document) throws IOException{
         Reader reader = null;
         try {
             reader = document.reader();
             // TODO: worker function should be moved into this class
             HeaderCheckWorker worker = new HeaderCheckWorker(reader, matcher, document);
             worker.read();
-        } catch (IOException e) {
-            throw new RatDocumentAnalysisException("Cannot read header", e);
-        } catch (RatHeaderAnalysisException e) {
-            throw new RatDocumentAnalysisException("Cannot analyse header", e);
         } finally {
             if (reader != null) {
                 try {

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/HeaderCheckWorker.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/HeaderCheckWorker.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/HeaderCheckWorker.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/HeaderCheckWorker.java
Fri Dec  6 09:00:13 2013
@@ -76,24 +76,23 @@ class HeaderCheckWorker {
         return finished;
     }
 
-    public void read() throws RatHeaderAnalysisException {
+    public void read() throws IOException{
         if (!finished) {
             final StringBuilder headers = new StringBuilder();
             headerLinesToRead = numberOfRetainedHeaderLines;
-            try {
-                while(readLine(headers)) {
-                    // do nothing
-                }
-                if (!match) {
-                    final String notes = headers.toString();
-                    final MetaData metaData = subject.getMetaData();
-                    metaData.set(new MetaData.Datum(MetaData.RAT_URL_HEADER_SAMPLE, notes));
-                    metaData.set(new MetaData.Datum(MetaData.RAT_URL_HEADER_CATEGORY, MetaData.RAT_LICENSE_FAMILY_CATEGORY_VALUE_UNKNOWN));
-                    metaData.set(MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_UNKNOWN);
-                }
-            } catch (IOException e) {
-                throw new RatHeaderAnalysisException("Cannot read header for " + subject,
e);
-            }
+			while (readLine(headers)) {
+				// do nothing
+			}
+			if (!match) {
+				final String notes = headers.toString();
+				final MetaData metaData = subject.getMetaData();
+				metaData.set(new MetaData.Datum(MetaData.RAT_URL_HEADER_SAMPLE,
+						notes));
+				metaData.set(new MetaData.Datum(
+						MetaData.RAT_URL_HEADER_CATEGORY,
+						MetaData.RAT_LICENSE_FAMILY_CATEGORY_VALUE_UNKNOWN));
+				metaData.set(MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_UNKNOWN);
+			}
             try {
                 reader.close();
             } catch (IOException e) {
@@ -104,7 +103,7 @@ class HeaderCheckWorker {
         finished = true;
     }
 
-    boolean readLine(StringBuilder headers) throws IOException, RatHeaderAnalysisException
{
+    boolean readLine(StringBuilder headers) throws IOException {
         String line = reader.readLine();
         boolean result = line != null;
         if (result) {

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java
Fri Dec  6 09:00:13 2013
@@ -42,6 +42,5 @@ public interface IHeaderMatcher {
 	 *            next line of text, not null
 	 * @return TODO
 	 */
-	boolean match(Document subject, String line)
-			throws RatHeaderAnalysisException;
+	boolean match(Document subject, String line);
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java
Fri Dec  6 09:00:13 2013
@@ -21,7 +21,6 @@ package org.apache.rat.analysis.generati
 import java.util.regex.Pattern;
 
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData;
 
@@ -89,10 +88,8 @@ public class GeneratedLicenseNotRequired
 	 * @param subject
 	 * @param line
 	 * @return
-	 * @throws RatHeaderAnalysisException
 	 */
-	public boolean match(final Document subject, final String line)
-			throws RatHeaderAnalysisException {
+	public boolean match(final Document subject, final String line) {
 		boolean result = false;
 		for (Pattern pat : linePatterns) {
 			if (pat.matcher(line).matches()) {

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java
Fri Dec  6 09:00:13 2013
@@ -19,7 +19,6 @@
 package org.apache.rat.analysis.generation;
 
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData;
 
@@ -34,8 +33,7 @@ public class JavaDocLicenseNotRequired i
 	/**
 	 * 
 	 */
-	public boolean match(final Document subject, final String line)
-			throws RatHeaderAnalysisException {
+	public boolean match(final Document subject, final String line) {
 		boolean result = line.contains(JAVADOC_REGEX_DEFN);
 		if (result) {
 			reportOnLicense(subject);

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/AppliedApacheSoftwareLicense20.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/AppliedApacheSoftwareLicense20.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/AppliedApacheSoftwareLicense20.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/AppliedApacheSoftwareLicense20.java
Fri Dec  6 09:00:13 2013
@@ -18,7 +18,6 @@
  */
 package org.apache.rat.analysis.license;
 
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData;
 
@@ -55,7 +54,7 @@ public class AppliedApacheSoftwareLicens
     }
 
     @Override
-    public boolean match(Document subject, String s) throws RatHeaderAnalysisException {
+    public boolean match(Document subject, String s) {
         boolean result = false;
         if (isCopyrightMatch()) {
             return textMatcher.match(subject, s); // will report the match if it has occurred

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CopyrightHeader.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CopyrightHeader.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CopyrightHeader.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CopyrightHeader.java
Fri Dec  6 09:00:13 2013
@@ -21,7 +21,6 @@ package org.apache.rat.analysis.license;
 import java.util.regex.Pattern;
 
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData.Datum;
 
@@ -89,14 +88,14 @@ public class CopyrightHeader extends Bas
         return copyrightMatch;
     }
 
-    public boolean match(Document subject, String s) throws RatHeaderAnalysisException {
-        if (!copyrightMatch) {
-            if (matchCopyright(s)) {
-                reportOnLicense(subject);
-            }
-        }
-        return copyrightMatch;
-    }
+	public boolean match(Document subject, String s) {
+		if (!copyrightMatch) {
+			if (matchCopyright(s)) {
+				reportOnLicense(subject);
+			}
+		}
+		return copyrightMatch;
+	}
 
     public void reset() {
         copyrightMatch = false;

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/FullTextMatchingLicense.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/FullTextMatchingLicense.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/FullTextMatchingLicense.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/FullTextMatchingLicense.java
Fri Dec  6 09:00:13 2013
@@ -21,7 +21,6 @@ package org.apache.rat.analysis.license;
 import java.util.Locale;
 
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData.Datum;
 
@@ -74,7 +73,7 @@ public class FullTextMatchingLicense ext
         return fullText != null;
     }
 
-    public boolean match(Document subject, String line) throws RatHeaderAnalysisException
{
+    public boolean match(Document subject, String line) {
         final String inputToMatch = prune(line).toLowerCase(Locale.ENGLISH);
         if (seenFirstLine) { // Accumulate more input
             buffer.append(inputToMatch);

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java
Fri Dec  6 09:00:13 2013
@@ -20,7 +20,6 @@ package org.apache.rat.analysis.license;
 
 import java.util.regex.Pattern;
 
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData;
 
@@ -48,7 +47,7 @@ public class OASISLicense extends FullTe
     }
 
     @Override
-    public boolean match(Document subject, String line) throws RatHeaderAnalysisException
{
+    public boolean match(Document subject, String line) {
         boolean result = false;
         if (copyrightMatch) {
             result = super.match(subject, line);

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/SimplePatternBasedLicense.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/SimplePatternBasedLicense.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/SimplePatternBasedLicense.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/SimplePatternBasedLicense.java
Fri Dec  6 09:00:13 2013
@@ -19,7 +19,6 @@
 package org.apache.rat.analysis.license;
 
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData.Datum;
 
@@ -65,7 +64,7 @@ public class SimplePatternBasedLicense e
         // Nothing to do
     }
 
-    public boolean match(Document pSubject, String pLine) throws RatHeaderAnalysisException
{
+    public boolean match(Document pSubject, String pLine) {
         final boolean result = matches(pLine);
         if (result) {
             reportOnLicense(pSubject);

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java
Fri Dec  6 09:00:13 2013
@@ -19,7 +19,6 @@
 package org.apache.rat.analysis.util;
 
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 
 /**
@@ -34,7 +33,7 @@ public final class HeaderMatcherMultiple
         this.matchers = matchers;
     }
 
-    public boolean match(Document subject, String line) throws RatHeaderAnalysisException
{
+    public boolean match(Document subject, String line) {
         boolean result = false;
         for (IHeaderMatcher matcher : matchers) {
             result = matcher.match(subject, line);

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/IDocumentAnalyser.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/IDocumentAnalyser.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/IDocumentAnalyser.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/IDocumentAnalyser.java
Fri Dec  6 09:00:13 2013
@@ -19,9 +19,10 @@
 package org.apache.rat.document;
 
 import org.apache.rat.api.Document;
+import java.io.IOException;
 
 
 public interface IDocumentAnalyser {
 
-    public void analyse(Document document) throws RatDocumentAnalysisException;
+    public void analyse(Document document) throws IOException;
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/util/DocumentAnalyserMultiplexer.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/util/DocumentAnalyserMultiplexer.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/util/DocumentAnalyserMultiplexer.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/document/impl/util/DocumentAnalyserMultiplexer.java
Fri Dec  6 09:00:13 2013
@@ -20,7 +20,7 @@ package org.apache.rat.document.impl.uti
 
 import org.apache.rat.api.Document;
 import org.apache.rat.document.IDocumentAnalyser;
-import org.apache.rat.document.RatDocumentAnalysisException;
+import java.io.IOException;
 
 public class DocumentAnalyserMultiplexer implements IDocumentAnalyser {
 
@@ -31,7 +31,7 @@ public class DocumentAnalyserMultiplexer
         this.analysers = analysers;
     }
 
-    public void analyse(Document document) throws RatDocumentAnalysisException {
+    public void analyse(Document document) throws IOException{
         for (IDocumentAnalyser analyser : analysers) {
             analyser.analyse(document);
         }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java
Fri Dec  6 09:00:13 2013
@@ -22,7 +22,6 @@ import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData;
 import org.apache.rat.api.MetaData.Datum;
 import org.apache.rat.document.IDocumentAnalyser;
-import org.apache.rat.document.RatDocumentAnalysisException;
 import org.apache.rat.license.ILicenseFamily;
 
 import java.util.Arrays;
@@ -81,7 +80,7 @@ public class DefaultPolicy implements ID
         subject.getMetaData().set(datum);
     }
     
-    public void analyse(final Document subject) throws RatDocumentAnalysisException {
+    public void analyse(final Document subject) {
         if (subject != null) {
             final String name = subject.getMetaData().value(MetaData.RAT_URL_LICENSE_FAMILY_NAME);
             if (name != null) {

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/claim/util/ClaimReporterMultiplexer.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/claim/util/ClaimReporterMultiplexer.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/claim/util/ClaimReporterMultiplexer.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/claim/util/ClaimReporterMultiplexer.java
Fri Dec  6 09:00:13 2013
@@ -21,7 +21,6 @@ package org.apache.rat.report.claim.util
 import org.apache.rat.api.Document;
 import org.apache.rat.api.RatException;
 import org.apache.rat.document.IDocumentAnalyser;
-import org.apache.rat.document.RatDocumentAnalysisException;
 import org.apache.rat.report.RatReport;
 
 import java.util.List;
@@ -40,7 +39,7 @@ public class ClaimReporterMultiplexer im
         if (analyser != null) {
             try {
                 analyser.analyse(document);
-            } catch (RatDocumentAnalysisException e) {
+            } catch (Exception e) {
                 throw new RatException(e.getMessage(), e);
             }
         }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java
Fri Dec  6 09:00:13 2013
@@ -44,7 +44,7 @@ public class AnalyserFactoryTest {
         reporter = new SimpleXmlClaimReporter(writer);
         matcherStub = new IHeaderMatcher() {
 
-            public boolean match(Document subject, String line) throws RatHeaderAnalysisException
{
+            public boolean match(Document subject, String line) {
                 return false;
             }
 

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java
Fri Dec  6 09:00:13 2013
@@ -18,47 +18,59 @@
  */
 package org.apache.rat.analysis.generation;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.regex.Pattern;
+
+import org.apache.rat.analysis.IHeaderMatcher;
 import org.apache.rat.api.Document;
 import org.apache.rat.document.MockLocation;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.regex.Pattern;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 /**
- *
+ * The Class GeneratedLicenseNotRequiredTest.
  */
 public class GeneratedLicenseNotRequiredTest {
 
+	/** The license. */
 	private IHeaderMatcher license;
 
+	/**
+	 * Sets the up.
+	 */
 	@Before
 	public void setUp() {
 		Pattern[] patterns = { Pattern.compile(".*Generated") };
 		license = new GeneratedLicenseNotRequired(patterns);
 	}
 
+	/**
+	 * Test match pattern license.
+	 */
 	@Test
-	public void testMatchPatternLicense() throws RatHeaderAnalysisException {
+	public void testMatchPatternLicense() {
 		final Document subject = new MockLocation("subject");
 		assertTrue("Matches regex", license.match(subject, "This is Generated"));
 	}
 
+	/**
+	 * Test match default phrases license.
+	 */
 	@Test
-	public void testMatchDefaultPhrasesLicense() throws RatHeaderAnalysisException {
+	public void testMatchDefaultPhrasesLicense() {
 		license = new GeneratedLicenseNotRequired();
 		final Document subject = new MockLocation("subject");
 		assertTrue("Does not match regex",
 				license.match(subject, "-----Generated by Maven------"));
 	}
 	
+	/**
+	 * Test match non pattern license.
+	 */
 	@Test
-	public void testMatchNonPatternLicense() throws RatHeaderAnalysisException{
+	public void testMatchNonPatternLicense() {
 		final Document subject = new MockLocation("subject");
 		assertFalse("Does not match regex",
 				license.match(subject, "Not at all"));

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java
Fri Dec  6 09:00:13 2013
@@ -18,70 +18,92 @@
  */
 package org.apache.rat.analysis.generation;
 
-import org.apache.rat.api.Document;
-import org.apache.rat.document.MockLocation;
-import org.apache.rat.test.utils.Resources;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.apache.rat.analysis.IHeaderMatcher;
+import org.apache.rat.api.Document;
+import org.apache.rat.document.MockLocation;
+import org.apache.rat.test.utils.Resources;
+import org.junit.Before;
+import org.junit.Test;
+
 
 /**
- *
+ * The Class JavaDocLicenseNotRequiredTest.
  */
 public class JavaDocLicenseNotRequiredTest {
 
-	private IHeaderMatcher license;
+	/** The license. */
+	private static IHeaderMatcher license;
 
+	/**
+	 * Sets the up.
+	 */
 	@Before
 	public void setUp() {
 		license = new JavaDocLicenseNotRequired();
 	}
 
+	/**
+	 * Test match index doc license.
+	 * 
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
 	@Test
-	public void testMatchIndexDocLicense() throws RatHeaderAnalysisException,
-			IOException {
-		boolean result = readAndMatch("index.html");
+	public void testMatchIndexDocLicense() throws IOException {
+		final boolean result = readAndMatch("index.html");
 		assertTrue("Is a javadoc", result);
 	}
 
+	/**
+	 * Test match class doc license.
+	 * 
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
 	@Test
-	public void testMatchClassDocLicense() throws RatHeaderAnalysisException,
-			IOException {
-		boolean result = readAndMatch("ArchiveElement.html");
+	public void testMatchClassDocLicense() throws IOException {
+		final boolean result = readAndMatch("ArchiveElement.html");
 		assertTrue("Is a javadoc", result);
 	}
 
+	/**
+	 * Test match non java doc license.
+	 * 
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
 	@Test
-	public void testMatchNonJavaDocLicense() throws RatHeaderAnalysisException,
-			IOException {
-		boolean result = readAndMatch("notjavadoc.html");
+	public void testMatchNonJavaDocLicense() throws IOException {
+		final boolean result = readAndMatch("notjavadoc.html");
 		assertFalse("Not javadocs and so should return null", result);
 	}
 
 	/**
+	 * Read and match.
 	 * 
 	 * @param name
-	 * @return
+	 *            the name
+	 * @return true, if successful
 	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
 	 */
-	private boolean readAndMatch(final String name)
-			throws RatHeaderAnalysisException, IOException {
-		File file = Resources.getResourceFile("javadocs/" + name);
+	private boolean readAndMatch(final String name) throws IOException {
+		final File file = Resources.getResourceFile("javadocs/" + name);
 		boolean result = false;
-		BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
-		String line = bufferedReader.readLine();
+		final BufferedReader bufferedReader = new BufferedReader(
+				new FileReader(file));
+		String line = String.valueOf(bufferedReader.readLine());
 		final Document subject = new MockLocation("subject");
-		while (line != null && !result) {
-			result = license.match(subject, line);
+		while (bufferedReader.readLine() != null && !result) {
+			result = ((JavaDocLicenseNotRequired) license).match(subject, line);
 			line = bufferedReader.readLine();
 		}
 		bufferedReader.close();

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/document/MockDocumentAnalyser.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/document/MockDocumentAnalyser.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/document/MockDocumentAnalyser.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/document/MockDocumentAnalyser.java
Fri Dec  6 09:00:13 2013
@@ -27,7 +27,7 @@ public class MockDocumentAnalyser implem
 
     public List<Document> matches = new ArrayList<Document>();
     
-    public void analyse(Document document) throws RatDocumentAnalysisException {
+    public void analyse(Document document) {
         matches.add(document);
     }
 

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
Fri Dec  6 09:00:13 2013
@@ -20,7 +20,6 @@ package org.apache.rat.report.xml;
 
 import org.apache.rat.analysis.DefaultAnalyserFactory;
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.api.Document;
 import org.apache.rat.document.IDocumentAnalyser;
 import org.apache.rat.report.AbstractReport;
@@ -57,7 +56,7 @@ public class XmlReportTest {
         final SimpleXmlClaimReporter reporter = new SimpleXmlClaimReporter(writer);
         final IHeaderMatcher matcher = new IHeaderMatcher() {
 
-            public boolean match(Document subject, String line) throws RatHeaderAnalysisException
{
+            public boolean match(Document subject, String line) {
                 return false;
             }
 

Modified: creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/FullTextLicenseMatcher.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/FullTextLicenseMatcher.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/FullTextLicenseMatcher.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/FullTextLicenseMatcher.java
Fri Dec  6 09:00:13 2013
@@ -18,7 +18,6 @@
  */ 
 package org.apache.rat.anttasks;
 
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.analysis.license.FullTextMatchingLicense;
 import org.apache.rat.api.Document;
 import org.apache.tools.ant.BuildException;
@@ -46,7 +45,7 @@ public class FullTextLicenseMatcher exte
     }
 
     @Override
-    public boolean match(Document subject, String line) throws RatHeaderAnalysisException
{
+    public boolean match(Document subject, String line) {
         validate();
         return super.match(subject, line);
     }

Modified: creadur/rat/branches/gsoc/apache-rat-tasks/src/test/java/org/example/Matcher.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-tasks/src/test/java/org/example/Matcher.java?rev=1548438&r1=1548437&r2=1548438&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-tasks/src/test/java/org/example/Matcher.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-tasks/src/test/java/org/example/Matcher.java Fri
Dec  6 09:00:13 2013
@@ -17,7 +17,6 @@
 package org.example;
 
 import org.apache.rat.analysis.IHeaderMatcher;
-import org.apache.rat.analysis.RatHeaderAnalysisException;
 import org.apache.rat.analysis.license.BaseLicense;
 import org.apache.rat.api.Document;
 import org.apache.rat.api.MetaData;
@@ -30,7 +29,7 @@ public class Matcher extends BaseLicense
     }
     public void reset() {}
     
-    public boolean match(Document subject, String line) throws RatHeaderAnalysisException
{
+    public boolean match(Document subject, String line) {
         reportOnLicense(subject);
         return true;
     }



Mime
View raw message