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

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

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

Details

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

    Description

      PayPalEvents.java:236, DM_DEFAULT_ENCODING

      • Dm: Found reliance on default encoding in org.apache.ofbiz.accounting.thirdparty.paypal.PayPalEvents.payPalIPN(HttpServletRequest, HttpServletResponse): new java.io.PrintWriter(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.

      PayPalEvents.java:240, OS_OPEN_STREAM_EXCEPTION_PATH

      • OS: org.apache.ofbiz.accounting.thirdparty.paypal.PayPalEvents.payPalIPN(HttpServletRequest, HttpServletResponse) may fail to close stream on exception
        The method creates an IO stream object, does not assign it to any fields, pass it to other methods, or return it, and does not appear to close it on all possible exception paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed.

      PayPalEvents.java:240, DM_DEFAULT_ENCODING

      • Dm: Found reliance on default encoding in org.apache.ofbiz.accounting.thirdparty.paypal.PayPalEvents.payPalIPN(HttpServletRequest, HttpServletResponse): new java.io.InputStreamReader(InputStream)
        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.

      PayPalEvents.java:343, 393 RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT

      • Return value of method without side effect is ignored
        This code calls a method and ignores the return value. However our analysis shows that the method (including its implementations in subclasses if any) does not produce any effect other than return value. Thus this call can be removed.

      PayPalEvents.java:493, NP_NULL_ON_SOME_PATH

      • NP: Possible null pointer dereference of results in org.apache.ofbiz.accounting.thirdparty.paypal.PayPalEvents.setPaymentPreference(LocalDispatcher, GenericValue, GenericValue, HttpServletRequest)
        There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.

      Attachments

        Activity

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

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment