|
167 | 167 | public class AutoBuild { |
168 | 168 | private final ExtractorOutputConfig outputConfig; |
169 | 169 | private final ITrapCache trapCache; |
170 | | - private Set<Path> includes = new LinkedHashSet<>(); |
171 | | - private Set<Path> excludes = new LinkedHashSet<>(); |
| 170 | + private final Set<Path> includes = new LinkedHashSet<>(); |
| 171 | + private final Set<Path> excludes = new LinkedHashSet<>(); |
172 | 172 | private ProjectLayout filters; |
173 | 173 | private final Path LGTM_SRC, SEMMLE_DIST; |
174 | 174 | private final TypeScriptMode typeScriptMode; |
175 | 175 | private final String defaultEncoding; |
176 | 176 | private ExtractorState extractorState; |
177 | | - private long timedLogMessageStart = 0; |
178 | 177 |
|
179 | 178 | public AutoBuild() { |
180 | 179 | this.LGTM_SRC = toRealPath(getPathFromEnvVar("LGTM_SRC")); |
@@ -502,9 +501,9 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th |
502 | 501 | Set<Path> extractedFiles = new LinkedHashSet<>(); |
503 | 502 | for (Path projectPath : tsconfigFiles) { |
504 | 503 | File projectFile = projectPath.toFile(); |
505 | | - logBeginProcess("Opening project " + projectFile); |
| 504 | + long start = logBeginProcess("Opening project " + projectFile); |
506 | 505 | ParsedProject project = tsParser.openProject(projectFile); |
507 | | - logEndProcess(); |
| 506 | + logEndProcess(start); |
508 | 507 | // Extract all files belonging to this project which are also matched |
509 | 508 | // by our include/exclude filters. |
510 | 509 | List<File> typeScriptFiles = new ArrayList<File>(); |
@@ -605,25 +604,25 @@ protected void extract(FileExtractor extractor, Path file) throws IOException { |
605 | 604 | return; |
606 | 605 | } |
607 | 606 |
|
608 | | - logBeginProcess("Extracting " + file); |
| 607 | + long start = logBeginProcess("Extracting " + file); |
609 | 608 | extractor.extract(f); |
610 | | - logEndProcess(); |
| 609 | + logEndProcess(start); |
611 | 610 | } |
612 | 611 |
|
613 | 612 | private void warn(String msg) { |
614 | 613 | System.err.println(msg); |
615 | 614 | System.err.flush(); |
616 | 615 | } |
617 | 616 |
|
618 | | - private void logBeginProcess(String message) { |
| 617 | + private long logBeginProcess(String message) { |
619 | 618 | System.out.print(message + "..."); |
620 | 619 | System.out.flush(); |
621 | | - this.timedLogMessageStart = System.nanoTime(); |
| 620 | + return System.nanoTime(); |
622 | 621 | } |
623 | 622 |
|
624 | | - private void logEndProcess() { |
| 623 | + private void logEndProcess(long timedLogMessageStart) { |
625 | 624 | long end = System.nanoTime(); |
626 | | - int milliseconds = (int) ((end - this.timedLogMessageStart) / 1000000); |
| 625 | + int milliseconds = (int) ((end - timedLogMessageStart) / 1000000); |
627 | 626 | System.out.println(" done (" + milliseconds + " ms)"); |
628 | 627 | } |
629 | 628 |
|
|
0 commit comments