You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Elena Sayapina (JIRA)" <ji...@apache.org> on 2007/06/06 14:44:26 UTC
[jira] Created: (HARMONY-4070) [classlib][luni] Compatibility:
StreamTokenizer.toString() returns different values on Harmony and RI if
current token is a special character like '*', ',' '-', '}', '&'
[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.
[jira] Assigned: (HARMONY-4070) [classlib][luni] Compatibility:
StreamTokenizer.toString() returns different values on Harmony and RI if
current token is a special character like '*', ',' '-', '}', '&'
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison reassigned HARMONY-4070:
------------------------------------
Assignee: Tim Ellison
> [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
> Assignee: Tim Ellison
> 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.
[jira] Resolved: (HARMONY-4070) [classlib][luni] Compatibility:
StreamTokenizer.toString() returns different values on Harmony and RI if
current token is a special character like '*', ',' '-', '}', '&'
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison resolved HARMONY-4070.
----------------------------------
Resolution: Fixed
Thanks Elena.
Fixed in LUNI module at repo revision r598681.
Please check that this resolves the issue for you.
> [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
> Assignee: Tim Ellison
> 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.
[jira] Commented: (HARMONY-4070) [classlib][luni] Compatibility:
StreamTokenizer.toString() returns different values on Harmony and RI if
current token is a special character like '*', ',' '-', '}', '&'
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548266 ]
Tim Ellison commented on HARMONY-4070:
--------------------------------------
Thanks for the fix Stepan.
> [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
> Assignee: Tim Ellison
> 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.
[jira] Updated: (HARMONY-4070) [classlib][luni] Compatibility:
StreamTokenizer.toString() returns different values on Harmony and RI if
current token is a special character like '*', ',' '-', '}', '&'
Posted by "Elena Sayapina (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Elena Sayapina updated HARMONY-4070:
------------------------------------
Attachment: tokenizerTest2.java
> [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.
[jira] Commented: (HARMONY-4070) [classlib][luni] Compatibility:
StreamTokenizer.toString() returns different values on Harmony and RI if
current token is a special character like '*', ',' '-', '}', '&'
Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546126 ]
Stepan Mishura commented on HARMONY-4070:
-----------------------------------------
A quick fix for commit r598681 was done in LUNI module at r598874. Please verify if the fix works for you
The r598681 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)
> [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
> Assignee: Tim Ellison
> 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.