Skip to content

Commit

Permalink
Fixing compilation in Scala 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Kudinkin committed Aug 12, 2022
1 parent c349166 commit 2639146
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ import scala.collection.JavaConverters
object HoodieConversionUtils {

/**
* Converts Java's [[ju.Map]] into Scala's (immutable) [[Map]] (by defautl [[JavaConverters]] convert to
* Converts Java's [[ju.Map]] into Scala's (immutable) [[Map]] (by default [[JavaConverters]] convert to
* a mutable one)
*/
def mapAsScalaImmutableMap[K, V](map: ju.Map[K, V]): Map[K, V] =
JavaConverters.mapAsScalaMap(map).toMap
def mapAsScalaImmutableMap[K, V](map: ju.Map[K, V]): Map[K, V] = {
// NOTE: We have to use deprecated [[JavaConversions]] to stay compatible w/ Scala 2.11
import scala.collection.JavaConversions.`deprecated mapAsScalaMap`
map.toMap
}

def toJavaOption[T](opt: Option[T]): org.apache.hudi.common.util.Option[T] =
if (opt.isDefined) org.apache.hudi.common.util.Option.of(opt.get) else org.apache.hudi.common.util.Option.empty()
Expand Down

0 comments on commit 2639146

Please sign in to comment.