ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyra Pritzel-Hentley (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OFBIZ-9454) [FB] Package org.apache.ofbiz.accounting.thirdparty.clearcommerce
Date Fri, 14 Jul 2017 11:23:00 GMT

     [ https://issues.apache.org/jira/browse/OFBIZ-9454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kyra Pritzel-Hentley updated OFBIZ-9454:
----------------------------------------
    Attachment: OFBIZ-9454_accounting.thirdparty.clearcommerce.patch

This patch should finally cover all above mentioned bugs. The class CCServicesTest needed
another assertion of the of authResult parameter to check if it is null and then fail the
test. (Since no more NullPointerException is thrown with the equals() method) 

While trying to test the class I learned that CCServicesTest is actually never tested (not
included in any test-suite). I wonder why this class is still in the OFBiz project if it is
never used for testing. And after adding the class to a suite, the class failed 4 out of 6
tests. This, of course, is a topic for another ticket but is probably worth looking into.
 

> [FB] Package org.apache.ofbiz.accounting.thirdparty.clearcommerce
> -----------------------------------------------------------------
>
>                 Key: OFBIZ-9454
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9454
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: Trunk
>            Reporter: Kyra Pritzel-Hentley
>            Assignee: Michael Brohl
>            Priority: Minor
>         Attachments: OFBIZ-9454_accounting.thirdparty.clearcommerce_bugfixes.patch, OFBIZ-9454_accounting.thirdparty.clearcommerce.patch
>
>
> CCPaymentServices.java:78: 109: 144: 178: 235: 270, DM_BOOLEAN_CTOR
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.ccAuth(DispatchContext,
Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.ccCredit(DispatchContext,
Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.ccCapture(DispatchContext,
Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.ccRelease(DispatchContext,
Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.ccRefund(DispatchContext,
Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.ccReAuth(DispatchContext,
Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are
immutable and there are only two useful values of this type.  Use the Boolean.valueOf() method
(or Java 1.5 autoboxing) to create Boolean objects instead.
> CCPaymentServices.java:772, SBSC_USE_STRINGBUFFER_CONCATENATION
> * SBSC: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.appendPaymentMechNode(Element,
GenericValue, String, String) concatenates strings using + in a loop
> The method seems to be building a String using concatenation in a loop. In each iteration,
the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to
a String. This can lead to a cost quadratic in the number of iterations, as the growing string
is recopied in each iteration.
> Better performance can be obtained by using a StringBuffer (or StringBuilder in Java
1.5) explicitly.
> CCPaymentServices.java:902, DM_DEFAULT_ENCODING
> * Dm: Found reliance on default encoding in org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServices.sendRequest(Document,
String, Delegator): java.io.ByteArrayOutputStream.toString()
> Found a call to a method which will perform a byte to String (or String to byte) conversion,
and will assume that the default platform encoding is suitable. This will cause the application
behavior to vary between platforms. Use an alternative API and specify a charset name or Charset
object explicitly.
> CCServicesTest.java:101: 131: 162: 209, DM_BOOLEAN_CTOR, Priorit├Ąt: Normal
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.testAuth()
invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.testCredit()
invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.testPurchaseSubscription()
invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.testCCReport()
invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
> Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are
immutable and there are only two useful values of this type.  Use the Boolean.valueOf() method
(or Java 1.5 autoboxing) to create Boolean objects instead.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message