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 A9757200CBE for ; Fri, 7 Jul 2017 14:06:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A7E8B168ED0; Fri, 7 Jul 2017 12:06:09 +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 01546168ECE for ; Fri, 7 Jul 2017 14:06:08 +0200 (CEST) Received: (qmail 50186 invoked by uid 500); 7 Jul 2017 12:06:08 -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 50177 invoked by uid 99); 7 Jul 2017 12:06:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2017 12:06:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8C07C181334 for ; Fri, 7 Jul 2017 12:06:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id IkTZCJ92w02C for ; Fri, 7 Jul 2017 12:06:06 +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 61D805FB40 for ; Fri, 7 Jul 2017 12:06:05 +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 435F6E0D48 for ; Fri, 7 Jul 2017 12:06:03 +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 3639D24696 for ; Fri, 7 Jul 2017 12:06:01 +0000 (UTC) Date: Fri, 7 Jul 2017 12:06:01 +0000 (UTC) From: "Kyra Pritzel-Hentley (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (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, 07 Jul 2017 12:06:09 -0000 Kyra Pritzel-Hentley created OFBIZ-9454: ------------------------------------------- Summary: [FB] Package org.apache.ofbiz.accounting.thirdparty.c= learcommerce 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 Priority: Minor CCPaymentServices.java:78: 109: 144: 178: 235: 270, DM_BOOLEAN_CTOR * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentService= s.ccAuth(DispatchContext, Map) invokes inefficient Boolean constructor; use= Boolean.valueOf(...) instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentService= s.ccCredit(DispatchContext, Map) invokes inefficient Boolean constructor; u= se Boolean.valueOf(...) instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentService= s.ccCapture(DispatchContext, Map) invokes inefficient Boolean constructor; = use Boolean.valueOf(...) instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentService= s.ccRelease(DispatchContext, Map) invokes inefficient Boolean constructor; = use Boolean.valueOf(...) instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentService= s.ccRefund(DispatchContext, Map) invokes inefficient Boolean constructor; u= se Boolean.valueOf(...) instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentService= s.ccReAuth(DispatchContext, Map) invokes inefficient Boolean constructor; u= se Boolean.valueOf(...) instead Creating new instances of java.lang.Boolean wastes memory, since Boolean ob= jects 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 ob= jects instead. CCPaymentServices.java:772, SBSC_USE_STRINGBUFFER_CONCATENATION * SBSC: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCPaymentServi= ces.appendPaymentMechNode(Element, GenericValue, String, String) concatenat= es 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, ap= pended to, and converted back to a String. This can lead to a cost quadrati= c in the number of iterations, as the growing string is recopied in each it= eration. Better performance can be obtained by using a StringBuffer (or StringBuilde= r in Java 1.5) explicitly. CCPaymentServices.java:902, DM_DEFAULT_ENCODING * Dm: Found reliance on default encoding in org.apache.ofbiz.accounting.thi= rdparty.clearcommerce.CCPaymentServices.sendRequest(Document, String, Deleg= ator): 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 sui= table. This will cause the application behavior to vary between platforms. = Use an alternative API and specify a charset name or Charset object explici= tly. CCServicesTest.java:101: 131: 162: 209, DM_BOOLEAN_CTOR, Priorit=C3=A4t: No= rmal * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.t= estAuth() invokes inefficient Boolean constructor; use Boolean.valueOf(...)= instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.t= estCredit() invokes inefficient Boolean constructor; use Boolean.valueOf(..= .) instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.t= estPurchaseSubscription() invokes inefficient Boolean constructor; use Bool= ean.valueOf(...) instead * Dm: org.apache.ofbiz.accounting.thirdparty.clearcommerce.CCServicesTest.t= estCCReport() invokes inefficient Boolean constructor; use Boolean.valueOf(= ...) instead Creating new instances of java.lang.Boolean wastes memory, since Boolean ob= jects 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 ob= jects instead. -- This message was sent by Atlassian JIRA (v6.4.14#64029)