Skip to content

Commit 65ace2b

Browse files
committed
Remove more .nn
1 parent 222b3b1 commit 65ace2b

File tree

15 files changed

+24
-28
lines changed

15 files changed

+24
-28
lines changed

compiler/src/dotty/tools/dotc/core/NameOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object NameOps {
4545
val cs = s.toArray
4646
val bytes = Codec.toUTF8(CharBuffer.wrap(cs).nn)
4747
md5.update(bytes)
48-
val md5chars = md5.digest().nn.map(b => (b & 0xFF).toHexString).mkString
48+
val md5chars = md5.digest().map(b => (b & 0xFF).toHexString).mkString
4949

5050
prefix + marker + md5chars + marker + suffix
5151
}

compiler/src/dotty/tools/dotc/core/Names.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ object Names {
404404
* from GenBCode or it also contains one of the whitelisted methods below.
405405
*/
406406
private def toStringOK = {
407-
val trace: Array[StackTraceElement] = Thread.currentThread.nn.getStackTrace.asInstanceOf[Array[StackTraceElement]]
408-
!trace.exists(_.getClassName.nn.endsWith("GenBCode")) ||
407+
val trace: Array[StackTraceElement] = Thread.currentThread.getStackTrace.asInstanceOf[Array[StackTraceElement]]
408+
!trace.exists(_.getClassName.endsWith("GenBCode")) ||
409409
trace.exists(elem =>
410410
List(
411411
"mangledString",

compiler/src/dotty/tools/dotc/parsing/JavaScanners.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ object JavaScanners {
666666
val limit: Double =
667667
if (token == DOUBLELIT) Double.MaxValue else Float.MaxValue
668668
try {
669-
val value: Double = java.lang.Double.valueOf(strVal.toString).nn.doubleValue()
669+
val value: Double = java.lang.Double.valueOf(strVal.toString).doubleValue()
670670
if (value > limit)
671671
error(em"floating point number too large")
672672
if (negated) -value else value

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ object report:
8484
def bestEffortError(ex: Throwable, msg: String)(using Context): Unit =
8585
val stackTrace =
8686
Option(ex.getStackTrace()).map { st =>
87-
if st.nn.isEmpty then ""
88-
else s"Stack trace: \n ${st.nn.mkString("\n ")}".stripMargin
87+
if st.isEmpty then ""
88+
else s"Stack trace: \n ${st.mkString("\n ")}".stripMargin
8989
}.getOrElse("")
9090
// Build tools and dotty's test framework may check precisely for
9191
// "Unsuccessful best-effort compilation." error text.

compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class InstrumentCoverage extends MacroTransform with IdentityDenotTransformer:
5656

5757
if !newlyCreated then
5858
// If the directory existed before, let's clean it up.
59-
dataDir.listFiles.nn
60-
.filter(_.nn.getName.nn.startsWith("scoverage"))
61-
.foreach(_.nn.delete())
59+
dataDir.listFiles
60+
.filter(_.getName.startsWith("scoverage"))
61+
.foreach(_.delete())
6262
end if
6363

6464
coverageExcludeClasslikePatterns = ctx.settings.coverageExcludeClasslikes.value.map(_.r.pattern)
@@ -71,13 +71,13 @@ class InstrumentCoverage extends MacroTransform with IdentityDenotTransformer:
7171
private def isClassIncluded(sym: Symbol)(using Context): Boolean =
7272
val fqn = sym.fullName.toText(ctx.printerFn(ctx)).show
7373
coverageExcludeClasslikePatterns.isEmpty || !coverageExcludeClasslikePatterns.exists(
74-
_.matcher(fqn).nn.matches
74+
_.matcher(fqn).matches
7575
)
7676

7777
private def isFileIncluded(file: SourceFile)(using Context): Boolean =
7878
val normalizedPath = file.path.replace(".scala", "")
7979
coverageExcludeFilePatterns.isEmpty || !coverageExcludeFilePatterns.exists(
80-
_.matcher(normalizedPath).nn.matches
80+
_.matcher(normalizedPath).matches
8181
)
8282

8383
override protected def newTransformer(using Context) =

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ object TreeChecker {
860860
val stack =
861861
if !ctx.settings.Ydebug.value then "\nstacktrace available when compiling with `-Ydebug`"
862862
else if err.getStackTrace == null then " no stacktrace"
863-
else err.getStackTrace.nn.mkString(" ", " \n", "")
863+
else err.getStackTrace.mkString(" ", " \n", "")
864864

865865
report.error(
866866
em"""Malformed tree was found while expanding macro with -Xcheck-macros.

compiler/src/dotty/tools/dotc/util/ParsedComment.scala

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

3-
import scala.language.unsafeNulls
4-
53
import dotty.tools.dotc.core.Comments.{Comment, docCtx}
64
import dotty.tools.dotc.core.Contexts.*
75
import dotty.tools.dotc.core.Names.TermName

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
package dotty.tools.io
1010

11-
import scala.language.unsafeNulls
12-
1311
import java.io.{File => JavaIoFile, _}
1412
import java.nio.file.{Files, Paths}
1513
import java.nio.file.StandardOpenOption.*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ object FileWriters {
6666
def warning(message: Context ?=> Message): Unit = warning(message, NoSourcePosition)
6767
final def exception(reason: Context ?=> Message, throwable: Throwable): Unit =
6868
error({
69-
val trace = throwable.getStackTrace().nn.mkString("\n ")
69+
val trace = throwable.getStackTrace().mkString("\n ")
7070
em"An unhandled exception was thrown in the compiler while\n ${reason.message}.\n${throwable}\n $trace"
7171
}, NoSourcePosition)
7272
}

compiler/test-coursier/dotty/tools/coursier/CoursierScalaTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ object CoursierScalaTests:
159159

160160
def csScalaCmd(options: String*): List[String] =
161161
csScalaCmdWithStdin(options, None)
162-
162+
163163
def csScalaCmdWithStdin(options: Seq[String], stdin: Option[String]): List[String] =
164164
csCmd("dotty.tools.MainGenericRunner", options, stdin)
165165

0 commit comments

Comments
 (0)