private byte [ ] enhancement ( ClassLoader classLoader , byte [ ] classfileBuffer ) { ClassReader cr = new ClassReader ( classfileBuffer ) ; CLAwareClassWriter cw = new CLAwareClassWriter ( FLAGS , classLoader ) ; TypeQueryClassAdapter ca = new TypeQueryClassAdapter ( cw , enhanceContext ) ; try { cr . accept ( ca , ClassReader . EXPAND_FRAMES ) ; if ( ca . isLog ( 9 ) ) { ca . log ( "... completed" ) ; } return cw . toByteArray ( ) ; } catch ( AlreadyEnhancedException e ) { if ( ca . isLog ( 1 ) ) { ca . log ( "already enhanced" ) ; } return null ; } catch ( NoEnhancementRequiredException e ) { if ( ca . isLog ( 9 ) ) { ca . log ( "... skipping, no enhancement required" ) ; } return null ; } }
Perform enhancement .