Uploaded image for project: 'Java'
  1. Java
  2. SONARJAVA-195

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

    Details

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

      Description

      This ticket should lead to depreciate the following rules:

      • PMD: AvoidCallingFinalize
      • Findbugs:FI_EXPLICIT_INVOCATION

        Activity

        Hide
        dinesh.bolkensteyn 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 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 Dinesh Bolkensteyn added a comment -

        Done

        Show
        dinesh.bolkensteyn Dinesh Bolkensteyn added a comment - Done
        Hide
        dinesh.bolkensteyn 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 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 Dinesh Bolkensteyn added a comment -

        Done

        Show
        dinesh.bolkensteyn Dinesh Bolkensteyn added a comment - Done
        Hide
        fabemn OLD - Fabrice Bellingard added a comment -

        Tested.

        Show
        fabemn OLD - Fabrice Bellingard added a comment - Tested.

          People

          • Assignee:
            dinesh.bolkensteyn Dinesh Bolkensteyn
            Reporter:
            freddy.mallet Freddy Mallet
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: