private Field [ ] getAllDeclaredFields ( Class < ? > klass , Class < ? > classHierarchy ) { try { return klass . getDeclaredFields ( ) ; } catch ( Throwable ex ) { // The most common 'problem' here is a NoClassDefFoundError because // a dependency class (super/field type, etc) could not be found // when the class is fully initialized. // Since interrogating a class for annotations is new in Java EE 1.5, // it is possible this application may have worked in prior versions // of WebSphere, if the application never actually used the class. // So, rather than just fail the app start, a Warning will be logged // indicating the class will not be processed for annotations, and // the application will be allowed to start. d477931 FFDCFilter . processException ( ex , CLASS_NAME + ".getAllDeclaredFields" , "249" , new Object [ ] { classHierarchy , klass } ) ; if ( classHierarchy != klass ) { Tr . warning ( tc , "SUPER_FIELD_ANNOTATIONS_IGNORED_CWNEN0048W" , klass . getName ( ) , classHierarchy . getName ( ) , ex . toString ( ) ) ; // d479669 RTC119889 if ( ivInjectionEngine . isValidationFailable ( ivNameSpaceConfig . isCheckApplicationConfiguration ( ) ) ) // F743-14449 { throw new RuntimeException ( "Resource annotations on the fields of the " + klass . getName ( ) + " class could not be processed. The " + klass . getName ( ) + " class is being processed for annotations because it is" + " referenced by the " + classHierarchy . getName ( ) + " application class." + " The annotations could not be obtained because of the exception : " + ex , ex ) ; } } else { Tr . warning ( tc , "FIELD_ANNOTATIONS_IGNORED_CWNEN0047W" , klass . getName ( ) , ex . toString ( ) ) ; // d479669 d641396 RTC119889 if ( ivInjectionEngine . isValidationFailable ( ivNameSpaceConfig . isCheckApplicationConfiguration ( ) ) ) // F743-14449 { throw new RuntimeException ( "Resource annotations on the fields of the " + klass . getName ( ) + " class could not be processed. The annotations could not be obtained" + " because of the exception : " + ex , ex ) ; } } return null ; } }
Return the declared fields for the specified class in the class hierarchy .