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

[FB] Package org.apache.ofbiz.shipment.thirdparty.dhl

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      DhlServices.java:97, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of conStr, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.sendDhlRequest(String, Delegator, String, String, Locale)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:194, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of shippingKey, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlRateEstimate(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:194, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of accountNbr, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlRateEstimate(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:235, DM_BOXED_PRIMITIVE_TOSTRING

      • Bx: Primitive boxed just to call toString in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlRateEstimate(DispatchContext, Map)

      A boxed primitive is allocated just to call toString(). It is more effective to just use the static form of toString which takes the primitive value. So,
      Replace... With this...
      new Integer(1).toString() Integer.toString(1)
      new Long(1).toString() Long.toString(1)
      new Float(1.0).toString() Float.toString(1.0)
      new Double(1.0).toString() Double.toString(1.0)
      new Byte(1).toString() Byte.toString(1)
      new Short(1).toString() Short.toString(1)
      new Boolean(true).toString() Boolean.toString(true)

      DhlServices.java:239, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of templateName, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlRateEstimate(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:398, DLS_DEAD_LOCAL_STORE

      • DLS: Dead store to result in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlRegisterInquire(DispatchContext, Map)

      This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

      Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

      DhlServices.java:402, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of accountNbr, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlRegisterInquire(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:641, UCF_USELESS_CONTROL_FLOW

      • UCF: Useless control flow in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlShipmentConfirm(DispatchContext, Map)

      This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. For example, this is caused by having an empty statement block for an if statement:

      if (argv.length == 0)

      { // TODO: handle this case }

      DhlServices.java:703, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of accountNbr, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlShipmentConfirm(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:703, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of shippingKey, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlShipmentConfirm(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:710, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of labelImagePreference, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlShipmentConfirm(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:722, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of templateName, which is known to be non-null in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.dhlShipmentConfirm(DispatchContext, Map)

      This method contains a redundant check of a known non-null value against the constant null.

      DhlServices.java:845, DM_DEFAULT_ENCODING

      • Dm: Found reliance on default encoding in org.apache.ofbiz.shipment.thirdparty.dhl.DhlServices.handleDhlShipmentConfirmResponse(String, GenericValue, List, Locale): String.getBytes()

      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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mbrohl Michael Brohl
            jleichert Julian Leichert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment