public static boolean isSafeClass ( String className , List < String > whitelist ) { for ( String whiteRegExp : whitelist ) { Pattern whitePattern = Pattern . compile ( whiteRegExp ) ; Matcher whiteMatcher = whitePattern . matcher ( className ) ; if ( whiteMatcher . find ( ) ) { if ( log . isTraceEnabled ( ) ) log . tracef ( "Whitelist match: '%s'" , className ) ; return true ; } } return false ; }
Checks whether class name is matched by the class name white list regular expressions provided .