Skip to content

Commit 3522863

Browse files
committed
More corrections in documentation.
1 parent 1e1757c commit 3522863

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

api/maven-api-core/src/main/java/org/apache/maven/api/SourceRoot.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ default Path directory() {
5555
* <p>
5656
* The default implementation returns an empty list, which means to apply a language-dependent pattern.
5757
* For example, for the Java language, the pattern includes all files with the {@code .java} suffix.
58+
*
59+
* @see java.nio.file.FileSystem#getPathMatcher(String)
5860
*/
5961
default List<String> includes() {
6062
return List.of();

impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultSourceRoot.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ public DefaultSourceRoot(final ProjectScope scope, final Language language, fina
153153
* @param scope scope of source code (main or test)
154154
* @param language language of the source code
155155
* @param directory directory of the source code
156-
* @param includes list of patterns for the files to include, or {@code null} if unspecified
157-
* @param excludes list of patterns for the files to exclude, or {@code null} if nothing to exclude
156+
* @param includes patterns for the files to include, or {@code null} or empty if unspecified
157+
* @param excludes patterns for the files to exclude, or {@code null} or empty if nothing to exclude
158158
*/
159159
public DefaultSourceRoot(
160160
final ProjectScope scope,
@@ -196,7 +196,7 @@ public Path directory() {
196196
}
197197

198198
/**
199-
* {@return the list of patterns for the files to include}.
199+
* {@return the patterns for the files to include}.
200200
*/
201201
@Override
202202
@SuppressWarnings("ReturnOfCollectionOrArrayField") // Safe because unmodifiable
@@ -205,7 +205,7 @@ public List<String> includes() {
205205
}
206206

207207
/**
208-
* {@return the list of patterns for the files to exclude}.
208+
* {@return the patterns for the files to exclude}.
209209
*/
210210
@Override
211211
@SuppressWarnings("ReturnOfCollectionOrArrayField") // Safe because unmodifiable

impl/maven-impl/src/main/java/org/apache/maven/impl/PathSelector.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
import 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,
@@ -51,10 +51,12 @@
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
*/
5961
public 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() {

impl/maven-impl/src/test/java/org/apache/maven/impl/PathSelectorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232

3333
public class PathSelectorTest {
3434
/**
35-
* The temporary directory where are the files to test.
35+
* The temporary directory containing the files to test.
3636
*/
3737
private Path directory;
3838

3939
/**
40-
* The filtered set of paths. creates by {@link #filter()}.
40+
* The filtered set of paths. Created by {@link #filter()}.
4141
*/
4242
private Set<Path> filtered;
4343

@@ -84,7 +84,7 @@ private void filter(final String syntax) throws IOException {
8484
/**
8585
* Asserts that the filtered set of paths contains the given item.
8686
* If present, the path is removed from the collection of filtered files.
87-
* It allows caller to verify that there is no unexpected elements remaining
87+
* It allows caller to verify that there are no unexpected elements remaining
8888
* after all expected elements have been removed.
8989
*
9090
* @param path the path to test

0 commit comments

Comments
 (0)