|
| From: | Ernst Reissner |
| Subject: | [Octave-bug-tracker] [bug #48750] java interface: performance of wrapping fundamental scalar types |
| Date: | Wed, 10 Aug 2016 15:18:22 +0000 (UTC) |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0 |
Follow-up Comment #3, bug #48750 (project octave):
see also
http://pmd.sourceforge.net/pmd-4.3.0/rules/migrating.html
e.g.
IntegerInstantiation
Since: PMD 3.5
In JDK 1.5, calling new Integer() causes memory allocation. Integer.valueOf()
is more memory friendly.
This rule is defined by the following XPath expression:
//PrimaryPrefix
/AllocationExpression
[not (ArrayDimsAndInits)
and (ClassOrInterfaceType/@Image='Integer'
or ClassOrInterfaceType/@Image='java.lang.Integer')]
Example:
public class Foo {
private Integer i = new Integer(0); // change to Integer i =
Integer.valueOf(0);
}
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48750>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |