SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-195

Rule: The Object.finalize() method should never be called

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: Rules
    • Labels:
      None
    • Number of attachments :
      0

      Description

      This ticket should lead to depreciate the following rules:

      • PMD: AvoidCallingFinalize
      • Findbugs:FI_EXPLICIT_INVOCATION

        Activity

        Hide
        Dinesh Bolkensteyn added a comment -

        Indeed Fabrice, then I don't really get the point of this rule, I didn't thought about finalize() being protected...

        Show
        Dinesh Bolkensteyn added a comment - Indeed Fabrice, then I don't really get the point of this rule, I didn't thought about finalize() being protected...
        Hide
        Dinesh Bolkensteyn added a comment -

        Done

        Show
        Dinesh Bolkensteyn added a comment - Done
        Hide
        Dinesh Bolkensteyn added a comment -

        We should not report violations when they are found within an overload of the finalize() method, as in:

        protected void finalize() throws Trowable {
          super.finalize();                           // This must be compliant
        }
        
        Show
        Dinesh Bolkensteyn added a comment - We should not report violations when they are found within an overload of the finalize() method, as in: protected void finalize() throws Trowable { super .finalize(); // This must be compliant }
        Hide
        Dinesh Bolkensteyn added a comment -

        Done

        Show
        Dinesh Bolkensteyn added a comment - Done
        Hide
        Fabrice Bellingard added a comment -

        Tested.

        Show
        Fabrice Bellingard added a comment - Tested.

          People

          • Assignee:
            Dinesh Bolkensteyn
            Reporter:
            Freddy Mallet
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: