creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1549475 - in /creadur/rat/branches/gsoc: apache-rat-core/src/main/java/org/apache/rat/ apache-rat-core/src/test/java/org/apache/rat/ apache-rat-plugin/src/main/java/org/apache/rat/mp/ apache-rat-tasks/src/main/java/org/apache/rat/anttasks/...
Date Mon, 09 Dec 2013 06:11:07 GMT
Author: rdonkin
Date: Mon Dec  9 06:11:07 2013
New Revision: 1549475

URL: http://svn.apache.org/r1549475
Log:
Delete static context of Defaults.

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Defaults.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Report.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
    creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java
    creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
    creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
    creadur/rat/branches/gsoc/apache-rat-tasks/src/test/resources/antunit/report-normal-operation.xml

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Defaults.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Defaults.java?rev=1549475&r1=1549474&r2=1549475&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Defaults.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Defaults.java Mon
Dec  9 06:11:07 2013
@@ -42,12 +42,6 @@ import org.apache.rat.analysis.util.Head
 public class Defaults {
 
 	/**
-	 * no instances.
-	 */
-	private Defaults() {
-	}
-
-	/**
 	 * The standard list of licenses to include in the reports.
 	 */
 	public static final IHeaderMatcher[] DEFAULT_MATCHERS = new IHeaderMatcher[] {
@@ -62,11 +56,18 @@ public class Defaults {
 	public static final String PLAIN_STYLESHEET = "org/apache/rat/plain-rat.xsl";
 
 	/**
+	 * no instances.
+	 */
+	public Defaults() {
+		super();
+	}
+
+	/**
 	 * Gets the plain style sheet.
 	 * 
 	 * @return the plain style sheet
 	 */
-	public static InputStream getPlainStyleSheet() {
+	public InputStream getPlainStyleSheet() {
 		InputStream result = Defaults.class.getClassLoader()
 				.getResourceAsStream(Defaults.PLAIN_STYLESHEET);
 		return result;
@@ -77,9 +78,8 @@ public class Defaults {
 	 * 
 	 * @return the default style sheet
 	 */
-	public static InputStream getDefaultStyleSheet() {
-		InputStream result = getPlainStyleSheet();
-		return result;
+	public InputStream getDefaultStyleSheet() {
+		return getPlainStyleSheet();
 	}
 
 	/**
@@ -87,7 +87,7 @@ public class Defaults {
 	 * 
 	 * @return the i header matcher
 	 */
-	public static IHeaderMatcher createDefaultMatcher() {
+	public IHeaderMatcher createDefaultMatcher() {
 		return new HeaderMatcherMultiplexer(Defaults.DEFAULT_MATCHERS);
 	}
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Report.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Report.java?rev=1549475&r1=1549474&r2=1549475&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Report.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/Report.java Mon
Dec  9 06:11:07 2013
@@ -64,7 +64,7 @@ public class Report {
     //@SuppressWarnings("unchecked")
     public static final void main(String args[]) throws Exception {
         final ReportConfiguration configuration = new ReportConfiguration();
-        configuration.setHeaderMatcher(Defaults.createDefaultMatcher());
+        configuration.setHeaderMatcher(new Defaults().createDefaultMatcher());
         Options opts = buildOptions();
 
         PosixParser parser = new PosixParser();
@@ -273,7 +273,7 @@ public class Report {
     @Deprecated
     public ClaimStatistic report(PrintStream out) throws Exception {
         final ReportConfiguration configuration = new ReportConfiguration();
-        configuration.setHeaderMatcher(Defaults.createDefaultMatcher());
+        configuration.setHeaderMatcher(new Defaults().createDefaultMatcher());
         return report(out, configuration);
     }
 
@@ -324,7 +324,7 @@ public class Report {
     @Deprecated
     public void styleReport(PrintStream out) throws Exception {
         final ReportConfiguration configuration = new ReportConfiguration();
-        configuration.setHeaderMatcher(Defaults.createDefaultMatcher());
+        configuration.setHeaderMatcher(new Defaults().createDefaultMatcher());
         styleReport(out, configuration);
     }
 
@@ -342,7 +342,7 @@ public class Report {
         throws Exception {
         final IReportable base = getDirectory(out);
         if (base != null) {
-            InputStream style = Defaults.getDefaultStyleSheet();
+            InputStream style = new Defaults().getDefaultStyleSheet();
             report(out, base, style, configuration);
         }
     }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java?rev=1549475&r1=1549474&r2=1549475&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
Mon Dec  9 06:11:07 2013
@@ -159,7 +159,7 @@ public class ReportTest {
 		final ReportConfiguration configuration = new ReportConfiguration();
 		configuration.setHeaderMatcher(matcherMultiplexer);
 		Report.report(out, new DirectoryWalker(new File(elementsPath)),
-				Defaults.getPlainStyleSheet(), configuration);
+				new Defaults().getPlainStyleSheet(), configuration);
 		String result = out.getBuffer().toString();
 		final String lineSeparator = System.getProperty("line.separator");
 		assertTrue("'Generated at' is present in " + result,

Modified: creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java?rev=1549475&r1=1549474&r2=1549475&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java
Mon Dec  9 06:11:07 2013
@@ -132,7 +132,7 @@ public class RatCheckMojo extends Abstra
     private InputStream getStyleSheet() throws MojoExecutionException {
         if ( reportStyle == null || reportStyle.equals( "plain" ) )
         {
-            return Defaults.getPlainStyleSheet();
+            return new Defaults().getPlainStyleSheet();
         }
         else if ( reportStyle.equals( "xml" ) )
         {

Modified: creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java?rev=1549475&r1=1549474&r2=1549475&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
Mon Dec  9 06:11:07 2013
@@ -145,7 +145,7 @@ public class RatReportMojo extends Abstr
         try
         {
             pw = new PrintWriter( sw );
-            createReport( new PrintWriter( sw ), Defaults.getDefaultStyleSheet() );
+            createReport( new PrintWriter( sw ), new Defaults().getDefaultStyleSheet() );
             final String result = sw.toString();
             pw.close();
             pw = null;

Modified: creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java?rev=1549475&r1=1549474&r2=1549475&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
Mon Dec  9 06:11:07 2013
@@ -260,7 +260,7 @@ public class Report extends Task {
             InputStream style = null;
             try {
                 if (format.getValue().equals(Format.PLAIN_KEY)) {
-                    style = Defaults.getPlainStyleSheet();
+                    style = new Defaults().getPlainStyleSheet();
                 } else if (format.getValue().equals(Format.STYLED_KEY)) {
                     style = stylesheet.getInputStream();
                 } else {

Modified: creadur/rat/branches/gsoc/apache-rat-tasks/src/test/resources/antunit/report-normal-operation.xml
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-tasks/src/test/resources/antunit/report-normal-operation.xml?rev=1549475&r1=1549474&r2=1549475&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-tasks/src/test/resources/antunit/report-normal-operation.xml
(original)
+++ creadur/rat/branches/gsoc/apache-rat-tasks/src/test/resources/antunit/report-normal-operation.xml
Mon Dec  9 06:11:07 2013
@@ -307,9 +307,6 @@ import org.apache.rat.analysis.IHeaderMa
 import org.apache.rat.analysis.license.BaseLicense;
 public class Matcher extends BaseLicense implements IHeaderMatcher {
     public Matcher() {
-        //super(new MetaData.Datum(MetaData.RAT_URL_LICENSE_FAMILY_CATEGORY, "EXMPL"),
-        //     new MetaData.Datum(MetaData.RAT_URL_LICENSE_FAMILY_NAME, "Example License"),
-         //     "");
     	super();
     }
     public void reset() {}



Mime
View raw message