The recommendation is to use JavaConverters , not JavaConversions :
import collection.JavaConverters._ import scala.collection.breakOut val l: List[Double] = j.asScala.map(_.doubleValue)(breakOut)
doubleValue converts it from a java.lang.Double to scala.Double . breakOut reports that it creates a List as a result of the map , without going any other time to convert it to a List . You can also just do toList instead of breakOut if you don't need an extra workaround.
Java classes are completely different objects from Scala; it's not just a name change. Thus, it would be impossible to convert without going through. You need to create a completely new collection, and then look at each item to (transform it and) move it.
The reason these types are different is because java.lang.Double is a "boxed primitive", whereas scala.Double is equivalent to a double Java primitive. The transformation here is essentially the "unboxing" of the primitive.
source share