harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r763861 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Scanner.java
Date Fri, 10 Apr 2009 03:18:15 GMT
Author: qiuxx
Date: Fri Apr 10 03:18:14 2009
New Revision: 763861

URL: http://svn.apache.org/viewvc?rev=763861&view=rev
Log:
Apply for HARMONY-6086,([luni] java.util.Scanner nextLine and hasNextLine testcase would fail)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Scanner.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Scanner.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Scanner.java?rev=763861&r1=763860&r2=763861&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Scanner.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Scanner.java Fri
Apr 10 03:18:14 2009
@@ -818,9 +818,11 @@
         boolean hasNextLine = false;
         while (true) {
             if (matcher.find()) {
-                matchSuccessful = true;
-                hasNextLine = true;
-                break;
+                if (inputExhausted || matcher.end() != bufferLength) {
+                    matchSuccessful = true;
+                    hasNextLine = true;
+                    break;
+                }
             } else {
                 if (inputExhausted) {
                     matchSuccessful = false;
@@ -1392,10 +1394,12 @@
         String result = null;
         while (true) {
             if (matcher.find()) {
-                matchSuccessful = true;
-                findStartIndex = matcher.end();
-                result = matcher.group();
-                break;
+                if (inputExhausted || matcher.end() != bufferLength) {
+                    matchSuccessful = true;
+                    findStartIndex = matcher.end();
+                    result = matcher.group();
+                    break;
+                }
             } else {
                 if (inputExhausted) {
                     matchSuccessful = false;



Mime
View raw message