Author: rdonkin
Date: Fri Dec 6 17:47:35 2013
New Revision: 1548613
URL: http://svn.apache.org/r1548613
Log:
Apply PMD Rules.
Modified:
creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CopyrightHeader.java
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=1548613&r1=1548612&r2=1548613&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 17:47:35 2013
@@ -60,7 +60,7 @@ public class CopyrightHeader extends Bas
private String copyrightOwner;
/** The copyright match. */
- private boolean copyrightMatch = false;
+ private boolean copyrightMatch;
/**
* Instantiates a new copyright header.
@@ -69,8 +69,8 @@ public class CopyrightHeader extends Bas
* @param licenseFamilyName the license family name
* @param notes the notes
*/
- protected CopyrightHeader(Datum licenseFamilyCategory,
- Datum licenseFamilyName, String notes) {
+ protected CopyrightHeader(final Datum licenseFamilyCategory,
+ final Datum licenseFamilyName, final String notes) {
super(licenseFamilyCategory, licenseFamilyName, notes);
}
@@ -82,8 +82,8 @@ public class CopyrightHeader extends Bas
* @param notes the notes
* @param copyrightOwner the copyright owner
*/
- protected CopyrightHeader(Datum licenseFamilyCategory,
- Datum licenseFamilyName, String notes, String
copyrightOwner) {
+ protected CopyrightHeader(final Datum licenseFamilyCategory,
+ final Datum licenseFamilyName, final String notes,
final String copyrightOwner) {
this(licenseFamilyCategory, licenseFamilyName, notes);
setCopyrightOwner(copyrightOwner);
}
@@ -94,7 +94,7 @@ public class CopyrightHeader extends Bas
*
* @param copyrightOwner the new copyright owner
*/
- public final void setCopyrightOwner(String copyrightOwner) {
+ public final void setCopyrightOwner(final String copyrightOwner) {
this.copyrightOwner = copyrightOwner;
this.copyrightPattern =
Pattern.compile(COPYRIGHT_PREFIX_PATTERN_DEFN
+ copyrightOwner + ".*",
Pattern.CASE_INSENSITIVE);
@@ -133,9 +133,9 @@ public class CopyrightHeader extends Bas
* @param s the s
* @return true, if successful
*/
- protected boolean matchCopyright(String s) {
+ protected boolean matchCopyright(final String text) {
if (!copyrightMatch) {
- copyrightMatch = copyrightPattern.matcher(s).matches();
+ copyrightMatch =
copyrightPattern.matcher(text).matches();
}
return copyrightMatch;
}
@@ -143,11 +143,9 @@ public class CopyrightHeader extends Bas
/* (non-Javadoc)
* @see
org.apache.rat.analysis.IHeaderMatcher#match(org.apache.rat.api.Document,
java.lang.String)
*/
- public boolean match(Document subject, String s) {
- if (!copyrightMatch) {
- if (matchCopyright(s)) {
- reportOnLicense(subject);
- }
+ public boolean match(final Document subject, final String text) {
+ if (!copyrightMatch && matchCopyright(text)) {
+ reportOnLicense(subject);
}
return copyrightMatch;
}