harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r598874 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java
Date Wed, 28 Nov 2007 05:54:08 GMT
Author: smishura
Date: Tue Nov 27 21:54:00 2007
New Revision: 598874

URL: http://svn.apache.org/viewvc?rev=598874&view=rev
Log:
Quick fix for commit r598681:
Fix for HARMONY-4070 ([classlib][luni] Compatibility: StreamTokenizer.toString() returns different
values on Harmony and RI if current token is a special character like '*', ',' '-', '}', '&')

The commit cause the next test to fail:
    (new StreamTokenizer(new StringReader(""))).toString()
with:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Array index out of range:
-4
        at java.io.StreamTokenizer.toString(StreamTokenizer.java:610)

The regression was found by:
Test:  testHandleUnexpectedToken 
Class:  org.apache.harmony.security.DefaultPolicyScannerTest 
 java.lang.ArrayIndexOutOfBoundsException   
 at java.io.StreamTokenizer.toString(StreamTokenizer.java:610)   
 at org.apache.harmony.security.DefaultPolicyScanner.composeStatus(DefaultPolicyScanner.java:365)
  
 at org.apache.harmony.security.DefaultPolicyScanner.handleUnexpectedToken(DefaultPolicyScanner.java:394)
  
 at org.apache.harmony.security.DefaultPolicyScannerTest.testHandleUnexpectedToken(DefaultPolicyScannerTest.java:173)
  
 at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java) 

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java?rev=598874&r1=598873&r2=598874&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java
Tue Nov 27 21:54:00 2007
@@ -607,7 +607,7 @@
                 result.append(sval);
                 break;
             default:
-                if (tokenTypes[ttype] == TOKEN_QUOTE) {
+                if (ttype == TT_UNKNOWN || tokenTypes[ttype] == TOKEN_QUOTE) {
                     result.append(sval);
                 } else {
                     result.append('\'');



Mime
View raw message