@ Override public void visitMethod ( Method obj ) { try { if ( obj . isSynthetic ( ) ) { return ; } if ( Values . CONSTRUCTOR . equals ( getMethodName ( ) ) && javaClass . getClassName ( ) . contains ( "$" ) ) { return ; } List < String > types = SignatureUtils . getParameterSignatures ( obj . getSignature ( ) ) ; if ( ( types . isEmpty ( ) ) || ( types . size ( ) > 2 ) ) { return ; } if ( ( obj . getAccessFlags ( ) & Const . ACC_VARARGS ) != 0 ) { return ; } String lastParmSig = types . get ( types . size ( ) - 1 ) ; if ( ! lastParmSig . startsWith ( Values . SIG_ARRAY_PREFIX ) || lastParmSig . startsWith ( Values . SIG_ARRAY_OF_ARRAYS_PREFIX ) ) { return ; } if ( SignatureBuilder . SIG_BYTE_ARRAY . equals ( lastParmSig ) || SignatureBuilder . SIG_CHAR_ARRAY . equals ( lastParmSig ) ) { return ; } if ( hasSimilarParms ( types ) ) { return ; } if ( obj . isStatic ( ) && "main" . equals ( obj . getName ( ) ) && SIG_STRING_ARRAY_TO_VOID . equals ( obj . getSignature ( ) ) ) { return ; } if ( ! obj . isPrivate ( ) && ! obj . isStatic ( ) && isInherited ( obj ) ) { return ; } super . visitMethod ( obj ) ; bugReporter . reportBug ( new BugInstance ( this , BugType . UVA_USE_VAR_ARGS . name ( ) , LOW_PRIORITY ) . addClass ( this ) . addMethod ( this ) ) ; } catch ( ClassNotFoundException cnfe ) { bugReporter . reportMissingClass ( cnfe ) ; } }
overrides the visitor to look for methods that has an array as a last parameter of an array type where the base type is not like the previous parameter nor something like a char or byte array .