Author: markt
Date: Thu Sep  8 15:37:06 2011
New Revision: 1166752

URL: http://svn.apache.org/viewvc?rev=1166752&view=rev
Log:
Fix possible NPE if instances aren't created through the DefaultInstanceManager 
but are destroyed through it.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java

Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1166752&r1=1166751&r2=1166752&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Thu 
Sep  8 15:37:06 2011
@@ -205,6 +205,10 @@ public class DefaultInstanceManager impl
         // At the end the postconstruct annotated
         // method is invoked
         List<AnnotationCacheEntry> annotations = annotationCache.get(clazz);
+        if (annotations == null) {
+            // instance not created through the instance manager
+            return;
+        }
         for (AnnotationCacheEntry entry : annotations) {
             if (entry.getType() == AnnotationCacheEntryType.PRE_DESTROY) {
                 Method preDestroy = (Method) entry.getAccessibleObject();



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to