Move lambda to method.
@@ -158,7 +158,12 @@ public class RfLintParser extends IssueParser {
public Report parse(final ReaderFactory readerFactory) {
try (Stream<String> lines = readerFactory.readStream(); IssueBuilder builder = new IssueBuilder()) {
Report warnings = new Report();
- lines.forEach(line -> {
+ lines.forEach(line -> parseLine(builder, warnings, line));
+ return warnings;
+ }
+ }
+
+ private void parseLine(final IssueBuilder builder, final Report warnings, final String line) {
Matcher fileMatcher = FILE_PATTERN.matcher(line);
if (fileMatcher.find()) {
fileName = fileMatcher.group(1);
@@ -170,9 +175,6 @@ public class RfLintParser extends IssueParser {
if (Thread.interrupted()) {
throw new ParsingCanceledException();
}
- });
- return warnings;
- }
}
private Issue createIssue(final Matcher matcher, final IssueBuilder builder) {
