From 38e23673326534adfd5071acad426c8328906c4f Mon Sep 17 00:00:00 2001 From: Peter Streef Date: Mon, 22 Apr 2024 17:24:13 +0200 Subject: [PATCH] Use count method --- src/main/java/org/openrewrite/LanguageComposition.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/org/openrewrite/LanguageComposition.java b/src/main/java/org/openrewrite/LanguageComposition.java index 305a370..2c5b585 100644 --- a/src/main/java/org/openrewrite/LanguageComposition.java +++ b/src/main/java/org/openrewrite/LanguageComposition.java @@ -109,7 +109,7 @@ public TreeVisitor 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<>()) @@ -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 { private int count;