public static boolean isAnonymous ( String className ) { int i = className . lastIndexOf ( ' ' ) ; if ( i >= 0 && ++ i < className . length ( ) ) { while ( i < className . length ( ) ) { if ( ! Character . isDigit ( className . charAt ( i ) ) ) { return false ; } i ++ ; } return true ; } return false ; }
Does a class name appear to designate an anonymous class? Only the name is analyzed . No classes are loaded or looked up .