From bbd9aeb68b8e1690c24a598c55fc7c1acc89b71f Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 31 Mar 2017 12:03:26 +0200 Subject: Avoid NPE in ParallelTesting on junk files Emacs often produces temporary files in directories. These used to cause NPEs in the new testing framework. We now fix this by only compiling file names that designate source files. --- compiler/test/dotty/tools/dotc/ParallelTesting.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler/test/dotty') diff --git a/compiler/test/dotty/tools/dotc/ParallelTesting.scala b/compiler/test/dotty/tools/dotc/ParallelTesting.scala index 289351d81..a81eb4d3a 100644 --- a/compiler/test/dotty/tools/dotc/ParallelTesting.scala +++ b/compiler/test/dotty/tools/dotc/ParallelTesting.scala @@ -920,9 +920,8 @@ trait ParallelTesting { self => private def compilationTargets(sourceDir: JFile): (List[JFile], List[JFile]) = sourceDir.listFiles.foldLeft((List.empty[JFile], List.empty[JFile])) { case ((dirs, files), f) => if (f.isDirectory) (f :: dirs, files) - else if (f.getName.endsWith(".check")) (dirs, files) - else if (f.getName.endsWith(".flags")) (dirs, files) - else (dirs, f :: files) + else if (isSourceFile(f)) (dirs, f :: files) + else (dirs, files) } /** Gets the name of the calling method via reflection. -- cgit v1.2.3