Details

    • Type: Sub-task
    • Status: In Progress
    • Priority: Should
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Core 2.3.3
    • Component/s: None
    • Labels:
    • Complexity:
      Low

      Description

      From SonarQube:

      Exceptions are meant to represent the application's state at the point at which an error occurred.

      Making all fields in an Exception class final ensures that this state:

      • Will be fully defined at the same time the Exception is instantiated.
      • Won't be updated or corrupted by a questionable error handler.

      This will enable developers to quickly understand what went wrong.

      First case:

      Second case:

      Third case:

      Fourth case:

      Fifth case:

      Sixth case:

      Seventh case:

      Eighth case:

      Problem:
      Non-final fields can be modified. The exception object should be unmodifiable for its short lifetime after it is created.

      Solution:
      Make all the exception class fields final.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              bejanut Alexandru-Gabriel Bejan
              Reporter:
              sacull Lukasz Debicki
              Designated Committer:
              Lukasz Debicki Lukasz Debicki
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h