Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4063511

java.io.LineNumberReader class get wrong lineNumber while skip out of file

XMLWordPrintable

    • 1.2beta3
    • generic
    • generic
    • Not verified

      When I use java.io.LineNumberReader class, I found that if I skip out of the file I got the wrong Line Number of the file. When I browse the souce file (java/io/LineNumberReader.java jdk1.1.3 & jdk1.1.1) I found that at line 117, method public int read(char cbuf[],int off,int len) throws ...:the method call super class to read chars, and get the number of bytes read to variable n. but when this culculate the lines, it use len instead of n. so when I skip off the file, n does not equals to len, the mistake then occur.

            zlisunw Zhenghua Li (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: