Skip to content

Commit 1e1757c

Browse files
committed
Add documentation.
1 parent 10d7d79 commit 1e1757c

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ default List<String> excludes() {
7474
* The matcher is absent if the includes/excludes lists are empty
7575
* and {@code useDefaultExcludes} is {@code false}.
7676
*
77-
* @param useDefaultExcludes whether to add the default set of patterns to exclude
78-
* (mostly <abbr>SCM</abbr> files)
77+
* @param useDefaultExcludes whether to add the default set of patterns to exclude,
78+
* mostly Source Code Management (<abbr>SCM</abbr>) files
7979
*/
8080
Optional<PathMatcher> matcher(boolean useDefaultExcludes);
8181

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ public final class DefaultSourceRoot implements SourceRoot {
4242

4343
private final List<String> excludes;
4444

45-
private transient PathMatcher matcher, matcherWithDefaults;
45+
/**
46+
* Matcher combining the includes and excludes.
47+
* Computed when first requested, then cached.
48+
*/
49+
private transient PathMatcher matcher;
50+
51+
/**
52+
* Matcher combining the includes, excludes, and default excludes.
53+
* Computed when first requested, then cached.
54+
*/
55+
private transient PathMatcher matcherWithDefaults;
4656

4757
private final ProjectScope scope;
4858

@@ -144,7 +154,7 @@ public DefaultSourceRoot(final ProjectScope scope, final Language language, fina
144154
* @param language language of the source code
145155
* @param directory directory of the source code
146156
* @param includes list of patterns for the files to include, or {@code null} if unspecified
147-
* @param excludes list of patterns for the files to exclude, or {@code null} if unspecified
157+
* @param excludes list of patterns for the files to exclude, or {@code null} if nothing to exclude
148158
*/
149159
public DefaultSourceRoot(
150160
final ProjectScope scope,
@@ -206,7 +216,8 @@ public List<String> excludes() {
206216
/**
207217
* {@return a matcher combining the include and exclude patterns}.
208218
*
209-
* @param useDefaultExcludes whether to add <abbr>SCM</abbr> files to set of exclude patterns
219+
* @param useDefaultExcludes whether to add the default set of patterns to exclude,
220+
* mostly Source Code Management (<abbr>SCM</abbr>) files
210221
*/
211222
@Override
212223
public Optional<PathMatcher> matcher(boolean useDefaultExcludes) {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ private void filter(final String syntax) throws IOException {
8383

8484
/**
8585
* Asserts that the filtered set of paths contains the given item.
86+
* 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
88+
* after all expected elements have been removed.
8689
*
8790
* @param path the path to test
8891
*/

0 commit comments

Comments
 (0)