protected ClassNode findClassNode ( final SourceUnit sourceUnit , final CompilationUnit compilationUnit , final String className ) { if ( className . endsWith ( "[]" ) ) { return findClassNode ( sourceUnit , compilationUnit , className . substring ( 0 , className . length ( ) - 2 ) ) . makeArray ( ) ; } ClassNode cn = compilationUnit . getClassNode ( className ) ; if ( cn == null ) { try { cn = ClassHelper . make ( Class . forName ( className , false , sourceUnit . getClassLoader ( ) ) ) ; } catch ( ClassNotFoundException e ) { cn = ClassHelper . make ( className ) ; } } return cn ; }
Finds a class node given a string representing the type . Performs a lookup in the compilation unit to check if it is done in the same source unit .