Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 7cfd426d9 -> e30e86cb9


GROOVY-8467: IOGroovyMethods readLine(Reader) method works in unexpected way


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/e30e86cb
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/e30e86cb
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/e30e86cb

Branch: refs/heads/GROOVY_2_5_X
Commit: e30e86cb927ac0e742d1624c8bd076ac2b9102a8
Parents: 16b532f
Author: paulk <pa...@asert.com.au>
Authored: Thu Feb 8 22:57:28 2018 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu Feb 8 23:03:46 2018 +1000

----------------------------------------------------------------------
 .../java/org/codehaus/groovy/runtime/IOGroovyMethods.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/e30e86cb/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java 
b/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
index 5fd2ef1..f65c85f 100644
--- a/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
@@ -636,11 +636,19 @@ public class IOGroovyMethods extends 
DefaultGroovyMethodsSupport {
     }
 
     /**
-     * Read a single, whole line from the given Reader.
+     * Read a single, whole line from the given Reader. This method is 
designed for use with
+     * Readers that support the {@code mark()} operation like BufferReader. It 
has a fallback
+     * behavior for Readers that don't support mark() but the behavior doesn't 
correctly
+     * detect multi-character line termination (e.g. carriage return followed 
by linefeed).
+     * We recommend for Readers that don't support mark() you consider using 
one of the
+     * following methods instead: eachLine, readLines, or iterator.
      *
      * @param self a Reader
      * @return a line
      * @throws IOException if an IOException occurs.
+     * @see #readLines(java.io.Reader)
+     * @see #iterator(java.io.Reader)
+     * @see #eachLine(java.io.Reader, groovy.lang.Closure)
      * @since 1.0
      */
     public static String readLine(Reader self) throws IOException {

Reply via email to