@@ -50,16 +50,16 @@ class LinkedHashMap[K, V]
50
50
51
51
private [collection] def _firstEntry : Entry = firstEntry
52
52
53
- @ transient protected var firstEntry : Entry = null
53
+ protected var firstEntry : Entry = null
54
54
55
- @ transient protected var lastEntry : Entry = null
55
+ protected var lastEntry : Entry = null
56
56
57
57
/* Uses the same implementation as mutable.HashMap. The hashtable holds the following invariant:
58
58
* - For each i between 0 and table.length, the bucket at table(i) only contains keys whose hash-index is i.
59
59
* - Every bucket is sorted in ascendant hash order
60
60
* - The sum of the lengths of all buckets is equal to contentSize.
61
61
*/
62
- @ transient private [this ] var table = new Array [Entry ](tableSizeFor(LinkedHashMap .defaultinitialSize))
62
+ private [this ] var table = new Array [Entry ](tableSizeFor(LinkedHashMap .defaultinitialSize))
63
63
64
64
private [this ] var threshold : Int = newThreshold(table.length)
65
65
@@ -394,42 +394,6 @@ class LinkedHashMap[K, V]
394
394
}
395
395
}
396
396
397
- private [this ] def serializeTo (out : java.io.ObjectOutputStream , writeEntry : Entry => Unit ): Unit = {
398
- out.writeInt(contentSize)
399
- var cur = firstEntry
400
- while (cur ne null ) {
401
- writeEntry(cur)
402
- cur = cur.later
403
- }
404
- }
405
-
406
- private def writeObject (out : java.io.ObjectOutputStream ): Unit = {
407
- out.defaultWriteObject()
408
- serializeTo(out, { entry =>
409
- out.writeObject(entry.key)
410
- out.writeObject(entry.value)
411
- })
412
- }
413
-
414
- private [this ] def serializeFrom (in : java.io.ObjectInputStream , readEntry : => (K , V )): Unit = {
415
- val _contentsize = in.readInt()
416
- assert(_contentsize > 0 )
417
- clear()
418
- table = new Array (tableSizeFor(_contentsize))
419
- threshold = newThreshold(table.length)
420
-
421
- var index = 0
422
- while (index < size) {
423
- addOne(readEntry)
424
- index += 1
425
- }
426
- }
427
-
428
- private def readObject (in : java.io.ObjectInputStream ): Unit = {
429
- in.defaultReadObject()
430
- serializeFrom(in, (in.readObject().asInstanceOf [K ], in.readObject().asInstanceOf [V ]))
431
- }
432
-
433
397
@ nowarn(""" cat=deprecation&origin=scala\.collection\.Iterable\.stringPrefix""" )
434
398
override protected [this ] def stringPrefix = " LinkedHashMap"
435
399
}
0 commit comments