Skip to content

Commit 4344b3d

Browse files
committed
Address some comments
1 parent da79ae2 commit 4344b3d

File tree

8 files changed

+100
-100
lines changed

8 files changed

+100
-100
lines changed

compiler/src/dotty/tools/scripting/StringDriver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class StringDriver(compilerArgs: Array[String], scalaSource: String) extends Dri
3131
try
3232
val classpath = s"${ctx.settings.classpath.value}${pathsep}${sys.props("java.class.path")}"
3333
val classpathEntries: Seq[Path] = ClassPath.expandPath(classpath, expandStar=true).map { Paths.get(_) }
34-
sys.props("java.class.path") = classpathEntries.map(_.toString).mkString(pathsep.nn)
34+
sys.props("java.class.path") = classpathEntries.map(_.toString).mkString(pathsep)
3535
detectMainClassAndMethod(outDir, classpathEntries, scalaSource) match
3636
case Right((mainClass, mainMethod)) =>
3737
mainMethod.invoke(null, Array.empty[String])

compiler/src/dotty/tools/scripting/Util.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ object Util:
5656
end match
5757
end detectMainClassAndMethod
5858

59-
def pathsep = sys.props("path.separator")
59+
def pathsep: String = sys.props("path.separator").nn
6060

6161
end Util
6262

compiler/test/dotty/tools/io/ClasspathTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import dotty.tools.io.{ PlainDirectory, Directory, ClassPath }
1313

1414
class ClasspathTest {
1515

16-
def pathsep = sys.props("path.separator")
16+
def pathsep: String = sys.props("path.separator").nn
1717

1818
def isWindows: Boolean = scala.util.Properties.isWin
1919

library/src/scala/concurrent/BatchingExecutor.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private[concurrent] trait BatchingExecutor extends Executor {
100100
*/
101101
private[this] sealed abstract class AbstractBatch protected (
102102
@annotation.stableNull protected final var first: Runnable | Null,
103-
@annotation.stableNull protected final var other: Array[Runnable | Null],
103+
protected final var other: Array[Runnable | Null],
104104
protected final var size: Int
105105
) {
106106

@@ -149,7 +149,7 @@ private[concurrent] trait BatchingExecutor extends Executor {
149149
}
150150

151151
private[this] final class AsyncBatch private(_first: Runnable | Null, _other: Array[Runnable | Null], _size: Int) extends AbstractBatch(_first, _other, _size) with Runnable with BlockContext with (BlockContext => Throwable | Null) {
152-
@annotation.stableNull private[this] final var parentBlockContext: BlockContext = BatchingExecutorStatics.MissingParentBlockContext
152+
private[this] final var parentBlockContext: BlockContext = BatchingExecutorStatics.MissingParentBlockContext
153153

154154
final def this(runnable: Runnable) = this(runnable, BatchingExecutorStatics.emptyBatchArray, 1)
155155

library/src/scala/io/BufferedSource.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class BufferedSource(inputStream: InputStream, bufferSize: Int)(implicit val cod
6767

6868
class BufferedLineIterator extends AbstractIterator[String] with Iterator[String] {
6969
private[this] val lineReader = decachedReader
70-
var nextLine: String | Null = null
70+
@annotation.stableNull var nextLine: String | Null = null
7171

7272
override def hasNext = {
7373
if (nextLine == null)
@@ -78,10 +78,10 @@ class BufferedSource(inputStream: InputStream, bufferSize: Int)(implicit val cod
7878
override def next(): String = {
7979
val result = {
8080
if (nextLine == null) lineReader.readLine
81-
else try nextLine.nn finally nextLine = null
81+
else try nextLine finally nextLine = null
8282
}
8383
if (result == null) Iterator.empty.next()
84-
else result.nn
84+
else result
8585
}
8686
}
8787

library/src/scala/jdk/FunctionExtensions.scala

Lines changed: 88 additions & 88 deletions
Large diffs are not rendered by default.

library/src/scala/sys/SystemProperties.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extends mutable.AbstractMap[String, String | Null] {
3434
override def empty: mutable.Map[String, String | Null] = mutable.Map[String, String | Null]()
3535
override def default(key: String): String | Null = null
3636

37-
def iterator: Iterator[(String, String | Null)] = wrapAccess {
37+
def iterator: Iterator[(String, String)] = wrapAccess {
3838
val ps = System.getProperties()
3939
names map (k => (k, ps getProperty k)) filter (_._2 ne null)
4040
} getOrElse Iterator.empty

library/src/scala/util/Sorting.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ object Sorting {
234234

235235
// TODO: add upper bound: T <: AnyRef, propagate to callers below (not binary compatible)
236236
// Maybe also rename all these methods to `sort`.
237-
@inline private def sort[T](a: Array[T] | Null, from: Int, until: Int, ord: Ordering[T]): Unit = (a: @unchecked) match {
238-
case _: Array[AnyRef] =>
237+
@inline private def sort[T](a: Array[T], from: Int, until: Int, ord: Ordering[T]): Unit = (a: @unchecked) match {
238+
case a: Array[AnyRef] =>
239239
// Note that runtime matches are covariant, so could actually be any Array[T] s.t. T is not primitive (even boxed value classes)
240-
if (a.nn.length > 1 && (ord eq null)) throw new NullPointerException("Ordering")
240+
if (a.length > 1 && (ord eq null)) throw new NullPointerException("Ordering")
241241
java.util.Arrays.sort(a, from, until, ord)
242242
case a: Array[Int] => if (ord eq Ordering.Int) java.util.Arrays.sort(a, from, until) else mergeSort[Int](a, from, until, ord)
243243
case a: Array[Double] => mergeSort[Double](a, from, until, ord) // Because not all NaNs are identical, stability is meaningful!

0 commit comments

Comments
 (0)