Fix possible NPE if instances aren't created through the DefaultInstanceManager but...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Sep 2011 15:37:06 +0000 (15:37 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Sep 2011 15:37:06 +0000 (15:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1166752 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/DefaultInstanceManager.java

index d0fe3c5..b354fc2 100644 (file)
@@ -205,6 +205,10 @@ public class DefaultInstanceManager implements InstanceManager {
         // 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();