Skip to content

Commit 222b3b1

Browse files
committed
Removed some nn and unsafeNulls
1 parent 6f48c39 commit 222b3b1

23 files changed

+26
-40
lines changed

compiler/src/dotty/tools/MainGenericCompiler.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package dotty.tools
22

3-
import scala.language.unsafeNulls
4-
53
import scala.annotation.tailrec
64
import scala.io.Source
75
import scala.util.Try

compiler/src/dotty/tools/backend/jvm/AsmUtils.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package dotty.tools
22
package backend
33
package jvm
44

5-
import scala.language.unsafeNulls
6-
75
import scala.tools.asm.tree.{AbstractInsnNode}
86
import java.io.PrintWriter
97
import scala.tools.asm.util.{TraceClassVisitor, TraceMethodVisitor, Textifier}

compiler/src/dotty/tools/backend/jvm/PostProcessor.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class PostProcessor(val frontendAccess: PostProcessorFrontendAccess, val bTypes:
3636
setInnerClasses(classNode)
3737
serializeClass(classNode)
3838
catch
39-
case e: java.lang.RuntimeException if e.getMessage != null && e.getMessage.nn.contains("too large!") =>
39+
case e: java.lang.RuntimeException if e.getMessage != null && e.getMessage.contains("too large!") =>
4040
backendReporting.error(em"Could not write class $internalName because it exceeds JVM code size limits. ${e.getMessage}")
4141
null
4242
case ex: Throwable =>
@@ -58,8 +58,8 @@ class PostProcessor(val frontendAccess: PostProcessorFrontendAccess, val bTypes:
5858
}
5959

6060
private def warnCaseInsensitiveOverwrite(clazz: GeneratedClass) = {
61-
val name = clazz.classNode.name.nn
62-
val lowerCaseJavaName = name.nn.toLowerCase
61+
val name = clazz.classNode.name
62+
val lowerCaseJavaName = name.toLowerCase
6363
val clsPos = clazz.position
6464
caseInsensitively.putIfAbsent(lowerCaseJavaName, (name, clsPos)) match {
6565
case null => ()

compiler/src/dotty/tools/dotc/Bench.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object Bench extends Driver:
3030
println(s"time elapsed: ${times(curRun)}ms")
3131
if ctx.settings.Xprompt.value || waitAfter == curRun + 1 then
3232
print("hit <return> to continue >")
33-
System.in.nn.read()
33+
System.in.read()
3434
reporter
3535

3636
def extractNumArg(args: Array[String], name: String, default: Int = 1): (Int, Array[String]) = {

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
211211
try
212212
trackProgress(_.cancel())
213213
finally
214-
Thread.currentThread().nn.interrupt()
214+
Thread.currentThread().interrupt()
215215

216216
private def doAdvancePhase(currentPhase: Phase, wasRan: Boolean)(using Context): Unit =
217217
trackProgress: progress =>

compiler/src/dotty/tools/dotc/cc/CaptureSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ object CaptureSet:
634634

635635
// For debugging: A trace where a set was created. Note that logically it would make more
636636
// sense to place this variable in Mapped, but that runs afoul of the initializatuon checker.
637-
val stack = if debugSets && this.isInstanceOf[Mapped] then (new Throwable).getStackTrace().nn.take(20) else null
637+
val stack = if debugSets && this.isInstanceOf[Mapped] then (new Throwable).getStackTrace().take(20) else null
638638

639639
/** The variable from which this variable is derived */
640640
def source: Var

compiler/src/dotty/tools/dotc/config/CommandLineParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ object CommandLineParser:
114114
def expandArg(arg: String): List[String] =
115115
val path = Paths.get(arg.stripPrefix("@"))
116116
if !Files.exists(path) then
117-
System.err.nn.println(s"Argument file ${path.nn.getFileName} could not be found")
117+
System.err.println(s"Argument file ${path.getFileName} could not be found")
118118
Nil
119119
else
120120
def stripComment(s: String) = s.indexOf('#') match { case -1 => s case i => s.substring(0, i) }

compiler/src/dotty/tools/dotc/config/Printers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import core.Contexts.{Context, ctx}
55
object Printers {
66

77
class Printer {
8-
def println(msg: => String): Unit = System.out.nn.println(msg)
8+
def println(msg: => String): Unit = System.out.println(msg)
99
}
1010

1111
object noPrinter extends Printer {

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dotty.tools.dotc
22
package config
33

4-
import scala.language.unsafeNulls
54
import dotty.tools.dotc.config.PathResolver.Defaults
65
import dotty.tools.dotc.config.Settings.{Setting, SettingGroup, SettingCategory, Deprecation}
76
import dotty.tools.dotc.config.SourceVersion

compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package config
44
import Settings.Setting.ChoiceWithHelp
55
import dotty.tools.backend.jvm.BackendUtils.classfileVersionMap
66
import dotty.tools.io.{AbstractFile, Directory, JDK9Reflectors, PlainDirectory, NoAbstractFile}
7-
import scala.language.unsafeNulls
87

98
object ScalaSettingsProperties:
109

0 commit comments

Comments
 (0)