Harmony
  1. Harmony
  2. HARMONY-858

Exception throwing compatibility: java.util.Scanner.nextInt(int radix)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      For the method java.util.Scanner.nextInt(int radix).

      When (radix < Character.MIN_RADIX ) or (radix > Character.MAX_RADIX), Harmony always throws IllegalArgumentException. But RI behaves differently:

      • If the parameter is less than 0 or greater than 36, RI throws a
        StringIndexOutOfBoundsException.
      • If the parameter equals 1, RI throws an InputMismatchException
        with an additional information "The radix 1 is less than the
        Character.MIN_RADIX".
      • If the parameter equals 0, RI throws a
        java.util.regex.PatternSyntaxException

      Please refer to the thread at mail-list harmony-dev: http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg09758.html

        Activity

        Hide
        Tony Wu added a comment -

        should be closed according discussion in link above

        Show
        Tony Wu added a comment - should be closed according discussion in link above
        Hide
        Paulex Yang added a comment -

        Verified in dev-list as Non-Bug Difference with RI.

        Show
        Paulex Yang added a comment - Verified in dev-list as Non-Bug Difference with RI.

          People

          • Assignee:
            Paulex Yang
            Reporter:
            Richard Liang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development