[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: [jira] [Comment Edited] (LANG-990) Avoid String allocation in StrBuilder.append(CharSequence)
From: "Sebb (JIRA)" <jira () apache ! org>
Date: 2014-03-30 11:30:18
Message-ID: JIRA.12702807.1395375000984.32877.1396179018061 () arcas
[Download RAW message or body]
[ https://issues.apache.org/jira/browse/LANG-990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13954657#comment-13954657 \
]
Sebb edited comment on LANG-990 at 3/30/14 11:29 AM:
-----------------------------------------------------
The StringIndexOutOfBoundsException messages ought to include details of the \
incorrect parameters
was (Author: sebb@apache.org):
The StringIndexOutOfBoundsException messages ought to include details of the \
incorrect paramaters
> Avoid String allocation in StrBuilder.append(CharSequence)
> ----------------------------------------------------------
>
> Key: LANG-990
> URL: https://issues.apache.org/jira/browse/LANG-990
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.text.*
> Affects Versions: 3.3.1
> Reporter: Mikhail Mazursky
> Fix For: Patch Needed
>
> Attachments: LANG-990-v2.patch, LANG-990-v3.patch, LANG-990.patch
>
>
> StrBuilder.append(CharSequence) and StrBuilder.append(CharSequence, int, int) can \
> be optimized for the case when CharBuffer is passed. Current implementation calls \
> toString() method that allocates a new String. In case when CharBuffer.hasArray() \
> returns true the buffer-backing char array can be accessed directly to copy chars \
> from it. Also an instanceOf StrBuilder check can be added to \
> StrBuilder.append(CharSequence) and StrBuilder.append(CharSequence, int, int) to \
> avoid toString() in that case too (StrBuilder can be passed as CharSequence in some \
> cases).
--
This message was sent by Atlassian JIRA
(v6.2#6252)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic