6
我想參數映射,從一個ServletRequest到斯卡拉地圖斯卡拉轉換2.9.0.1:如何將java.util.Collections.unmodifiableMap轉換爲不可變的Scala Map?
val params = request.getParameterMap.asInstanceOf[Map[String, Array[String]]]
我已經導入collection.JavaConversions._,並在運行時,這是拋出:
java.lang.ClassCastException: java.util.Collections$UnmodifiableMap cannot be cast to scala.collection.immutable.Map