Fix PMD warnings.
git-svn-id: https://svn.apache.org/repos/asf/creadur/rat/trunk@1680390 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CDDL1License.java b/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CDDL1License.java
index 76d537e..d731ef5 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CDDL1License.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/analysis/license/CDDL1License.java
@@ -29,14 +29,14 @@
public class CDDL1License extends BaseLicense implements IHeaderMatcher {
public static final String CDDL1_LICENSE_DEFN
- = "The contents of this file are subject to the terms of the Common Development\n"
- + "and Distribution License(\"CDDL\") (the \"License\"). You may not use this file\n"
- + "except in compliance with the License.\n\n";
+ = "The contents of this file are subject to the terms of the Common Development\n"
+ + "and Distribution License(\"CDDL\") (the \"License\"). You may not use this file\n"
+ + "except in compliance with the License.\n\n";
public static final String CDDL1_LICENSE_DEFN_ILLUMOS_STYLE
- = "The contents of this file are subject to the terms of the\n"
- + "Common Development and Distribution License (the \"License\")\n"
- + "You may not use this file except in compliance with the License.\n";
+ = "The contents of this file are subject to the terms of the\n"
+ + "Common Development and Distribution License (the \"License\")\n"
+ + "You may not use this file except in compliance with the License.\n";
private final FullTextMatchingLicense textMatcherBase;
private final FullTextMatchingLicense textMatcherIllumosStyle;
@@ -44,19 +44,19 @@
public CDDL1License() {
super(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_CDLL1,
- MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_CDDL1,
- "");
+ MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_CDDL1,
+ "");
textMatcherBase = new FullTextMatchingLicense(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_CDLL1,
- MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_CDDL1,
- "", CDDL1_LICENSE_DEFN);
+ MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_CDDL1,
+ "", CDDL1_LICENSE_DEFN);
textMatcherIllumosStyle = new FullTextMatchingLicense(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_CDLL1,
- MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_CDDL1,
- "", CDDL1_LICENSE_DEFN_ILLUMOS_STYLE);
+ MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_CDDL1,
+ "", CDDL1_LICENSE_DEFN_ILLUMOS_STYLE);
}
public boolean match(Document subject, String s) throws RatHeaderAnalysisException {
- return (textMatcherBase.match(subject, s) ||
- textMatcherIllumosStyle.match(subject, s));
+ return textMatcherBase.match(subject, s) ||
+ textMatcherIllumosStyle.match(subject, s);
}
public void reset() {
diff --git a/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java b/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java
index 8d9f3d4..71bf11f 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/policy/DefaultPolicy.java
@@ -70,7 +70,7 @@
if (subject != null) {
final String name = subject.getMetaData().value(MetaData.RAT_URL_LICENSE_FAMILY_NAME);
if (name != null) {
- final boolean isApproved = (Collections.binarySearch(approvedLicenseNames, name) >= 0);
+ final boolean isApproved = Collections.binarySearch(approvedLicenseNames, name) >= 0;
reportLicenseApprovalClaim(subject, isApproved);
}
}
diff --git a/apache-rat-core/src/main/java/org/apache/rat/walker/DirectoryWalker.java b/apache-rat-core/src/main/java/org/apache/rat/walker/DirectoryWalker.java
index 84c7b32..7b58387 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/walker/DirectoryWalker.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/walker/DirectoryWalker.java
@@ -43,14 +43,15 @@
/**
* Constructs a walker.
- * @param file not null
- * @param filter filters input files (optional),
- * or null when no filtering should be performed
+ *
+ * @param file not null
+ * @param filter filters input files (optional),
+ * or null when no filtering should be performed
*/
public DirectoryWalker(File file, final FilenameFilter filter) {
super(file.getPath(), file, filter);
}
-
+
public DirectoryWalker(File file, final Pattern ignoreNameRegex) {
super(file.getPath(), file, regexFilter(ignoreNameRegex));
}
@@ -58,26 +59,25 @@
public boolean isRestricted() {
return false;
}
-
+
/**
* Process a directory, restricted directories will be ignored.
*
* @param report The report to process the directory with
- * @param file the directory to process
+ * @param file the directory to process
* @throws RatException
*/
- private void processDirectory(RatReport report, final File file) throws RatException {
+ private void processDirectory(RatReport report, final File file) throws RatException {
if (!isRestricted(file)) {
process(report, file);
}
}
-
+
/**
* Run a report over all files and directories in this DirectoryWalker,
* ignoring any files/directories set to be ignored.
- *
+ *
* @param report the defined RatReport to run on this Directory walker.
- *
*/
public void run(final RatReport report) throws RatException {
process(report, file);
@@ -85,9 +85,9 @@
/**
* Process a directory, ignoring any files/directories set to be ignored.
- *
+ *
* @param report the report to use in processing
- * @param file the run the report against
+ * @param file the run the report against
* @throws RatException
*/
private void process(final RatReport report, final File file) throws RatException {
@@ -102,43 +102,40 @@
/**
* Process all directories in a set of file objects, ignoring any directories set to be ignored.
- *
+ *
* @param report the report to use in processing
- * @param files the files to process (only directories will be processed)
+ * @param files the files to process (only directories will be processed)
* @throws RatException
*/
private void processDirectories(final RatReport report, final File[] files) throws RatException {
for (final File file : files) {
- if (!ignored(file)) {
- if (file.isDirectory()) {
- processDirectory(report, file);
- }
- }
- }
- }
-
- /**
- * Process all files in a set of file objects, ignoring any files set to be ignored.
- *
- * @param report the report to use in processing
- * @param files the files to process (only files will be processed)
- * @throws RatException
- */
- private void processNonDirectories(final RatReport report, final File[] files) throws RatException {
- for (final File file : files) {
- if (!ignored(file)) {
- if (!file.isDirectory()) {
- report(report, file);
- }
+ if (!ignored(file) && file.isDirectory()) {
+ processDirectory(report, file);
}
}
}
/**
+ * Process all files in a set of file objects, ignoring any files set to be ignored.
+ *
+ * @param report the report to use in processing
+ * @param files the files to process (only files will be processed)
+ * @throws RatException
+ */
+ private void processNonDirectories(final RatReport report, final File[] files) throws RatException {
+ for (final File file : files) {
+ if (!ignored(file) && !file.isDirectory()) {
+ report(report, file);
+ }
+ }
+
+ }
+
+ /**
* Report on the given file.
- *
+ *
* @param report the report to process the file with
- * @param file the file to be reported on
+ * @param file the file to be reported on
* @throws RatException
*/
private void report(final RatReport report, File file) throws RatException {