Skip to content

Commit 747eb65

Browse files
noti0na1hamzaremmal
authored andcommitted
Make wrappers and convertors non-nullable
1 parent 3e290b7 commit 747eb65

15 files changed

+210
-210
lines changed

library/src/scala/Array.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ object Array {
586586
def get: UnapplySeqWrapper[T] = this
587587
def lengthCompare(len: Int): Int = a.lengthCompare(len)
588588
def apply(i: Int): T = a(i)
589-
def drop(n: Int): scala.Seq[T] = ArraySeq.unsafeWrapArray(a.drop(n)).nn // clones the array, also if n == 0
589+
def drop(n: Int): scala.Seq[T] = ArraySeq.unsafeWrapArray(a.drop(n)) // clones the array, also if n == 0
590590
def toSeq: scala.Seq[T] = a.toSeq // clones the array
591591
}
592592
}

library/src/scala/StringContext.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ case class StringContext(parts: String*) {
9595
object s {
9696
/** The simple string matcher.
9797
*
98-
* Attempts to match the input string to the given interpolated patterns via
98+
* Attempts to match the input string to the given interpolated patterns via
9999
* a naive globbing, that is the reverse of the simple interpolator.
100100
*
101101
* Here is an example usage:
@@ -206,7 +206,7 @@ object StringContext {
206206
* separated by wildcards
207207
* @param input The input you wish to match against
208208
* @return None if there is no match, Some containing the sequence of matched
209-
* wildcard strings if there is a match
209+
* wildcard strings if there is a match
210210
*/
211211
def glob(patternChunks: Seq[String], input: String): Option[Seq[String]] = {
212212
var patternIndex = 0
@@ -293,7 +293,7 @@ object StringContext {
293293
// Matched all of pattern to all of name. Success.
294294
Some(collection.immutable.ArraySeq.unsafeWrapArray(
295295
Array.tabulate(patternChunks.length - 1)(n => input.slice(matchStarts(n), matchEnds(n)))
296-
).nn)
296+
))
297297
}
298298

299299
/** An exception that is thrown if a string contains a backslash (`\`) character
@@ -317,7 +317,7 @@ object StringContext {
317317
val len = src.length()
318318
def loop(uindex: Int): (Char, Int) = {
319319
def loopCP(dindex: Int, codepoint: Int): (Char, Int) = {
320-
//supports BMP + surrogate escapes
320+
//supports BMP + surrogate escapes
321321
//but only in four hex-digit code units (uxxxx)
322322
if(dindex >= 4) {
323323
val usRead = uindex - startindex

library/src/scala/collection/ArrayOps.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ object ArrayOps {
6060
private class ArrayView[A](xs: Array[A]) extends AbstractIndexedSeqView[A] {
6161
def length = xs.length
6262
def apply(n: Int) = xs(n)
63-
override def toString: String = immutable.ArraySeq.unsafeWrapArray(xs).nn.mkString("ArrayView(", ", ", ")")
63+
override def toString: String = immutable.ArraySeq.unsafeWrapArray(xs).mkString("ArrayView(", ", ", ")")
6464
}
6565

6666
/** A lazy filtered array. No filtering is applied until one of `foreach`, `map` or `flatMap` is called. */
@@ -1084,7 +1084,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
10841084
* @return a decorator `LazyZip2` that allows strict operations to be performed on the lazily evaluated pairs
10851085
* or chained calls to `lazyZip`. Implicit conversion to `Iterable[(A, B)]` is also supported.
10861086
*/
1087-
def lazyZip[B](that: Iterable[B]^): LazyZip2[A, B, Array[A]]^{that} = new LazyZip2(xs, immutable.ArraySeq.unsafeWrapArray(xs).nn, that)
1087+
def lazyZip[B](that: Iterable[B]^): LazyZip2[A, B, Array[A]]^{that} = new LazyZip2(xs, immutable.ArraySeq.unsafeWrapArray(xs), that)
10881088

10891089
/** Returns an array formed from this array and another iterable collection
10901090
* by combining corresponding elements in pairs.
@@ -1438,7 +1438,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
14381438
@`inline` final def toSeq: immutable.Seq[A] = toIndexedSeq
14391439

14401440
def toIndexedSeq: immutable.IndexedSeq[A] =
1441-
immutable.ArraySeq.unsafeWrapArray(Array.copyOf(xs, xs.length)).nn
1441+
immutable.ArraySeq.unsafeWrapArray(Array.copyOf(xs, xs.length))
14421442

14431443
/** Copy elements of this array to another array.
14441444
* Fills the given array `xs` starting at index 0.

library/src/scala/collection/Iterator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ trait Iterator[+A] extends IterableOnce[A] with IterableOnceOps[A, Iterator, Ite
278278
else if (buffer.nn.length == size) Array.copy(src = buffer.nn, srcPos = step, dest = prev.nn, destPos = 0, length = size - step)
279279
else prev = null
280280
}
281-
val res = immutable.ArraySeq.unsafeWrapArray(buffer).asInstanceOf[immutable.ArraySeq[B]]
281+
val res = immutable.ArraySeq.unsafeWrapArray(buffer.nn).asInstanceOf[immutable.ArraySeq[B]]
282282
buffer = null
283283
first = false
284284
res

library/src/scala/collection/JavaConverters.scala

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -81,257 +81,257 @@ import scala.language.implicitConversions
8181
@deprecated("Use `scala.jdk.CollectionConverters` instead", "2.13.0")
8282
object JavaConverters extends AsJavaConverters with AsScalaConverters {
8383
@deprecated("Use `asJava` instead", "2.13.0")
84-
def asJavaIterator[A](i: Iterator[A] | Null): ju.Iterator[A] | Null = asJava(i)
84+
def asJavaIterator[A](i: Iterator[A]): ju.Iterator[A] = asJava(i)
8585

8686
@deprecated("Use `asJava` instead", "2.13.0")
87-
def asJavaIterable[A](i: Iterable[A] | Null): jl.Iterable[A] | Null = asJava(i)
87+
def asJavaIterable[A](i: Iterable[A]): jl.Iterable[A] = asJava(i)
8888

8989
@deprecated("Use `asJava` instead", "2.13.0")
90-
def bufferAsJavaList[A](b: mutable.Buffer[A] | Null): ju.List[A] | Null = asJava(b)
90+
def bufferAsJavaList[A](b: mutable.Buffer[A]): ju.List[A] = asJava(b)
9191

9292
@deprecated("Use `asJava` instead", "2.13.0")
93-
def mutableSeqAsJavaList[A](s: mutable.Seq[A] | Null): ju.List[A] | Null = asJava(s)
93+
def mutableSeqAsJavaList[A](s: mutable.Seq[A]): ju.List[A] = asJava(s)
9494

9595
@deprecated("Use `asJava` instead", "2.13.0")
96-
def seqAsJavaList[A](s: Seq[A] | Null): ju.List[A] | Null = asJava(s)
96+
def seqAsJavaList[A](s: Seq[A]): ju.List[A] = asJava(s)
9797

9898
@deprecated("Use `asJava` instead", "2.13.0")
99-
def mutableSetAsJavaSet[A](s: mutable.Set[A] | Null): ju.Set[A] | Null = asJava(s)
99+
def mutableSetAsJavaSet[A](s: mutable.Set[A]): ju.Set[A] = asJava(s)
100100

101101
@deprecated("Use `asJava` instead", "2.13.0")
102-
def setAsJavaSet[A](s: Set[A] | Null): ju.Set[A] | Null = asJava(s)
102+
def setAsJavaSet[A](s: Set[A]): ju.Set[A] = asJava(s)
103103

104104
@deprecated("Use `asJava` instead", "2.13.0")
105-
def mutableMapAsJavaMap[K, V](m: mutable.Map[K, V] | Null): ju.Map[K, V] | Null = asJava(m)
105+
def mutableMapAsJavaMap[K, V](m: mutable.Map[K, V]): ju.Map[K, V] = asJava(m)
106106

107107
@deprecated("Use `asJava` instead", "2.13.0")
108-
def mapAsJavaMap[K, V](m: Map[K, V] | Null): ju.Map[K, V] | Null = asJava(m)
108+
def mapAsJavaMap[K, V](m: Map[K, V]): ju.Map[K, V] = asJava(m)
109109

110110
@deprecated("Use `asJava` instead", "2.13.0")
111-
def mapAsJavaConcurrentMap[K, V](m: concurrent.Map[K, V] | Null): juc.ConcurrentMap[K, V] | Null = asJava(m)
111+
def mapAsJavaConcurrentMap[K, V](m: concurrent.Map[K, V]): juc.ConcurrentMap[K, V] = asJava(m)
112112

113113
@deprecated("Use `asScala` instead", "2.13.0")
114-
def asScalaIterator[A](i: ju.Iterator[A] | Null): Iterator[A] | Null = asScala(i)
114+
def asScalaIterator[A](i: ju.Iterator[A]): Iterator[A] = asScala(i)
115115

116116
@deprecated("Use `asScala` instead", "2.13.0")
117-
def enumerationAsScalaIterator[A](i: ju.Enumeration[A] | Null): Iterator[A] | Null = asScala(i)
117+
def enumerationAsScalaIterator[A](i: ju.Enumeration[A]): Iterator[A] = asScala(i)
118118

119119
@deprecated("Use `asScala` instead", "2.13.0")
120-
def iterableAsScalaIterable[A](i: jl.Iterable[A] | Null): Iterable[A] | Null = asScala(i)
120+
def iterableAsScalaIterable[A](i: jl.Iterable[A]): Iterable[A] = asScala(i)
121121

122122
@deprecated("Use `asScala` instead", "2.13.0")
123-
def collectionAsScalaIterable[A](i: ju.Collection[A] | Null): Iterable[A] | Null = asScala(i)
123+
def collectionAsScalaIterable[A](i: ju.Collection[A]): Iterable[A] = asScala(i)
124124

125125
@deprecated("Use `asScala` instead", "2.13.0")
126-
def asScalaBuffer[A](s: ju.List[A] | Null): mutable.Buffer[A] | Null = asScala(s)
126+
def asScalaBuffer[A](s: ju.List[A]): mutable.Buffer[A] = asScala(s)
127127

128128
@deprecated("Use `asScala` instead", "2.13.0")
129-
def asScalaSet[A](s: ju.Set[A] | Null): mutable.Set[A] | Null = asScala(s)
129+
def asScalaSet[A](s: ju.Set[A]): mutable.Set[A] = asScala(s)
130130

131131
@deprecated("Use `asScala` instead", "2.13.0")
132-
def mapAsScalaMap[A, B](m: ju.Map[A, B] | Null): mutable.Map[A, B] | Null = asScala(m)
132+
def mapAsScalaMap[A, B](m: ju.Map[A, B]): mutable.Map[A, B] = asScala(m)
133133

134134
@deprecated("Use `asScala` instead", "2.13.0")
135-
def mapAsScalaConcurrentMap[A, B](m: juc.ConcurrentMap[A, B] | Null): concurrent.Map[A, B] | Null = asScala(m)
135+
def mapAsScalaConcurrentMap[A, B](m: juc.ConcurrentMap[A, B]): concurrent.Map[A, B] = asScala(m)
136136

137137
@deprecated("Use `asScala` instead", "2.13.0")
138-
def dictionaryAsScalaMap[A, B](p: ju.Dictionary[A, B] | Null): mutable.Map[A, B] | Null = asScala(p)
138+
def dictionaryAsScalaMap[A, B](p: ju.Dictionary[A, B]): mutable.Map[A, B] = asScala(p)
139139

140140
@deprecated("Use `asScala` instead", "2.13.0")
141-
def propertiesAsScalaMap(p: ju.Properties | Null): mutable.Map[String, String] | Null = asScala(p)
141+
def propertiesAsScalaMap(p: ju.Properties): mutable.Map[String, String] = asScala(p)
142142

143143
// Deprecated implicit conversions for code that directly imports them
144144

145145
/**
146146
* Adds an `asJava` method that implicitly converts a Scala `Iterator` to a Java `Iterator`.
147147
* @see [[asJavaIterator]]
148148
*/
149-
implicit def asJavaIteratorConverter[A](i : Iterator[A] | Null): AsJava[ju.Iterator[A]] =
149+
implicit def asJavaIteratorConverter[A](i : Iterator[A]): AsJava[ju.Iterator[A]] =
150150
new AsJava(asJavaIterator(i))
151151

152152
/**
153153
* Adds an `asJavaEnumeration` method that implicitly converts a Scala `Iterator` to a Java `Enumeration`.
154154
* @see [[asJavaEnumeration]]
155155
*/
156-
implicit def asJavaEnumerationConverter[A](i : Iterator[A] | Null): AsJavaEnumeration[A] =
156+
implicit def asJavaEnumerationConverter[A](i : Iterator[A]): AsJavaEnumeration[A] =
157157
new AsJavaEnumeration(i)
158158

159159
/**
160160
* Adds an `asJava` method that implicitly converts a Scala `Iterable` to a Java `Iterable`.
161161
* @see [[asJavaIterable]]
162162
*/
163-
implicit def asJavaIterableConverter[A](i : Iterable[A] | Null): AsJava[jl.Iterable[A]] =
163+
implicit def asJavaIterableConverter[A](i : Iterable[A]): AsJava[jl.Iterable[A]] =
164164
new AsJava(asJavaIterable(i))
165165

166166
/**
167167
* Adds an `asJavaCollection` method that implicitly converts a Scala `Iterable` to an immutable Java `Collection`.
168168
* @see [[asJavaCollection]]
169169
*/
170-
implicit def asJavaCollectionConverter[A](i : Iterable[A] | Null): AsJavaCollection[A] =
170+
implicit def asJavaCollectionConverter[A](i : Iterable[A]): AsJavaCollection[A] =
171171
new AsJavaCollection(i)
172172

173173
/**
174174
* Adds an `asJava` method that implicitly converts a Scala mutable `Buffer` to a Java `List`.
175175
* @see [[bufferAsJavaList]]
176176
*/
177-
implicit def bufferAsJavaListConverter[A](b : mutable.Buffer[A] | Null): AsJava[ju.List[A]] =
177+
implicit def bufferAsJavaListConverter[A](b : mutable.Buffer[A]): AsJava[ju.List[A]] =
178178
new AsJava(bufferAsJavaList(b))
179179

180180
/**
181181
* Adds an `asJava` method that implicitly converts a Scala mutable `Seq` to a Java `List`.
182182
* @see [[mutableSeqAsJavaList]]
183183
*/
184-
implicit def mutableSeqAsJavaListConverter[A](b : mutable.Seq[A] | Null): AsJava[ju.List[A]] =
184+
implicit def mutableSeqAsJavaListConverter[A](b : mutable.Seq[A]): AsJava[ju.List[A]] =
185185
new AsJava(mutableSeqAsJavaList(b))
186186

187187
/**
188188
* Adds an `asJava` method that implicitly converts a Scala `Seq` to a Java `List`.
189189
* @see [[seqAsJavaList]]
190190
*/
191-
implicit def seqAsJavaListConverter[A](b : Seq[A] | Null): AsJava[ju.List[A]] =
191+
implicit def seqAsJavaListConverter[A](b : Seq[A]): AsJava[ju.List[A]] =
192192
new AsJava(seqAsJavaList(b))
193193

194194
/**
195195
* Adds an `asJava` method that implicitly converts a Scala mutable `Set` to a Java `Set`.
196196
* @see [[mutableSetAsJavaSet]]
197197
*/
198-
implicit def mutableSetAsJavaSetConverter[A](s : mutable.Set[A] | Null): AsJava[ju.Set[A]] =
198+
implicit def mutableSetAsJavaSetConverter[A](s : mutable.Set[A]): AsJava[ju.Set[A]] =
199199
new AsJava(mutableSetAsJavaSet(s))
200200

201201
/**
202202
* Adds an `asJava` method that implicitly converts a Scala `Set` to a Java `Set`.
203203
* @see [[setAsJavaSet]]
204204
*/
205-
implicit def setAsJavaSetConverter[A](s : Set[A] | Null): AsJava[ju.Set[A]] =
205+
implicit def setAsJavaSetConverter[A](s : Set[A]): AsJava[ju.Set[A]] =
206206
new AsJava(setAsJavaSet(s))
207207

208208
/**
209209
* Adds an `asJava` method that implicitly converts a Scala mutable `Map` to a Java `Map`.
210210
* @see [[mutableMapAsJavaMap]]
211211
*/
212-
implicit def mutableMapAsJavaMapConverter[K, V](m : mutable.Map[K, V] | Null): AsJava[ju.Map[K, V]] =
212+
implicit def mutableMapAsJavaMapConverter[K, V](m : mutable.Map[K, V]): AsJava[ju.Map[K, V]] =
213213
new AsJava(mutableMapAsJavaMap(m))
214214

215215
/**
216216
* Adds an `asJavaDictionary` method that implicitly converts a Scala mutable `Map` to a Java `Dictionary`.
217217
* @see [[asJavaDictionary]]
218218
*/
219-
implicit def asJavaDictionaryConverter[K, V](m : mutable.Map[K, V] | Null): AsJavaDictionary[K, V] =
219+
implicit def asJavaDictionaryConverter[K, V](m : mutable.Map[K, V]): AsJavaDictionary[K, V] =
220220
new AsJavaDictionary(m)
221221

222222
/**
223223
* Adds an `asJava` method that implicitly converts a Scala `Map` to a Java `Map`.
224224
* @see [[mapAsJavaMap]]
225225
*/
226-
implicit def mapAsJavaMapConverter[K, V](m : Map[K, V] | Null): AsJava[ju.Map[K, V]] =
226+
implicit def mapAsJavaMapConverter[K, V](m : Map[K, V]): AsJava[ju.Map[K, V]] =
227227
new AsJava(mapAsJavaMap(m))
228228

229229
/**
230230
* Adds an `asJava` method that implicitly converts a Scala mutable `concurrent.Map` to a Java `ConcurrentMap`.
231231
* @see [[mapAsJavaConcurrentMap]].
232232
*/
233-
implicit def mapAsJavaConcurrentMapConverter[K, V](m: concurrent.Map[K, V] | Null): AsJava[juc.ConcurrentMap[K, V]] =
233+
implicit def mapAsJavaConcurrentMapConverter[K, V](m: concurrent.Map[K, V]): AsJava[juc.ConcurrentMap[K, V]] =
234234
new AsJava(mapAsJavaConcurrentMap(m))
235235

236236

237237
/**
238238
* Adds an `asScala` method that implicitly converts a Java `Iterator` to a Scala `Iterator`.
239239
* @see [[asScalaIterator]]
240240
*/
241-
implicit def asScalaIteratorConverter[A](i : ju.Iterator[A] | Null): AsScala[Iterator[A]] =
241+
implicit def asScalaIteratorConverter[A](i : ju.Iterator[A]): AsScala[Iterator[A]] =
242242
new AsScala(asScalaIterator(i))
243243

244244
/**
245245
* Adds an `asScala` method that implicitly converts a Java `Enumeration` to a Scala `Iterator`.
246246
* @see [[enumerationAsScalaIterator]]
247247
*/
248-
implicit def enumerationAsScalaIteratorConverter[A](i : ju.Enumeration[A] | Null): AsScala[Iterator[A]] =
248+
implicit def enumerationAsScalaIteratorConverter[A](i : ju.Enumeration[A]): AsScala[Iterator[A]] =
249249
new AsScala(enumerationAsScalaIterator(i))
250250

251251
/**
252252
* Adds an `asScala` method that implicitly converts a Java `Iterable` to a Scala `Iterable`.
253253
* @see [[iterableAsScalaIterable]]
254254
*/
255-
implicit def iterableAsScalaIterableConverter[A](i : jl.Iterable[A] | Null): AsScala[Iterable[A]] =
255+
implicit def iterableAsScalaIterableConverter[A](i : jl.Iterable[A]): AsScala[Iterable[A]] =
256256
new AsScala(iterableAsScalaIterable(i))
257257

258258
/**
259259
* Adds an `asScala` method that implicitly converts a Java `Collection` to an Scala `Iterable`.
260260
* @see [[collectionAsScalaIterable]]
261261
*/
262-
implicit def collectionAsScalaIterableConverter[A](i : ju.Collection[A] | Null): AsScala[Iterable[A]] =
262+
implicit def collectionAsScalaIterableConverter[A](i : ju.Collection[A]): AsScala[Iterable[A]] =
263263
new AsScala(collectionAsScalaIterable(i))
264264

265265
/**
266266
* Adds an `asScala` method that implicitly converts a Java `List` to a Scala mutable `Buffer`.
267267
* @see [[asScalaBuffer]]
268268
*/
269-
implicit def asScalaBufferConverter[A](l : ju.List[A] | Null): AsScala[mutable.Buffer[A]] =
269+
implicit def asScalaBufferConverter[A](l : ju.List[A]): AsScala[mutable.Buffer[A]] =
270270
new AsScala(asScalaBuffer(l))
271271

272272
/**
273273
* Adds an `asScala` method that implicitly converts a Java `Set` to a Scala mutable `Set`.
274274
* @see [[asScalaSet]]
275275
*/
276-
implicit def asScalaSetConverter[A](s : ju.Set[A] | Null): AsScala[mutable.Set[A]] =
276+
implicit def asScalaSetConverter[A](s : ju.Set[A]): AsScala[mutable.Set[A]] =
277277
new AsScala(asScalaSet(s))
278278

279279
/**
280280
* Adds an `asScala` method that implicitly converts a Java `Map` to a Scala mutable `Map`.
281281
* @see [[mapAsScalaMap]]
282282
*/
283-
implicit def mapAsScalaMapConverter[K, V](m : ju.Map[K, V] | Null): AsScala[mutable.Map[K, V]] =
283+
implicit def mapAsScalaMapConverter[K, V](m : ju.Map[K, V]): AsScala[mutable.Map[K, V]] =
284284
new AsScala(mapAsScalaMap(m))
285285

286286
/**
287287
* Adds an `asScala` method that implicitly converts a Java `ConcurrentMap` to a Scala mutable `concurrent.Map`.
288288
* @see [[mapAsScalaConcurrentMap]]
289289
*/
290-
implicit def mapAsScalaConcurrentMapConverter[K, V](m: juc.ConcurrentMap[K, V] | Null): AsScala[concurrent.Map[K, V]] =
290+
implicit def mapAsScalaConcurrentMapConverter[K, V](m: juc.ConcurrentMap[K, V]): AsScala[concurrent.Map[K, V]] =
291291
new AsScala(mapAsScalaConcurrentMap(m))
292292

293293
/**
294294
* Adds an `asScala` method that implicitly converts a Java `Dictionary` to a Scala mutable `Map`.
295295
* @see [[dictionaryAsScalaMap]]
296296
*/
297-
implicit def dictionaryAsScalaMapConverter[K, V](p: ju.Dictionary[K, V] | Null): AsScala[mutable.Map[K, V]] =
297+
implicit def dictionaryAsScalaMapConverter[K, V](p: ju.Dictionary[K, V]): AsScala[mutable.Map[K, V]] =
298298
new AsScala(dictionaryAsScalaMap(p))
299299

300300
/**
301301
* Adds an `asScala` method that implicitly converts a Java `Properties` to a Scala mutable `Map[String, String]`.
302302
* @see [[propertiesAsScalaMap]]
303303
*/
304-
implicit def propertiesAsScalaMapConverter(p: ju.Properties | Null): AsScala[mutable.Map[String, String]] =
304+
implicit def propertiesAsScalaMapConverter(p: ju.Properties): AsScala[mutable.Map[String, String]] =
305305
new AsScala(propertiesAsScalaMap(p))
306306

307307

308308
/** Generic class containing the `asJava` converter method */
309-
class AsJava[A](op: => A | Null) {
309+
class AsJava[A](op: => A) {
310310
/** Converts a Scala collection to the corresponding Java collection */
311-
def asJava: A | Null = op
311+
def asJava: A = op
312312
}
313313

314314
/** Generic class containing the `asScala` converter method */
315-
class AsScala[A](op: => A | Null) {
315+
class AsScala[A](op: => A) {
316316
/** Converts a Java collection to the corresponding Scala collection */
317-
def asScala: A | Null = op
317+
def asScala: A = op
318318
}
319319

320320
/** Generic class containing the `asJavaCollection` converter method */
321-
class AsJavaCollection[A](i: Iterable[A] | Null) {
321+
class AsJavaCollection[A](i: Iterable[A]) {
322322
/** Converts a Scala `Iterable` to a Java `Collection` */
323-
def asJavaCollection: ju.Collection[A] | Null = JavaConverters.asJavaCollection(i)
323+
def asJavaCollection: ju.Collection[A] = JavaConverters.asJavaCollection(i)
324324
}
325325

326326
/** Generic class containing the `asJavaEnumeration` converter method */
327-
class AsJavaEnumeration[A](i: Iterator[A] | Null) {
327+
class AsJavaEnumeration[A](i: Iterator[A]) {
328328
/** Converts a Scala `Iterator` to a Java `Enumeration` */
329-
def asJavaEnumeration: ju.Enumeration[A] | Null = JavaConverters.asJavaEnumeration(i)
329+
def asJavaEnumeration: ju.Enumeration[A] = JavaConverters.asJavaEnumeration(i)
330330
}
331331

332332
/** Generic class containing the `asJavaDictionary` converter method */
333-
class AsJavaDictionary[K, V](m : mutable.Map[K, V] | Null) {
333+
class AsJavaDictionary[K, V](m : mutable.Map[K, V]) {
334334
/** Converts a Scala `Map` to a Java `Dictionary` */
335-
def asJavaDictionary: ju.Dictionary[K, V] | Null = JavaConverters.asJavaDictionary(m)
335+
def asJavaDictionary: ju.Dictionary[K, V] = JavaConverters.asJavaDictionary(m)
336336
}
337337
}

0 commit comments

Comments
 (0)