Skip to content

Commit

Permalink
Clean up lingering srcs
Browse files Browse the repository at this point in the history
Clean up lingering srcs
  • Loading branch information
David Haxton committed Feb 24, 2020
1 parent acaa155 commit 6d51720
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void processArg(Instrumenter jacoco, String arg) throws Exception {
FileSystem inFS = FileSystems.newFileSystem(inPath, null); FileSystem outFS = FileSystems.newFileSystem(
URI.create("jar:" + outPath.toUri()), Collections.singletonMap("create", "true"));
) {
FileVisitor fileVisitor = createInstrumenterVisitor(jacoco, outFS, srcs);
FileVisitor fileVisitor = createInstrumenterVisitor(jacoco, outFS);
inFS.getRootDirectories().forEach(root -> {
try {
Files.walkFileTree(root, fileVisitor);
Expand All @@ -78,18 +78,18 @@ private void processArg(Instrumenter jacoco, String arg) throws Exception {
}
}

private SimpleFileVisitor createInstrumenterVisitor(Instrumenter jacoco, FileSystem outFS, String srcs) {
private SimpleFileVisitor createInstrumenterVisitor(Instrumenter jacoco, FileSystem outFS) {
return new SimpleFileVisitor <Path> () {
@Override
public FileVisitResult visitFile(Path inPath, BasicFileAttributes attrs) {
try {
return actuallyVisitFile(inPath, attrs, srcs);
return actuallyVisitFile(inPath, attrs);
} catch (final Exception e) {
throw new RuntimeException(e);
}
}

private FileVisitResult actuallyVisitFile(Path inPath, BasicFileAttributes attrs, String srcs) throws Exception {
private FileVisitResult actuallyVisitFile(Path inPath, BasicFileAttributes attrs) throws Exception {
Path outPath = outFS.getPath(inPath.toString());
Files.createDirectories(outPath.getParent());
if (inPath.toString().endsWith(".class")) {
Expand Down

0 comments on commit 6d51720

Please sign in to comment.