Skip to content

Commit 6480c9e

Browse files
Address review
1 parent 429b471 commit 6480c9e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

compiler/src/dotty/tools/io/PlainFile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class PlainFile(val givenPath: Path) extends AbstractFile {
3939
override def container: AbstractFile = new PlainFile(givenPath.parent)
4040
override def input: InputStream = givenPath.toFile.inputStream()
4141
override def output: OutputStream = givenPath.toFile.outputStream()
42-
override def sizeOption: Some[Int] = Some(givenPath.length.toInt)
42+
override def sizeOption: Option[Int] = Some(givenPath.length.toInt)
4343

4444
override def hashCode(): Int = fpath.hashCode()
4545
override def equals(that: Any): Boolean = that match {

compiler/src/dotty/tools/io/ZipArchive.scala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package dotty.tools.io
77

88
import java.net.URL
9-
import java.io.{ IOException, InputStream, FilterInputStream }
9+
import java.io.{ IOException, InputStream, OutputStream, FilterInputStream }
1010
import java.nio.file.Files
1111
import java.util.zip.{ ZipEntry, ZipFile }
1212
import java.util.jar.Manifest
@@ -55,27 +55,27 @@ import ZipArchive._
5555
abstract class ZipArchive(override val jpath: JPath) extends AbstractFile with Equals {
5656
self =>
5757

58-
override def underlyingSource: Some[ZipArchive] = Some(this)
58+
override def underlyingSource: Option[ZipArchive] = Some(this)
5959
def isDirectory: Boolean = true
6060
def lookupName(name: String, directory: Boolean): AbstractFile = unsupported()
6161
def lookupNameUnchecked(name: String, directory: Boolean): AbstractFile = unsupported()
6262
def create(): Unit = unsupported()
6363
def delete(): Unit = unsupported()
64-
def output: Nothing = unsupported()
65-
def container: Nothing = unsupported()
66-
def absolute: Nothing = unsupported()
64+
def output: OutputStream = unsupported()
65+
def container: AbstractFile = unsupported()
66+
def absolute: AbstractFile = unsupported()
6767

6868
/** ''Note: This library is considered experimental and should not be used unless you know what you are doing.'' */
6969
sealed abstract class Entry(path: String) extends VirtualFile(baseName(path), path) {
7070
// have to keep this name for compat with sbt's compiler-interface
7171
def getArchive: ZipFile = null
72-
override def underlyingSource: Some[ZipArchive] = Some(self)
72+
override def underlyingSource: Option[ZipArchive] = Some(self)
7373
override def toString: String = self.path + "(" + path + ")"
7474
}
7575

7676
/** ''Note: This library is considered experimental and should not be used unless you know what you are doing.'' */
7777
class DirEntry(path: String) extends Entry(path) {
78-
val entries: mutable.HashMap[String, Entry] = mutable.HashMap[String, Entry]()
78+
val entries: mutable.HashMap[String, Entry] = mutable.HashMap()
7979

8080
override def isDirectory: Boolean = true
8181
override def iterator: Iterator[Entry] = entries.valuesIterator
@@ -147,7 +147,7 @@ final class FileZipArchive(jpath: JPath) extends ZipArchive(jpath) {
147147
override def sizeOption: Option[Int] = Some(zipEntry.getSize.toInt)
148148
}
149149

150-
@volatile lazy val ((root: DirEntry), (allDirs: mutable.HashMap[String, DirEntry])) = {
150+
@volatile lazy val (root, allDirs): (DirEntry, collection.Map[String, DirEntry]) = {
151151
val root = new DirEntry("/")
152152
val dirs = mutable.HashMap[String, DirEntry]("/" -> root)
153153
val zipFile = openZipFile()
@@ -180,12 +180,12 @@ final class FileZipArchive(jpath: JPath) extends ZipArchive(jpath) {
180180

181181
def iterator: Iterator[Entry] = root.iterator
182182

183-
def name: String = jpath.getFileName.toString
184-
def path: String = jpath.toString
185-
def input: java.io.InputStream = Files.newInputStream(jpath)
186-
def lastModified: Long = Files.getLastModifiedTime(jpath).toMillis
183+
def name: String = jpath.getFileName.toString
184+
def path: String = jpath.toString
185+
def input: InputStream = Files.newInputStream(jpath)
186+
def lastModified: Long = Files.getLastModifiedTime(jpath).toMillis
187187

188-
override def sizeOption: Some[Int] = Some(Files.size(jpath).toInt)
188+
override def sizeOption: Option[Int] = Some(Files.size(jpath).toInt)
189189
override def canEqual(other: Any): Boolean = other.isInstanceOf[FileZipArchive]
190190
override def hashCode(): Int = jpath.hashCode
191191
override def equals(that: Any): Boolean = that match {

0 commit comments

Comments
 (0)