Skip to content

Commit 99f1fd3

Browse files
authored
Merge pull request #4208 from dotty-staging/fix/4207
Fix #4207: Read whole zipfile before closing
2 parents bd87107 + 4316c9f commit 99f1fd3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
132132

133133
try {
134134
for {
135-
entry <- zipFile.stream.iterator().asScala
135+
entry <- zipFile.stream.toArray((size: Int) => new Array[ZipEntry](size))
136136
name = entry.getName
137-
tastySuffix <- tastySuffixes
138-
if name.endsWith(tastySuffix)
137+
tastySuffix <- tastySuffixes.find(name.endsWith)
139138
} yield name.replace("/", ".").stripSuffix(tastySuffix)
140139
}
141140
finally zipFile.close()

0 commit comments

Comments
 (0)