File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
compiler/src/dotty/tools/dotc/util Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -275,12 +275,11 @@ object SourceFile {
275
275
276
276
def apply (file : AbstractFile | Null , codec : Codec ): SourceFile =
277
277
// Files.exists is slow on Java 8 (https://rules.sonarsource.com/java/tag/performance/RSPEC-3725),
278
- // so cope with failure; also deal with path prefix "Not a directory" .
278
+ // so cope with failure.
279
279
val chars =
280
280
try new String (file.toByteArray, codec.charSet).toCharArray
281
281
catch
282
- case _ : NoSuchFileException => Array .empty[Char ]
283
- case fse : FileSystemException if fse.getMessage.endsWith(" Not a directory" ) => Array .empty[Char ]
282
+ case _ : FileSystemException => Array .empty[Char ]
284
283
285
284
if isScript(file, chars) then
286
285
ScriptSourceFile (file, chars)
You can’t perform that action at this time.
0 commit comments