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

[FB] Package org.apache.ofbiz.order.thirdparty.zipsales

    XMLWordPrintableJSON

Details

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

    Description

      ZipSalesServices.java:106, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of tri, which is known to be non-null in org.apache.ofbiz.order.thirdparty.zipsales.ZipSalesServices.importFlatTable(DispatchContext, Map)

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

      ZipSalesServices.java:175, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of rri, which is known to be non-null in org.apache.ofbiz.order.thirdparty.zipsales.ZipSalesServices.importFlatTable(DispatchContext, Map)

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

      ZipSalesServices.java:286, DM_CONVERT_CASE

      • Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.order.thirdparty.zipsales.ZipSalesServices.getItemTaxList(Delegator, GenericValue, String, String, BigDecimal, BigDecimal, boolean)

      A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the

      String.toUpperCase( Locale l )
      String.toLowerCase( Locale l )

      versions instead.

      ZipSalesServices.java:290, NP_LOAD_OF_KNOWN_NULL_VALUE

      • NP: Load of known null value in org.apache.ofbiz.order.thirdparty.zipsales.ZipSalesServices.getItemTaxList(Delegator, GenericValue, String, String, BigDecimal, BigDecimal, boolean)

      The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was non-null).

      ZipSalesServices.java:489, STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE

      • STCAL: Call to method of static java.text.DateFormat in org.apache.ofbiz.order.thirdparty.zipsales.ZipSalesServices.parseDate(String, Timestamp)

      As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous.

      For more information on this see Sun Bug #6231579 and Sun Bug #6178997.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: