@ Override public void visitClassContext ( ClassContext classContext ) { try { JavaClass cls = classContext . getJavaClass ( ) ; if ( isSerializable ( cls ) ) { JavaClass superCls = cls . getSuperClass ( ) ; if ( ! isSerializable ( superCls ) && hasSerializableFields ( superCls ) && ! hasSerializingMethods ( cls ) ) { bugReporter . reportBug ( new BugInstance ( this , BugType . PIS_POSSIBLE_INCOMPLETE_SERIALIZATION . name ( ) , NORMAL_PRIORITY ) . addClass ( cls ) ) ; } } } catch ( ClassNotFoundException cnfe ) { bugReporter . reportMissingClass ( cnfe ) ; } }
implements the visitor to look for classes that are serializable and are derived from non serializable classes and don t either implement methods in Externalizable or Serializable to save parent class fields .