Skip to content

Commit

Permalink
Use count method
Browse files Browse the repository at this point in the history
  • Loading branch information
pstreef committed Apr 22, 2024
1 parent 9e6751b commit 38e2367
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/org/openrewrite/LanguageComposition.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public TreeVisitor<?, ExecutionContext> getScanner(Accumulator acc) {
0,
hasParseFailure));
} else {
int genericLineCount = genericLineCount(s);
int genericLineCount = LineCounter.count(s);
if (s.getClass().getName().startsWith("org.openrewrite.cobol.tree.CobolPreprocessor$Copybook")) {
Counts copybookCounts = acc.getFolderToLanguageToCounts()
.computeIfAbsent(folderPath, k -> new HashMap<>())
Expand Down Expand Up @@ -361,12 +361,6 @@ private static class Counts {
int fileCount;
}

private static int genericLineCount(SourceFile s) {
LineCounter counter = new LineCounter();
s.printAll(counter);
return counter.getLineCount();
}

private static class LineCounter extends PrintOutputCapture<Integer> {
private int count;

Expand Down

0 comments on commit 38e2367

Please sign in to comment.