Author: mbrohl
Date: Mon Jul 10 14:23:34 2017 New Revision: 1801473 URL: http://svn.apache.org/viewvc?rev=1801473&view=rev Log: Improved: Fixing defects reported by code analysis tools. (OFBIZ-9485) Avoid the use of inefficient Boolean constructors and avoid reliance on default encoding. Thanks Kyra Pritzel-Hentley for reporting an providing the patch. Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/EwayServices.java ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayConnector.java Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/EwayServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/EwayServices.java?rev=1801473&r1=1801472&r2=1801473&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/EwayServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/EwayServices.java Mon Jul 10 14:23:34 2017 @@ -96,7 +96,7 @@ public class EwayServices { Boolean authResult = reply.getTrxnStatus(); // auth fields - result.put("authResult", new Boolean(authResult.booleanValue())); + result.put("authResult", Boolean.valueOf(authResult.booleanValue())); result.put("authMessage", reply.getTrxnError()); result.put("authCode", reply.getAuthCode()); result.put("authRefNum", reply.getTrxnNumber()); @@ -163,7 +163,7 @@ public class EwayServices { // process the result Map<String, Object> result = ServiceUtil.returnSuccess(); Boolean refundResult = reply.getTrxnStatus(); - result.put("refundResult", new Boolean(refundResult.booleanValue())); + result.put("refundResult", Boolean.valueOf(refundResult.booleanValue())); result.put("refundMessage", reply.getTrxnError()); result.put("refundCode", reply.getAuthCode()); result.put("refundRefNum", reply.getTrxnNumber()); @@ -228,7 +228,7 @@ public class EwayServices { // process the result Map<String, Object> result = ServiceUtil.returnSuccess(); Boolean refundResult = reply.getTrxnStatus(); - result.put("releaseResult", new Boolean(refundResult.booleanValue())); + result.put("releaseResult", Boolean.valueOf(refundResult.booleanValue())); result.put("releaseMessage", reply.getTrxnError()); result.put("releaseCode", reply.getAuthCode()); result.put("releaseRefNum", reply.getTrxnNumber()); Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayConnector.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayConnector.java?rev=1801473&r1=1801472&r2=1801473&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayConnector.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/eway/GatewayConnector.java Mon Jul 10 14:23:34 2017 @@ -93,7 +93,7 @@ public class GatewayConnector { connection.setConnectTimeout(timeout*1000); OutputStream out = connection.getOutputStream(); - Writer wout = new OutputStreamWriter(out); + Writer wout = new OutputStreamWriter(out, "UTF-8"); wout.write(request.toXml()); wout.flush(); wout.close(); |
Free forum by Nabble | Edit this page |