Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 04C98200CC8 for ; Fri, 14 Jul 2017 13:23:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0168316D942; Fri, 14 Jul 2017 11:23:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1FE0916D93F for ; Fri, 14 Jul 2017 13:23:06 +0200 (CEST) Received: (qmail 91557 invoked by uid 500); 14 Jul 2017 11:23:05 -0000 Mailing-List: contact notifications-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list notifications@ofbiz.apache.org Received: (qmail 91548 invoked by uid 99); 14 Jul 2017 11:23:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2017 11:23:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 9C04BC00B6 for ; Fri, 14 Jul 2017 11:23:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 911MQh5t3zbc for ; Fri, 14 Jul 2017 11:23:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4697F60D26 for ; Fri, 14 Jul 2017 11:23:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 22B18E0D60 for ; Fri, 14 Jul 2017 11:23:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 159A324748 for ; Fri, 14 Jul 2017 11:23:00 +0000 (UTC) Date: Fri, 14 Jul 2017 11:23:00 +0000 (UTC) From: "Kyra Pritzel-Hentley (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (OFBIZ-9454) [FB] Package org.apache.ofbiz.accounting.thirdparty.clearcommerce MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 14 Jul 2017 11:23:08 -0000 [ https://issues.apache.org/jira/browse/OFBIZ-9454?page=3Dcom.atlassia= n.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 CCServi= cesTest 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)=20 While trying to test the class I learned that CCServicesTest is actually ne= ver tested (not included in any test-suite). I wonder why this class is sti= ll in the OFBiz project if it is never used for testing. And after adding t= he 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. =20 > [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_bugfi= xes.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.CCPaymentServi= ces.ccAuth(DispatchContext, Map) invokes inefficient Boolean constructor; u= se Boolean.valueOf(...) instead > * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServi= ces.ccCredit(DispatchContext, Map) invokes inefficient Boolean constructor;= use Boolean.valueOf(...) instead > * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServi= ces.ccCapture(DispatchContext, Map) invokes inefficient Boolean constructor= ; use Boolean.valueOf(...) instead > * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServi= ces.ccRelease(DispatchContext, Map) invokes inefficient Boolean constructor= ; use Boolean.valueOf(...) instead > * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServi= ces.ccRefund(DispatchContext, Map) invokes inefficient Boolean constructor;= use Boolean.valueOf(...) instead > * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServi= ces.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. U= se 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.CCPaymentSer= vices.appendPaymentMechNode(Element, GenericValue, String, String) concaten= ates strings using + in a loop > The method seems to be building a String using concatenation in a loop. I= n each iteration, the String is converted to a StringBuffer/StringBuilder, = appended to, and converted back to a String. This can lead to a cost quadra= tic in the number of iterations, as the growing string is recopied in each = iteration. > Better performance can be obtained by using a StringBuffer (or StringBuil= der in Java 1.5) explicitly. > CCPaymentServices.java:902, DM_DEFAULT_ENCODING > * Dm: Found reliance on default encoding in org.apache.ofbiz.accounting.t= hirdparty.clearcommerce.CCPaymentServices.sendRequest(Document, String, Del= egator): java.io.ByteArrayOutputStream.toString() > Found a call to a method which will perform a byte to String (or String t= o byte) conversion, and will assume that the default platform encoding is s= uitable. This will cause the application behavior to vary between platforms= . Use an alternative API and specify a charset name or Charset object expli= citly. > CCServicesTest.java:101: 131: 162: 209, DM_BOOLEAN_CTOR, Priorit=C3=A4t: = 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 Bo= olean.valueOf(...) instead > * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest= .testCCReport() invokes inefficient Boolean constructor; use Boolean.valueO= f(...) 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. U= se 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)