View | Details | Raw Unified | Return to bug 53090
Collapse All | Expand All

(-)java/org/apache/catalina/core/DefaultInstanceManager.java (-1 / +14 lines)
Lines 139-151 Link Here
139
139
140
    private Object newInstance(Object instance, Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException {
140
    private Object newInstance(Object instance, Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException {
141
        if (!ignoreAnnotations) {
141
        if (!ignoreAnnotations) {
142
            Map<String, String> injections = injectionMap.get(clazz.getName());
142
            Map<String, String> injections = assembleInjectionsFromClassHierarchy(clazz); 
143
            populateAnnotationsCache(clazz, injections);
143
            populateAnnotationsCache(clazz, injections);
144
            processAnnotations(instance, injections);
144
            processAnnotations(instance, injections);
145
            postConstruct(instance, clazz);
145
            postConstruct(instance, clazz);
146
        }
146
        }
147
        return instance;
147
        return instance;
148
    }
148
    }
149
    
150
    private Map<String, String> assembleInjectionsFromClassHierarchy(Class<?> clazz) {
151
        Map<String, String> injections = new HashMap<String, String>();
152
        Map<String, String> currentInjections = null;
153
        while (clazz != null) {
154
            currentInjections = this.injectionMap.get(clazz.getName());
155
            if (currentInjections != null) {
156
                injections.putAll(currentInjections);
157
            }
158
            clazz = clazz.getSuperclass();
159
        }
160
        return injections;
161
    }
149
162
150
    @Override
163
    @Override
151
    public void destroyInstance(Object instance) throws IllegalAccessException, InvocationTargetException {
164
    public void destroyInstance(Object instance) throws IllegalAccessException, InvocationTargetException {

Return to bug 53090