private boolean isEnum ( int stackPos ) throws ClassNotFoundException { if ( stack . getStackDepth ( ) <= stackPos ) { return false ; } OpcodeStack . Item item = stack . getStackItem ( stackPos ) ; if ( ! item . getSignature ( ) . startsWith ( Values . SIG_QUALIFIED_CLASS_PREFIX ) ) { return false ; } JavaClass cls = item . getJavaClass ( ) ; if ( ( cls == null ) || ! cls . isEnum ( ) ) { return false ; } // If the cls implements any interface, it's possible the collection // is based on that interface, so ignore return cls . getInterfaces ( ) . length == 0 ; }
returns whether the item at the stackPos location on the stack is an enum and doesn t implement any interfaces