Jtest logo




Contents  Previous  Next  Index

PB.IMO


Make sure the intended method is overridden

Description

This rule checks for possible typos that may have occurred when overriding methods were written.

Example

 package PB;
 
 public class IMO {
     protected void finallize () // typo; should be "finalize"
         throws Throwable
     {
         // important cleanup code
     }
 }

Repair

Fix the typo, or suppress the error message. If the overriding method is spelled incorrectly, it will not be called; the method from the superclass will be called instead.

In the example above, the "important cleanup code" will never be executed.


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft