harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elena Sayapina (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4070) [classlib][luni] Compatibility: StreamTokenizer.toString() returns different values on Harmony and RI if current token is a special character like '*', ',' '-', '}', '&'
Date Wed, 06 Jun 2007 12:44:26 GMT
[classlib][luni] Compatibility: StreamTokenizer.toString() returns different values on Harmony
and RI if current token is a special character like '*', ',' '-', '}', '&'
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4070
                 URL: https://issues.apache.org/jira/browse/HARMONY-4070
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Elena Sayapina
            Priority: Trivial
         Attachments: tokenizerTest2.java

StreamTokenizer.toString() returns different values on Harmony and RI if current token is
a special character like '*', ',' '-', '}', '&' ... 
Harmony returns Token[null], line number,  while RI returns Token[null], line number. 

Please, consider the following code: 

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StreamTokenizer;

public class tokenizerTest2 {

	public static void main(String[] args) throws IOException {
	    byte[] data = new byte[] {(byte) '-'};
	    StreamTokenizer tokenizer = new StreamTokenizer(new ByteArrayInputStream(data));
	    tokenizer.nextToken();
	    String result = tokenizer.toString();
	    System.out.println("tokenizer.toString(): " + result);   
	    if(result.equals("Token['-'], line 1")) System.out.println("TEST PASSED");
	    else System.out.println("TEST FAILED");
	}
}

Output on Harmony-r544727: 

Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
http://harmony.apache.org
tokenizer.toString(): Token[null], line 1
TEST FAILED

Output on HotSpot: 
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

tokenizer.toString(): Token['-'], line 1
TEST PASSED

Note that it may be a regression caused by HARMONY-3880 fix applied at r542433, 
because tokenizerTest2 output on Harmony-r542415 is: 

Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r542415, (May 29 2007), Windows/ia32/msvc 1310, release build
http://incubator.apache.org/harmony
tokenizer.toString(): Token['-'], line 1
TEST PASSED

Please, use attached tokenizerTest2.java for the issue reproducing.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message