Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/13211#discussion_r64019450
--- Diff: core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala ---
@@ -437,7 +437,11 @@ class ListAccumulator[T] extends AccumulatorV2[T,
java.util.List[T]] {
s"Cannot merge ${this.getClass.getName} with
${other.getClass.getName}")
}
- override def value: java.util.List[T] =
java.util.Collections.unmodifiableList(_list)
+ override def value: java.util.List[T] = _list.synchronized {
+ val newList = new java.util.ArrayList[T]
--- End diff --
Why not go ahead and import the java classes? use a rename to disambiguate
list. Or leave java.util.List alone but import the others?
Just `java.util.Collections.unmodifiableList(new
java.util.ArrayList(_list))` should be better
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]