3030import java .util .Set ;
3131
3232/**
33- * Determines whether a path is selected according include/exclude patterns.
33+ * Determines whether a path is selected according to include/exclude patterns.
3434 * The pathnames used for method parameters will be relative to some base directory
35- * and use {@code '/'} as separator, regardless the hosting operating system.
35+ * and use {@code '/'} as separator, regardless of the hosting operating system.
3636 *
3737 * <h4>Syntax</h4>
3838 * If a pattern contains the {@code ':'} character and the prefix before is longer than 1 character,
5151 * </ul>
5252 *
5353 * If above changes are not desired, put an explicit {@code "glob:"} prefix before the patterns.
54- * Note that putting such prefix is recommended anyway for better performances.
54+ * Note that putting such a prefix is recommended anyway for better performances.
5555 *
5656 * @author Benjamin Bentmann
5757 * @author Martin Desruisseaux
58+ *
59+ * @see java.nio.file.FileSystem#getPathMatcher(String)
5860 */
5961public class PathSelector implements PathMatcher {
6062 /**
@@ -224,7 +226,7 @@ private static Collection<String> addDefaultExcludes(Collection<String> excludes
224226
225227 /**
226228 * Whether the given pattern does not specify a syntax, in which case Maven syntax should be used.
227- * If the prefix has a length of 1, then it is assumed to be a Window drive letter rather than a syntax.
229+ * If the prefix has a length of 1, then it is assumed to be a Windows drive letter rather than a syntax.
228230 *
229231 * @param pattern the pattern to test
230232 * @return whether the patter does not specify a syntax
@@ -387,7 +389,7 @@ private static PathMatcher[] matchers(final FileSystem fs, final String[] patter
387389 */
388390 @ SuppressWarnings ("checkstyle:MissingSwitchDefault" )
389391 public Optional <PathMatcher > simplify () {
390- if (( excludes .length | dirIncludes .length | dirExcludes .length ) == 0 ) {
392+ if (excludes .length == 0 && dirIncludes .length == 0 && dirExcludes .length == 0 ) {
391393 switch (includes .length ) {
392394 case 0 :
393395 return Optional .empty ();
@@ -413,7 +415,7 @@ public boolean matches(Path path) {
413415 }
414416
415417 /**
416- * {@return whether the given file matches according one of the given matchers}.
418+ * {@return whether the given file matches according to one of the given matchers}.
417419 */
418420 private static boolean isMatched (Path path , PathMatcher [] matchers ) {
419421 for (PathMatcher matcher : matchers ) {
@@ -444,7 +446,7 @@ public boolean couldHoldSelected(Path directory) {
444446 * Appends the elements of the given array in the given buffer.
445447 * This is a helper method for {@link #toString()} implementations.
446448 *
447- * @param buffer the buffer where to add the elements
449+ * @param buffer the buffer to add the elements to
448450 * @param label label identifying the array of elements to add
449451 * @param patterns the elements to append, or {@code null} if none
450452 */
@@ -463,7 +465,6 @@ private static void append(StringBuilder buffer, String label, String[] patterns
463465
464466 /**
465467 * {@return a string representation for logging purposes}.
466- * This string representation is reported logged when {@link Cleaner} is executed.
467468 */
468469 @ Override
469470 public String toString () {
0 commit comments