private void checkAnnotationClasses ( ClassLoader loader ) // d676633 { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . entry ( tc , "checkAnnotationClasses: " + loader ) ; // All EJBs in an application share the same class loader. Only check // a given class loader once. if ( ivCheckedAnnotationClassLoaders . add ( loader ) ) { for ( Class < ? > processorClass : ivProcessorProviders . keySet ( ) ) { String className = processorClass . getName ( ) ; Class < ? > loaderClass ; try { loaderClass = loader . loadClass ( className ) ; } catch ( ClassNotFoundException ex ) { // At least it hasn't been overridden, so ignore per WAB. F53641 if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "ignoring " + className + " : " + ex ) ; continue ; } if ( loaderClass != processorClass ) { Set < String > warnedAnnotations = null ; ClassLoader loaderClassLoader = loaderClass . getClassLoader ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "loaded " + loaderClass + " from application class loader " + loaderClassLoader ) ; synchronized ( this ) { if ( ivWarnedClassLoaderAnnotations == null ) { ivWarnedClassLoaderAnnotations = new WeakHashMap < ClassLoader , Set < String > > ( ) ; } warnedAnnotations = ivWarnedClassLoaderAnnotations . get ( loaderClassLoader ) ; if ( warnedAnnotations == null ) { warnedAnnotations = Collections . synchronizedSet ( new HashSet < String > ( ) ) ; ivWarnedClassLoaderAnnotations . put ( loaderClassLoader , warnedAnnotations ) ; } } // Only warn once about a particular class loader loading a // particular annotation class. We do not want a PARENT_LAST // application to generate warnings for every child WAR class // loader. Similarly for application server class loaders. if ( warnedAnnotations == null || warnedAnnotations . add ( className ) ) { CodeSource codeSource = loaderClass . getProtectionDomain ( ) . getCodeSource ( ) ; String codeSourceLocation = codeSource == null ? null : String . valueOf ( codeSource . getLocation ( ) ) ; Tr . warning ( tc , "INCOMPATIBLE_ANNOTATION_CLASS_CWNEN0070W" , className , codeSourceLocation ) ; } } } } if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . exit ( tc , "checkAnnotationClasses" ) ; }
Check the specified class loader to check if it has overridden any annotation classes processed by the injection engine .