ottlinger commented on code in PR #249:
URL: https://github.com/apache/creadur-rat/pull/249#discussion_r1599790761
##########
apache-rat-core/src/main/java/org/apache/rat/analysis/matchers/SPDXMatcherFactory.java:
##########
@@ -103,16 +108,17 @@ private boolean check(String line, Match caller) {
// if so then see if that name has been registered. If so then we have
a match
// and set
// lastMatch.
- if ((lastLine == null || !lastLine.equals(line)) &&
line.contains("SPDX-License-Identifier")) {
- Matcher matcher = groupSelector.matcher(line);
- if (matcher.find()) {
- lastMatch = matchers.get(matcher.group(1));
- } else {
- lastMatch = null;
+ if (!checked) {
+ checked = true;
+ if (line.contains("SPDX-License-Identifier")) {
Review Comment:
Should we extract this as a constant as it is used in line 62 as well, when
defining the pattern?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]