private Set < JavaClass > getDeclaredExceptions ( Method method ) throws ClassNotFoundException { ExceptionTable et = method . getExceptionTable ( ) ; if ( ( et == null ) || ( et . getLength ( ) == 0 ) ) { return Collections . < JavaClass > emptySet ( ) ; } Set < JavaClass > exceptions = new HashSet <> ( ) ; for ( String en : et . getExceptionNames ( ) ) { JavaClass exCls = Repository . lookupClass ( en ) ; if ( ! exCls . instanceOf ( runtimeExceptionClass ) ) { exceptions . add ( exCls ) ; } } return exceptions ; }
retrieves the set of non - runtime exceptions that are declared to be thrown by the method