Skip to content

Commit

Permalink
Merge branch 'RAT-98_fix_merge_issue' into 98_update
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudenw committed Feb 3, 2025
2 parents b358eee + 7d9e739 commit cc5724b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,16 @@ public static DocumentNameMatcher matcherSet(final DocumentNameMatcher includes,
return MATCHES_ALL;
}
List<DocumentNameMatcher> workingSet = Arrays.asList(includes, excludes);
return new DocumentNameMatcher(format("matcherSet(%s)", join(workingSet)), new MatcherPredicate(workingSet));
return new DocumentNameMatcher(format("matcherSet(%s)", join(workingSet)),
new CollectionPredicateImpl(workingSet) {
@Override
public boolean test(DocumentName documentName) {
if (includes.matches(documentName)) {
return true;
}
return !excludes.matches(documentName);
}
});
}

/**
Expand Down Expand Up @@ -465,27 +474,6 @@ public boolean test(final DocumentName documentName) {
}
}

/**
* An implementation of "or" logic across a collection of DocumentNameMatchers.
*/
// package private for testing access
static class MatcherPredicate extends CollectionPredicateImpl {
MatcherPredicate(final Iterable<DocumentNameMatcher> matchers) {
super(matchers);
}

@Override
public boolean test(final DocumentName documentName) {
Iterator<DocumentNameMatcher> iter = getMatchers().iterator();
// included
if (iter.next().matches(documentName)) {
return true;
}
// excluded
return !iter.next().matches(documentName);
}
}

/**
* Data from a {@link DocumentNameMatcher#decompose(DocumentName)} call.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ The <action> type attribute can be one of:
<action issue="RAT-471" type="add" dev="pottlinger" due-to="clayjohnson">
Integrate Creadur RAT into the updated develocity.apache.org instance.
</action>
<action issue="RAT-379" type="fix" dev="jochenw" due-to="pottlinger">
Fix 'Path must include project or resource name: /' error after importing RAT into Eclipse IDE by changing the way resources are copied around submodules.
</action>
<action issue="RAT-469" type="add" dev="claudenw" due-to="pottlinger">
Verify that projects that configure valid other licenses than the defaults, report correctly as well.
</action>
Expand Down

0 comments on commit cc5724b

Please sign in to comment.