Github user mateiz commented on a diff in the pull request: https://github.com/apache/spark/pull/141#discussion_r10619938 --- Diff: core/src/main/scala/org/apache/spark/util/MutablePair.scala --- @@ -25,10 +25,20 @@ package org.apache.spark.util * @param _2 Element 2 of this MutablePair */ case class MutablePair[@specialized(Int, Long, Double, Char, Boolean/*, AnyRef*/) T1, - @specialized(Int, Long, Double, Char, Boolean/*, AnyRef*/) T2] + @specialized(Int, Long, Double, Char, Boolean/*, AnyRef*/) T2] (var _1: T1, var _2: T2) extends Product2[T1, T2] { + /** No-arg constructor for serialization */ + def this() = this(null.asInstanceOf[T1], null.asInstanceOf[T2]) + + /** Updates this pair with new values and returns itself */ + def apply(n1: T1, n2: T2): MutablePair[T1, T2] = { --- End diff -- Is this really a good idea? `apply` usually does not modify the object you called it on. Maybe we should call this `set` or `update`.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---