Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4684701

The spec for StreamTokenizer.ordinaryChar('\n') is incomplete

    • b28
    • generic, sparc
    • generic, solaris_2.6

      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.

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

            shommel Scott Hommel (Inactive)
            knasunw Kna Kna (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: