creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1549303 - /creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/walker/Walker.java
Date Sun, 08 Dec 2013 21:32:36 GMT
Author: rdonkin
Date: Sun Dec  8 21:32:35 2013
New Revision: 1549303

URL: http://svn.apache.org/r1549303
Log:
Apply PMD change.

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/walker/Walker.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/walker/Walker.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/walker/Walker.java?rev=1549303&r1=1549302&r2=1549303&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/walker/Walker.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/walker/Walker.java
Sun Dec  8 21:32:35 2013
@@ -48,12 +48,12 @@ public abstract class Walker implements 
 	 */
 	protected static FilenameFilter regexFilter(final Pattern pattern) {
 		return new FilenameFilter() {
-			public boolean accept(File dir, String name) {
-				final boolean result;
+			public boolean accept(final File dir, final String name) {
+				boolean result = false;
 				if (pattern == null) {
 					result = true;
 				} else {
-					result = !pattern.matcher(name).matches();
+					result ^= pattern.matcher(name).matches();
 				}
 				return result;
 			}
@@ -67,10 +67,9 @@ public abstract class Walker implements 
 	 *            the file
 	 * @return true, if is restricted
 	 */
-	protected boolean isRestricted(File file) {
+	protected boolean isRestricted(final File file) {
 		String name = file.getName();
-		boolean result = name.startsWith(".");
-		return result;
+		return name.charAt(0) == '.';
 	}
 
 	/**
@@ -85,7 +84,7 @@ public abstract class Walker implements 
 		if (filter != null) {
 			final String name = file.getName();
 			final File dir = file.getParentFile();
-			result = !filter.accept(dir, name);
+			result ^= filter.accept(dir, name);
 		}
 		return result;
 	}
@@ -98,7 +97,7 @@ public abstract class Walker implements 
 	 * @param filter
 	 *            the filter
 	 */
-	public Walker(File file, final FilenameFilter filter) {
+	public Walker(final File file, final FilenameFilter filter) {
 		this(file.getPath(), file, filter);
 	}
 



Mime
View raw message