Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.4.2, 4.0.0, 3.5.1
Description
val scalaStyleOnCompileConfig: String = { val in = "scalastyle-config.xml" val out = "scalastyle-on-compile.generated.xml" val replacements = Map( """customId="println" level="error"""" -> """customId="println" level="warn"""" ) var contents = Source.fromFile(in).getLines.mkString("\n") for ((k, v) <- replacements) { require(contents.contains(k), s"Could not rewrite '$k' in original scalastyle config.") contents = contents.replace(k, v) } new PrintWriter(out) { write(contents) close() } out }
`Source.fromFile(in)` opens a `BufferedSource` resource handle, but it does not close it.
Attachments
Issue Links
- links to