From 54e67889f10b39323fb729808b8cd22b4c832910 Mon Sep 17 00:00:00 2001 From: chick Date: Thu, 1 Aug 2019 09:21:52 -0700 Subject: Followup to PR #1142 Fixes a threading bug in where lazy reading of file caused a problem for multithreaded access to the that was read. Changes all uses of io.Source to use new API getText getLines getTextResource getLinesResouce Make style to only import FileUtils and not its methods So code is more explicit as e.g. FileUtils.getText() --- src/main/scala/firrtl/util/BackendCompilationUtilities.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/scala/firrtl/util') diff --git a/src/main/scala/firrtl/util/BackendCompilationUtilities.scala b/src/main/scala/firrtl/util/BackendCompilationUtilities.scala index e0341bf1..beb44ad0 100644 --- a/src/main/scala/firrtl/util/BackendCompilationUtilities.scala +++ b/src/main/scala/firrtl/util/BackendCompilationUtilities.scala @@ -7,6 +7,7 @@ import java.nio.file.Files import java.text.SimpleDateFormat import java.util.Calendar +import firrtl.FileUtils import scala.sys.process.{ProcessBuilder, ProcessLogger, _} @@ -121,7 +122,7 @@ trait BackendCompilationUtilities { // Build a set of canonical file paths to use as a filter to exclude already included additional Verilog sources. val blackBoxHelperFiles: Set[String] = { if(list_file.exists()) { - io.Source.fromFile(list_file).getLines.toSet + FileUtils.getLines(list_file).toSet } else { Set.empty -- cgit v1.2.3