Skip to content

Commit

Permalink
Remove mutable methods which might potentially break due to introduce…
Browse files Browse the repository at this point in the history
…d caching
  • Loading branch information
OlegYch committed Apr 16, 2024
1 parent 76542f8 commit d91db5a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
6 changes: 0 additions & 6 deletions compiler/src/dotty/tools/io/AbstractFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ abstract class AbstractFile extends Iterable[AbstractFile] {
/** Does this abstract file represent something which can contain classfiles? */
def isClassContainer: Boolean = isDirectory || (jpath != null && ext.isJarOrZip)

/** Create a file on disk, if one does not exist already. */
def create(): Unit

/** Delete the underlying file or directory (recursively). */
def delete(): Unit

/** Is this abstract file a directory? */
def isDirectory: Boolean

Expand Down
9 changes: 0 additions & 9 deletions compiler/src/dotty/tools/io/PlainFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import java.nio.file.{InvalidPathException, Paths}
class PlainDirectory(givenPath: Directory) extends PlainFile(givenPath) {
override val isDirectory: Boolean = true
override def iterator(): Iterator[PlainFile] = givenPath.list.filter(_.exists).map(new PlainFile(_))
override def delete(): Unit = givenPath.deleteRecursively()
}

/** This class implements an abstract file backed by a File.
Expand Down Expand Up @@ -113,14 +112,6 @@ class PlainFile(val givenPath: Path) extends AbstractFile {
null
}

/** Does this abstract file denote an existing file? */
def create(): Unit = if (!exists) givenPath.createFile()

/** Delete the underlying file or directory (recursively). */
def delete(): Unit =
if (givenPath.isFile) givenPath.delete()
else if (givenPath.isDirectory) givenPath.toDirectory.deleteRecursively()

/** Returns a plain file with the given name. It does not
* check that it exists.
*/
Expand Down

0 comments on commit d91db5a

Please sign in to comment.