Harmony
  1. Harmony
  2. HARMONY-6142

[classlib][luni] java.util.StringTokenizer.nextToken(String delim) should throw NullPointerException when the given delim is null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M8
    • Fix Version/s: 5.0M9
    • Component/s: Classlib
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      The java spec says that the nextToken(String delim) method should throw NullPointerException when the given delim is null.
      It seems that HY doesn't have this feature implemented here.

        Activity

        Hide
        Kevin Zhou added a comment -

        Given a test case [1], RI passes while HY fails on it.

        [1] Test Case:
        public void test_nextTokenLjava_lang_String() {
        StringTokenizer stringTokenizer = new StringTokenizer(new String());
        try

        { stringTokenizer.nextToken(null); fail("should throw NullPointerException"); }

        catch (NullPointerException e)

        { // Expected }

        }

        Show
        Kevin Zhou added a comment - Given a test case [1] , RI passes while HY fails on it. [1] Test Case: public void test_nextTokenLjava_lang_String() { StringTokenizer stringTokenizer = new StringTokenizer(new String()); try { stringTokenizer.nextToken(null); fail("should throw NullPointerException"); } catch (NullPointerException e) { // Expected } }
        Hide
        Kevin Zhou added a comment -

        Would you please help to try it?

        Show
        Kevin Zhou added a comment - Would you please help to try it?
        Hide
        Tim Ellison added a comment -

        Thanks Kevin.

        Patch applied to LUNI module at repo revision r768935.

        Please check it was applied as you expected.

        Show
        Tim Ellison added a comment - Thanks Kevin. Patch applied to LUNI module at repo revision r768935. Please check it was applied as you expected.
        Hide
        Kevin Zhou added a comment -

        Thanks, Tim.

        Show
        Kevin Zhou added a comment - Thanks, Tim.

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Kevin Zhou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development