@@ -18,8 +18,6 @@ import dotty.tools.io.PlainFile.toPlainFile
18
18
import BTypes .InternalName
19
19
import dotty .tools .io .JarArchive
20
20
21
- import scala .language .unsafeNulls
22
-
23
21
/** !!! This file is now copied in `dotty.tools.io.FileWriters` in a more general way that does not rely upon
24
22
* `PostProcessorFrontendAccess`, this should probably be changed to wrap that class instead.
25
23
*
@@ -54,11 +52,11 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
54
52
def close (): Unit
55
53
56
54
protected def classRelativePath (className : InternalName , suffix : String = " .class" ): String =
57
- className.replace('.' , '/' ).nn + suffix
55
+ className.replace('.' , '/' ) + suffix
58
56
}
59
57
60
58
object ClassfileWriter {
61
- private def getDirectory (dir : String ): Path = Paths .get(dir).nn
59
+ private def getDirectory (dir : String ): Path = Paths .get(dir)
62
60
63
61
def apply (): ClassfileWriter = {
64
62
val jarManifestMainClass : Option [String ] = compilerSettings.mainClass.orElse {
@@ -137,7 +135,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
137
135
new JarEntryWriter (jarFile, jarManifestMainClass, jarCompressionLevel)
138
136
}
139
137
else if (file.isVirtual) new VirtualFileWriter (file)
140
- else if (file.isDirectory) new DirEntryWriter (file.file.toPath.nn )
138
+ else if (file.isDirectory) new DirEntryWriter (file.file.nn.toPath )
141
139
else throw new IllegalStateException (s " don't know how to handle an output of $file [ ${file.getClass}] " )
142
140
}
143
141
@@ -151,7 +149,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
151
149
val jarWriter : JarOutputStream = {
152
150
import scala .util .Properties .*
153
151
val manifest = new Manifest
154
- val attrs = manifest.getMainAttributes.nn
152
+ val attrs = manifest.getMainAttributes
155
153
attrs.put(MANIFEST_VERSION , " 1.0" )
156
154
attrs.put(ScalaCompilerVersion , versionNumberString)
157
155
mainClass.foreach(c => attrs.put(MAIN_CLASS , c))
@@ -184,7 +182,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
184
182
// important detail here, even on Windows, Zinc expects the separator within the jar
185
183
// to be the system default, (even if in the actual jar file the entry always uses '/').
186
184
// see https://github.com/sbt/zinc/blob/dcddc1f9cfe542d738582c43f4840e17c053ce81/internal/compiler-bridge/src/main/scala/xsbt/JarUtils.scala#L47
187
- val pathInJar =
185
+ val pathInJar =
188
186
if File .separatorChar == '/' then relativePath
189
187
else relativePath.replace('/' , File .separatorChar)
190
188
PlainFile .toPlainFile(Paths .get(s " ${file.absolutePath}! $pathInJar" ))
@@ -293,5 +291,5 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
293
291
}
294
292
295
293
/** Can't output a file due to the state of the file system. */
296
- class FileConflictException (msg : String , cause : Throwable = null ) extends IOException (msg, cause)
294
+ class FileConflictException (msg : String , cause : Throwable | Null = null ) extends IOException (msg, cause)
297
295
}
0 commit comments