You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/01/16 02:20:54 UTC

[jira] Created: (HTTPCORE-213) CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes unnecessarily

CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes unnecessarily
------------------------------------------------------------------------------------

                 Key: HTTPCORE-213
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-213
             Project: HttpComponents HttpCore
          Issue Type: Sub-task
            Reporter: Sebb
            Priority: Minor


CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes before invoking the String constructor, which also checks the indexes.

String throws StringIndexOutOfBoundsException which is a subclass of IndexOutOfBoundsException.
Code that catches IOOBE would also catch SIOOBE.

If it was desired to maintain exact compatibilty then the exception could be caught and transformed.

But in any case the checks could be removed.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCORE-213) CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes unnecessarily

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved HTTPCORE-213.
---------------------------

    Resolution: Fixed


URL: http://svn.apache.org/viewvc?rev=899947&view=rev
Log:
HTTPCORE-213 CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes unnecessarily

Modified:
   httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/CharArrayBuffer.java


> CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes unnecessarily
> ------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-213
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-213
>             Project: HttpComponents HttpCore
>          Issue Type: Sub-task
>            Reporter: Sebb
>            Priority: Minor
>
> CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes before invoking the String constructor, which also checks the indexes.
> String throws StringIndexOutOfBoundsException which is a subclass of IndexOutOfBoundsException.
> Code that catches IOOBE would also catch SIOOBE.
> If it was desired to maintain exact compatibilty then the exception could be caught and transformed.
> But in any case the checks could be removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-213) CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes unnecessarily

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801148#action_12801148 ] 

Oleg Kalnichevski commented on HTTPCORE-213:
--------------------------------------------

Good catch. Just remove the checks. 

Oleg

> CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes unnecessarily
> ------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-213
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-213
>             Project: HttpComponents HttpCore
>          Issue Type: Sub-task
>            Reporter: Sebb
>            Priority: Minor
>
> CharArrayBuffer.substring(int beginIndex, int endIndex) checks indexes before invoking the String constructor, which also checks the indexes.
> String throws StringIndexOutOfBoundsException which is a subclass of IndexOutOfBoundsException.
> Code that catches IOOBE would also catch SIOOBE.
> If it was desired to maintain exact compatibilty then the exception could be caught and transformed.
> But in any case the checks could be removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org