I use opencsv to parse csv files, and my code is
while( (line = reader.readNext()) != null ) { .... }
I got a compiler warning saying:
You are writing Scala code they way you would write it in Java. Try doing it in a more Scala-like way. To read a text file line by line and do something with each line, try this:
import java.io.File
import scala.io.Source
Source.fromFile(new File("myfile.txt")).getLines.foreach { line =>
// Do something with the line, for example print it
println(line)
}