Harmony
  1. Harmony
  2. HARMONY-6502

[classlib][luni] String.substring does not throw StringIndexOutOfBoundsException with index

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0M15
    • Component/s: Classlib
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Novice

      Description

      Invocation of String.substring with invalid arguments does not provide the invalid index information

      e.g:

      • "HelloWorld".substring(4,1) on RI gives: java.lang.StringIndexOutOfBoundsException: String index out of range: -3
      • "HelloWorld".substring(4,1) on Harmony gives: java.lang.StringIndexOutOfBoundsException with no message, which is less useful

        Activity

        Hide
        Dinuk Weerasinghe added a comment -

        String.java - Conditional check to validate arguments and throw exception with descriptive index information

        String2Test.java - Test case added to test each branch of the conditional logic pertaining to change made to substring(int, int) of String.java

        Show
        Dinuk Weerasinghe added a comment - String.java - Conditional check to validate arguments and throw exception with descriptive index information String2Test.java - Test case added to test each branch of the conditional logic pertaining to change made to substring(int, int) of String.java
        Hide
        Tim Ellison added a comment -

        Dinuk,

        We cannot accept your patch unless you grant everyone an ASF license to use it. Please can you indicate that in the issue.
        Please also consider completing an ACQ for your contributions to the project. See http://harmony.apache.org/auth_cont_quest.html

        Show
        Tim Ellison added a comment - Dinuk, We cannot accept your patch unless you grant everyone an ASF license to use it. Please can you indicate that in the issue. Please also consider completing an ACQ for your contributions to the project. See http://harmony.apache.org/auth_cont_quest.html
        Hide
        Mark Hindess added a comment -

        Tim,

        JIRA was broken at the weekend so the "grant ASF license" button was missing when Dinuk attached his patch. I have dinuk's ACQ and ICLA but I've not had time to scan them yet.

        Dinuk,

        Can you add a comment like::

        I grant license to ASF for inclusion in ASF works (as per the Apache Software License section 5)

        to this JIRA to confirm that we can use your contribution. Thanks.

        Show
        Mark Hindess added a comment - Tim, JIRA was broken at the weekend so the "grant ASF license" button was missing when Dinuk attached his patch. I have dinuk's ACQ and ICLA but I've not had time to scan them yet. Dinuk, Can you add a comment like:: I grant license to ASF for inclusion in ASF works (as per the Apache Software License section 5) to this JIRA to confirm that we can use your contribution. Thanks.
        Hide
        Dinuk Weerasinghe added a comment -

        I grant license to ASF for inclusion in ASF works (as per the Apache Software License section 5)

        Show
        Dinuk Weerasinghe added a comment - I grant license to ASF for inclusion in ASF works (as per the Apache Software License section 5)
        Hide
        Tim Ellison added a comment -

        Thanks Dinuk,

        Patch applied to LUNI module at repo revision r954798.

        Please check it was applied as you expected.

        Show
        Tim Ellison added a comment - Thanks Dinuk, Patch applied to LUNI module at repo revision r954798. Please check it was applied as you expected.
        Hide
        Hudson added a comment -

        Integrated in Harmony-1.5-head-linux-x86_64 #854 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/854/)
        Apply patch for HARMONY-6502 ([classlib][luni] String.substring does not throw StringIndexOutOfBoundsException with index)

        Show
        Hudson added a comment - Integrated in Harmony-1.5-head-linux-x86_64 #854 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/854/ ) Apply patch for HARMONY-6502 ( [classlib] [luni] String.substring does not throw StringIndexOutOfBoundsException with index)
        Hide
        Hudson added a comment -

        Integrated in Harmony-select-1.5-head-linux-x86_64 #35 (See http://hudson.zones.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/35/)
        Apply patch for HARMONY-6502 ([classlib][luni] String.substring does not throw StringIndexOutOfBoundsException with index)

        Show
        Hudson added a comment - Integrated in Harmony-select-1.5-head-linux-x86_64 #35 (See http://hudson.zones.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/35/ ) Apply patch for HARMONY-6502 ( [classlib] [luni] String.substring does not throw StringIndexOutOfBoundsException with index)

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Dinuk Weerasinghe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development