Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9450 Fixing defects reported by code analysis tools
  3. OFBIZ-9485

[FB] Package org.apache.ofbiz.accounting.thirdparty.eway

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • Trunk
    • 17.12.01
    • accounting
    • None
    • Patch

    Description

      EwayServices.java:99, DM_BOOLEAN_CTOR

      • Dm: org.apache.ofbiz.accounting.thirdparty.eway.EwayServices.ewayCharge(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. Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead.

      EwayServices.java:166, DM_BOOLEAN_CTOR

      • Dm: org.apache.ofbiz.accounting.thirdparty.eway.EwayServices.ewayRefund(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. Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead.

      EwayServices.java:231, DM_BOOLEAN_CTOR

      • Dm: org.apache.ofbiz.accounting.thirdparty.eway.EwayServices.ewayRelease(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. Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead.

      GatewayConnector.java:90, RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE

      • RCN: Nullcheck of connection at line 90 of value previously dereferenced in org.apache.ofbiz.accounting.thirdparty.eway.GatewayConnector.sendRequest(GatewayRequest)
        A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous.

      GatewayConnector.java:96, DM_DEFAULT_ENCODING

      • Dm: Found reliance on default encoding in org.apache.ofbiz.accounting.thirdparty.eway.GatewayConnector.sendRequest(GatewayRequest): new java.io.OutputStreamWriter(OutputStream)
        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 suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.

      Attachments

        Activity

          People

            mbrohl Michael Brohl
            Kyra Pritzel-Hentley Kyra Pritzel-Hentley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: