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 32975200CC4 for ; Thu, 13 Jul 2017 11:50:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3084D16BCE6; Thu, 13 Jul 2017 09:50:04 +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 5B17E16BCE1 for ; Thu, 13 Jul 2017 11:50:03 +0200 (CEST) Received: (qmail 6972 invoked by uid 500); 13 Jul 2017 09:50:02 -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 6963 invoked by uid 99); 13 Jul 2017 09:50:02 -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; Thu, 13 Jul 2017 09:50:02 +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 1FF76C059A for ; Thu, 13 Jul 2017 09:50:02 +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-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id M5CQ677Ae6gK for ; Thu, 13 Jul 2017 09:50:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E4EDC5FBDF for ; Thu, 13 Jul 2017 09:50:00 +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 71E09E0ADD for ; Thu, 13 Jul 2017 09:50:00 +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 2003724738 for ; Thu, 13 Jul 2017 09:50:00 +0000 (UTC) Date: Thu, 13 Jul 2017 09:50:00 +0000 (UTC) From: =?utf-8?Q?Tobias_Laufk=C3=B6tter_=28JIRA=29?= To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (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: Thu, 13 Jul 2017 09:50:04 -0000 [ https://issues.apache.org/jira/browse/OFBIZ-9454?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1608= 5472#comment-16085472 ]=20 Tobias Laufk=C3=B6tter commented on OFBIZ-9454: ------------------------------------------ Instead of padding the {{cardSecurityCode}} in a loop you can use a formatt= er {{String.format("%-4s", cardSecurityCode);}} will do a right padding with t= he appropriate amount of spaces. > [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 > > > 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)