Skip to content

Commit d91db5a

Browse files
committed
Remove mutable methods which might potentially break due to introduced caching
1 parent 76542f8 commit d91db5a

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

Diff for: compiler/src/dotty/tools/io/AbstractFile.scala

-6
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,6 @@ abstract class AbstractFile extends Iterable[AbstractFile] {
136136
/** Does this abstract file represent something which can contain classfiles? */
137137
def isClassContainer: Boolean = isDirectory || (jpath != null && ext.isJarOrZip)
138138

139-
/** Create a file on disk, if one does not exist already. */
140-
def create(): Unit
141-
142-
/** Delete the underlying file or directory (recursively). */
143-
def delete(): Unit
144-
145139
/** Is this abstract file a directory? */
146140
def isDirectory: Boolean
147141

Diff for: compiler/src/dotty/tools/io/PlainFile.scala

-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import java.nio.file.{InvalidPathException, Paths}
1515
class PlainDirectory(givenPath: Directory) extends PlainFile(givenPath) {
1616
override val isDirectory: Boolean = true
1717
override def iterator(): Iterator[PlainFile] = givenPath.list.filter(_.exists).map(new PlainFile(_))
18-
override def delete(): Unit = givenPath.deleteRecursively()
1918
}
2019

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

116-
/** Does this abstract file denote an existing file? */
117-
def create(): Unit = if (!exists) givenPath.createFile()
118-
119-
/** Delete the underlying file or directory (recursively). */
120-
def delete(): Unit =
121-
if (givenPath.isFile) givenPath.delete()
122-
else if (givenPath.isDirectory) givenPath.toDirectory.deleteRecursively()
123-
124115
/** Returns a plain file with the given name. It does not
125116
* check that it exists.
126117
*/

0 commit comments

Comments
 (0)