Hello All,
I am using IDEA 15.0.4 to debug a scala program. It is strange to me that the results were different when I debug or run the program. The differences can be seen in the attached filed run.jpg and debug.jpg. The code lines of the scala program are shown below. Thank you all ------- import scala.collection.mutable.ArrayBuffer object TestCase1{ def func(testtttt:Iterator[(Int,Long)]): Iterator[(Int,Long)]={ println("in") val testtttt1=testtttt.flatmap{ case(item,count)=> val newPrefix=item println(count) val a=Iterator.single((newPrefix,count)) func(a) val c = a c } testtttt1 } def main(args: Array[String]){ val freqItems = ArrayBuffer((2,3L),(3,2L),(4,1L)) val testtttt = freqItems.toIterator val result = func(testtttt) val reer = result.toArray } }