Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-beta-9
-
None
-
Groovy B9
J2SE 1.5.0_1
WinXP-SP2
Description
Example:
import java.io.FileReader
f=new FileReader(inputFile)
header=f.readLine()
println "==${header}=="
f.readLines().each {
println "###"it"###"
}
only works if "f" is decorated with a BufferedReader
f=new BufferedReader(new FileReader(inputFile))
otherwise "f" misses some lines.
Cause:
DefaultGroovyMethods.readLine constructs BufferedReader of "self", if "self" is not an instance of BufferedReader.
BufferedReader does some readahead which "destroys" the FileReader contents.