@ SuppressFBWarnings ( value = "DP_DO_INSIDE_DO_PRIVILEGED" , justification = "EV is run only from within unit tests" ) @ SuppressWarnings ( "unchecked" ) public < T > T returnConstant ( String constantName ) { try { Class < T > type = resolve ( ) ; if ( type == null ) { return null ; } Field field = type . getField ( constantName ) ; field . setAccessible ( true ) ; return ( T ) field . get ( null ) ; } catch ( Exception e ) { return handleException ( e ) ; } }
Attempts to resolve a static constant on the type .