@@ -81,257 +81,257 @@ import scala.language.implicitConversions
81
81
@ deprecated(" Use `scala.jdk.CollectionConverters` instead" , " 2.13.0" )
82
82
object JavaConverters extends AsJavaConverters with AsScalaConverters {
83
83
@ 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)
85
85
86
86
@ 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)
88
88
89
89
@ 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)
91
91
92
92
@ 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)
94
94
95
95
@ 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)
97
97
98
98
@ 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)
100
100
101
101
@ 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)
103
103
104
104
@ 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)
106
106
107
107
@ 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)
109
109
110
110
@ 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)
112
112
113
113
@ 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)
115
115
116
116
@ 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)
118
118
119
119
@ 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)
121
121
122
122
@ 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)
124
124
125
125
@ 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)
127
127
128
128
@ 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)
130
130
131
131
@ 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)
133
133
134
134
@ 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)
136
136
137
137
@ 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)
139
139
140
140
@ 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)
142
142
143
143
// Deprecated implicit conversions for code that directly imports them
144
144
145
145
/**
146
146
* Adds an `asJava` method that implicitly converts a Scala `Iterator` to a Java `Iterator`.
147
147
* @see [[asJavaIterator ]]
148
148
*/
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 ]] =
150
150
new AsJava (asJavaIterator(i))
151
151
152
152
/**
153
153
* Adds an `asJavaEnumeration` method that implicitly converts a Scala `Iterator` to a Java `Enumeration`.
154
154
* @see [[asJavaEnumeration ]]
155
155
*/
156
- implicit def asJavaEnumerationConverter [A ](i : Iterator [A ] | Null ): AsJavaEnumeration [A ] =
156
+ implicit def asJavaEnumerationConverter [A ](i : Iterator [A ]): AsJavaEnumeration [A ] =
157
157
new AsJavaEnumeration (i)
158
158
159
159
/**
160
160
* Adds an `asJava` method that implicitly converts a Scala `Iterable` to a Java `Iterable`.
161
161
* @see [[asJavaIterable ]]
162
162
*/
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 ]] =
164
164
new AsJava (asJavaIterable(i))
165
165
166
166
/**
167
167
* Adds an `asJavaCollection` method that implicitly converts a Scala `Iterable` to an immutable Java `Collection`.
168
168
* @see [[asJavaCollection ]]
169
169
*/
170
- implicit def asJavaCollectionConverter [A ](i : Iterable [A ] | Null ): AsJavaCollection [A ] =
170
+ implicit def asJavaCollectionConverter [A ](i : Iterable [A ]): AsJavaCollection [A ] =
171
171
new AsJavaCollection (i)
172
172
173
173
/**
174
174
* Adds an `asJava` method that implicitly converts a Scala mutable `Buffer` to a Java `List`.
175
175
* @see [[bufferAsJavaList ]]
176
176
*/
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 ]] =
178
178
new AsJava (bufferAsJavaList(b))
179
179
180
180
/**
181
181
* Adds an `asJava` method that implicitly converts a Scala mutable `Seq` to a Java `List`.
182
182
* @see [[mutableSeqAsJavaList ]]
183
183
*/
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 ]] =
185
185
new AsJava (mutableSeqAsJavaList(b))
186
186
187
187
/**
188
188
* Adds an `asJava` method that implicitly converts a Scala `Seq` to a Java `List`.
189
189
* @see [[seqAsJavaList ]]
190
190
*/
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 ]] =
192
192
new AsJava (seqAsJavaList(b))
193
193
194
194
/**
195
195
* Adds an `asJava` method that implicitly converts a Scala mutable `Set` to a Java `Set`.
196
196
* @see [[mutableSetAsJavaSet ]]
197
197
*/
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 ]] =
199
199
new AsJava (mutableSetAsJavaSet(s))
200
200
201
201
/**
202
202
* Adds an `asJava` method that implicitly converts a Scala `Set` to a Java `Set`.
203
203
* @see [[setAsJavaSet ]]
204
204
*/
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 ]] =
206
206
new AsJava (setAsJavaSet(s))
207
207
208
208
/**
209
209
* Adds an `asJava` method that implicitly converts a Scala mutable `Map` to a Java `Map`.
210
210
* @see [[mutableMapAsJavaMap ]]
211
211
*/
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 ]] =
213
213
new AsJava (mutableMapAsJavaMap(m))
214
214
215
215
/**
216
216
* Adds an `asJavaDictionary` method that implicitly converts a Scala mutable `Map` to a Java `Dictionary`.
217
217
* @see [[asJavaDictionary ]]
218
218
*/
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 ] =
220
220
new AsJavaDictionary (m)
221
221
222
222
/**
223
223
* Adds an `asJava` method that implicitly converts a Scala `Map` to a Java `Map`.
224
224
* @see [[mapAsJavaMap ]]
225
225
*/
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 ]] =
227
227
new AsJava (mapAsJavaMap(m))
228
228
229
229
/**
230
230
* Adds an `asJava` method that implicitly converts a Scala mutable `concurrent.Map` to a Java `ConcurrentMap`.
231
231
* @see [[mapAsJavaConcurrentMap ]].
232
232
*/
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 ]] =
234
234
new AsJava (mapAsJavaConcurrentMap(m))
235
235
236
236
237
237
/**
238
238
* Adds an `asScala` method that implicitly converts a Java `Iterator` to a Scala `Iterator`.
239
239
* @see [[asScalaIterator ]]
240
240
*/
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 ]] =
242
242
new AsScala (asScalaIterator(i))
243
243
244
244
/**
245
245
* Adds an `asScala` method that implicitly converts a Java `Enumeration` to a Scala `Iterator`.
246
246
* @see [[enumerationAsScalaIterator ]]
247
247
*/
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 ]] =
249
249
new AsScala (enumerationAsScalaIterator(i))
250
250
251
251
/**
252
252
* Adds an `asScala` method that implicitly converts a Java `Iterable` to a Scala `Iterable`.
253
253
* @see [[iterableAsScalaIterable ]]
254
254
*/
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 ]] =
256
256
new AsScala (iterableAsScalaIterable(i))
257
257
258
258
/**
259
259
* Adds an `asScala` method that implicitly converts a Java `Collection` to an Scala `Iterable`.
260
260
* @see [[collectionAsScalaIterable ]]
261
261
*/
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 ]] =
263
263
new AsScala (collectionAsScalaIterable(i))
264
264
265
265
/**
266
266
* Adds an `asScala` method that implicitly converts a Java `List` to a Scala mutable `Buffer`.
267
267
* @see [[asScalaBuffer ]]
268
268
*/
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 ]] =
270
270
new AsScala (asScalaBuffer(l))
271
271
272
272
/**
273
273
* Adds an `asScala` method that implicitly converts a Java `Set` to a Scala mutable `Set`.
274
274
* @see [[asScalaSet ]]
275
275
*/
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 ]] =
277
277
new AsScala (asScalaSet(s))
278
278
279
279
/**
280
280
* Adds an `asScala` method that implicitly converts a Java `Map` to a Scala mutable `Map`.
281
281
* @see [[mapAsScalaMap ]]
282
282
*/
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 ]] =
284
284
new AsScala (mapAsScalaMap(m))
285
285
286
286
/**
287
287
* Adds an `asScala` method that implicitly converts a Java `ConcurrentMap` to a Scala mutable `concurrent.Map`.
288
288
* @see [[mapAsScalaConcurrentMap ]]
289
289
*/
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 ]] =
291
291
new AsScala (mapAsScalaConcurrentMap(m))
292
292
293
293
/**
294
294
* Adds an `asScala` method that implicitly converts a Java `Dictionary` to a Scala mutable `Map`.
295
295
* @see [[dictionaryAsScalaMap ]]
296
296
*/
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 ]] =
298
298
new AsScala (dictionaryAsScalaMap(p))
299
299
300
300
/**
301
301
* Adds an `asScala` method that implicitly converts a Java `Properties` to a Scala mutable `Map[String, String]`.
302
302
* @see [[propertiesAsScalaMap ]]
303
303
*/
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 ]] =
305
305
new AsScala (propertiesAsScalaMap(p))
306
306
307
307
308
308
/** Generic class containing the `asJava` converter method */
309
- class AsJava [A ](op : => A | Null ) {
309
+ class AsJava [A ](op : => A ) {
310
310
/** Converts a Scala collection to the corresponding Java collection */
311
- def asJava : A | Null = op
311
+ def asJava : A = op
312
312
}
313
313
314
314
/** Generic class containing the `asScala` converter method */
315
- class AsScala [A ](op : => A | Null ) {
315
+ class AsScala [A ](op : => A ) {
316
316
/** Converts a Java collection to the corresponding Scala collection */
317
- def asScala : A | Null = op
317
+ def asScala : A = op
318
318
}
319
319
320
320
/** Generic class containing the `asJavaCollection` converter method */
321
- class AsJavaCollection [A ](i : Iterable [A ] | Null ) {
321
+ class AsJavaCollection [A ](i : Iterable [A ]) {
322
322
/** 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)
324
324
}
325
325
326
326
/** Generic class containing the `asJavaEnumeration` converter method */
327
- class AsJavaEnumeration [A ](i : Iterator [A ] | Null ) {
327
+ class AsJavaEnumeration [A ](i : Iterator [A ]) {
328
328
/** 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)
330
330
}
331
331
332
332
/** 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 ]) {
334
334
/** 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)
336
336
}
337
337
}
0 commit comments