Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-2815 Add Spotbugs target to build and address detected "bugs"
  3. NUTCH-2812

Methods returning array may expose internal representation

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.17
    • Fix Version/s: 1.18
    • Component/s: None
    • Labels:
      None

      Description

      Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

      For example org.apache.nutch.fetcher.FetchNode.getOutlinks() may expose internal representation by returning FetchNode.outlinks

      There are 11 such occurrences of this bug in the codebase.

        Attachments

          Activity

            People

            • Assignee:
              lewismc Lewis John McGibbney
              Reporter:
              lewismc Lewis John McGibbney
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: