@ Override public void visitClassContext ( ClassContext classContext ) { try { JavaClass cls = classContext . getJavaClass ( ) ; if ( ( serializableClass != null ) && ( cls . implementationOf ( serializableClass ) ) ) { Field [ ] fields = cls . getFields ( ) ; setupVisitorForClass ( cls ) ; for ( Field f : fields ) { if ( ! f . isStatic ( ) && f . isFinal ( ) && f . isTransient ( ) ) { bugReporter . reportBug ( new BugInstance ( this , BugType . NFF_NON_FUNCTIONAL_FIELD . name ( ) , Priorities . NORMAL_PRIORITY ) . addClass ( this ) . addField ( cls . getClassName ( ) , f . getName ( ) , f . getSignature ( ) , f . getAccessFlags ( ) ) ) ; } } } } catch ( ClassNotFoundException cnfe ) { bugReporter . reportMissingClass ( cnfe ) ; } }
checks to see if the class is Serializable then looks for fields that are both final and transient