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 CABE3200CC1 for ; Mon, 10 Jul 2017 10:15:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C799D1688C7; Mon, 10 Jul 2017 08:15:05 +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 E6FA11688B0 for ; Mon, 10 Jul 2017 10:15:04 +0200 (CEST) Received: (qmail 55664 invoked by uid 500); 10 Jul 2017 08:15:04 -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 55653 invoked by uid 99); 10 Jul 2017 08:15:04 -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; Mon, 10 Jul 2017 08:15:04 +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 92D1B191F4B for ; Mon, 10 Jul 2017 08:15:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id xmhrKUC1CgOI for ; Mon, 10 Jul 2017 08:15:02 +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 3E3765FDAD for ; Mon, 10 Jul 2017 08:15:01 +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 6178EE010F for ; Mon, 10 Jul 2017 08:15: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 1AD0424686 for ; Mon, 10 Jul 2017 08:15:00 +0000 (UTC) Date: Mon, 10 Jul 2017 08:15:00 +0000 (UTC) From: "Kyra Pritzel-Hentley (JIRA)" 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: Mon, 10 Jul 2017 08:15:06 -0000 [ https://issues.apache.org/jira/browse/OFBIZ-9454?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1608= 0005#comment-16080005 ]=20 Kyra Pritzel-Hentley commented on OFBIZ-9454: --------------------------------------------- The bug DM_DEFAULT_ENCODING does not need a fix since the method UtilXml.wr= iteXmlDocument(requestDocument, os, "UTF-8", true, false, 0) is called befo= re converting the stream to a string. The method writes xml documents which= are always encoded in UTF-8 and have an output file which corresponds to t= he encoding given as an argument (which is UTF-8 as well). Therefore, there= should be no varying behavior between platforms. > [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 > Priority: Minor > > 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)