United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4684701 The spec for StreamTokenizer.ordinaryChar('\n') is incomplete
JDK-4684701 : The spec for StreamTokenizer.ordinaryChar('\n') is incomplete

Details
Type:
Bug
Submit Date:
2002-05-14
Status:
Resolved
Updated Date:
2004-09-20
Project Name:
JDK
Resolved Date:
2004-09-20
Component:
docs
OS:
solaris_2.6,generic
Sub-Component:
guides
CPU:
sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0,5.0
Fixed Versions:
5.0 (b28)

Related Reports

Sub Tasks

Description
Name: nkR10003			Date: 05/14/2002



Setting '\n' to be an ordinary makes behaivior of StreamTokenizer 
unpredictable. It still works like EOL terminator but does not encrease 
line number. The JavaDoc comments for ordinaryChar() says that:
"...
It removes any special significance the character has as a comment character,
word component, string delimiter, white space, or number character...
"
One can say that it does not imply that setting '\n' to be an ordinary 
character should change its treatment as an EOL marker, but it remains
unclear why it does not increase line number though.

Even if current behaivior is correct, the spec should be corrected to reflect
this rather questionable behaivior.

======================================================================

                                    

Comments
EVALUATION

Engineering has suggested the following fix:

    /**
     * Specifies that the character argument is "ordinary"
     * in this tokenizer. It removes any special significance the
     * character has as a comment character, word component, string
     * delimiter, white space, or number character. When such a character
     * is encountered by the parser, the parser treates it as a
     * single-character token and sets <code>ttype</code> field to the
     * character value.
     *
     * <p>Making a line terminator character "ordinary" may interfere
     * with the ability of a <code>StreamTokenizer</code> to count
     * lines. The <code>lineno</code> method may no longer reflect
     * the presence of such terminator characters in its line count.
     *
     * @param   ch   the character.
     * @see     java.io.StreamTokenizer#ttype
     */

###@###.### 2003-09-10
                                     
2003-09-10
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
generic
tiger-beta

FIXED IN:
tiger
tiger-beta

INTEGRATED IN:
tiger-b28
tiger-beta

VERIFIED IN:
1.5.0_01


                                     
2004-09-22



Hardware and Software, Engineered to Work Together