[ 
https://issues.apache.org/jira/browse/LANG-1523?focusedWorklogId=399870&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-399870
 ]

ASF GitHub Bot logged work on LANG-1523:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Mar/20 15:28
            Start Date: 08/Mar/20 15:28
    Worklog Time Spent: 10m 
      Work Description: RameshDhungel commented on issue #496: LANG-1523: Avoid 
unnecessary allocation in StringUtils.wrapIfMissing.
URL: https://github.com/apache/commons-lang/pull/496#issuecomment-596217584
 
 
   Hello, I just saw this issue in Jira, and if I understand the issue 
correctly. The  StringUtils.wrapIfMissing is making a StringBuilder even when a 
string is already wrapped for example Str "xabx" with wrapper "x". Rather than 
not creating a instance of String Builder. What we can do is check if the 
string is already wrapped, if so then just return the String. This would avoid 
the String Builder being created.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 399870)
    Time Spent: 50m  (was: 40m)

> Avoid unnecessary allocation in StringUtils.wrapIfMissing
> ---------------------------------------------------------
>
>                 Key: LANG-1523
>                 URL: https://issues.apache.org/jira/browse/LANG-1523
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.9
>            Reporter: Edgar Asatryan
>            Priority: Major
>             Fix For: 3.10
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The *StringUtils.wrapIfMissing* creates a new instance of *StringBuilder* 
> regardless of whether the input is wrapped or not.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to