[jira] Commented: (OFBIZ-537) Use i.e. Integer.toString(<intvalue>) instead of new Integer(<intvalue>).toString

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-537) Use i.e. Integer.toString(<intvalue>) instead of new Integer(<intvalue>).toString

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477658 ]

Jacopo Cappellato commented on OFBIZ-537:
-----------------------------------------

Stefan,

I've committed a slightly different version of your patch in rev. 514204
There was an issue with your patch:

in fact with this code:

-         result.put("captureRefNum", new Long(nowTime).toString());
-         result.put("captureAltRefNum", new Long(nowTime).toString());

you don't get the same results as this:

+         result.put("captureRefNum", UtilDateTime.nowAsString());
+         result.put("captureAltRefNum", UtilDateTime.nowAsString());

Jacopo



> Use i.e. Integer.toString(<intvalue>) instead of new Integer(<intvalue>).toString
> ---------------------------------------------------------------------------------
>
>                 Key: OFBIZ-537
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-537
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>    Affects Versions: SVN trunk
>            Reporter: Stefan Huehner
>         Assigned To: Jacopo Cappellato
>            Priority: Minor
>         Attachments: ofbiz_toString_Double1.diff, ofbiz_toString_Integer1.diff, ofbiz_toString_Long1.diff, ofbiz_toString_Long2.diff
>
>
> Hi,
> the attached patches replace i.e new Integer(<value>).toString with the Integer.toString(<value>) method. The advantage of the later form is the no Integer object is created and is unsed to be garbage collected at the same moment.
> The attacehd patches are split by type:
> - Integer
> - Double
> ...

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