Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions core/src/main/scala/org/apache/spark/api/r/JVMObjectTracker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ private[r] class JVMObjectTracker {
/**
* Returns the JVM object associated with the input key or None if not found.
*/
final def get(id: JVMObjectId): Option[Object] = this.synchronized {
if (objMap.containsKey(id)) {
Some(objMap.get(id))
} else {
None
}
}
final def get(id: JVMObjectId): Option[Object] = Option(objMap.get(id))

/**
* Returns the JVM object associated with the input key or throws an exception if not found.
Expand All @@ -67,13 +61,7 @@ private[r] class JVMObjectTracker {
/**
* Removes and returns a JVM object with the specific ID from the tracker, or None if not found.
*/
final def remove(id: JVMObjectId): Option[Object] = this.synchronized {
if (objMap.containsKey(id)) {
Some(objMap.remove(id))
} else {
None
}
}
final def remove(id: JVMObjectId): Option[Object] = Option(objMap.remove(id))

/**
* Number of JVM objects being tracked.
Expand Down