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

(-).classpath (-1 / +1 lines)
Lines 12-18 Link Here
12
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
12
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
13
	<classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
13
	<classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
14
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/commons-logging-1.0.4/commons-logging-api.jar"/>
14
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/commons-logging-1.0.4/commons-logging-api.jar"/>
15
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/commons-modeler-1.1/commons-modeler.jar"/>
15
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/commons-modeler-2.0/commons-modeler-2.0.jar"/>
16
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/mx4j-3.0.1/lib/mx4j.jar"/>
16
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/mx4j-3.0.1/lib/mx4j.jar"/>
17
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/commons-launcher-0.9/bin/commons-launcher.jar"/>
17
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/commons-launcher-0.9/bin/commons-launcher.jar"/>
18
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/struts-1.2.7/lib/antlr.jar"/>
18
	<classpathentry kind="var" path="TOMCAT_LIBS_BASE/struts-1.2.7/lib/antlr.jar"/>
(-)catalina/src/share/org/apache/catalina/core/StandardContext.java (-1 / +20 lines)
Lines 178-184 Link Here
178
     */
178
     */
179
    private boolean antiJARLocking = false;
179
    private boolean antiJARLocking = false;
180
180
181
    
181
        /**
182
     * The nullifyReferences flag for this Context.
183
     */
184
    private boolean nullifyReferences = true;
182
    /**
185
    /**
183
     * The antiResourceLocking flag for this Context.
186
     * The antiResourceLocking flag for this Context.
184
     */
187
     */
Lines 875-881 Link Here
875
        return (this.antiResourceLocking);
878
        return (this.antiResourceLocking);
876
879
877
    }
880
    }
881
    /**
882
     * @param flag The nullInstanceFields to set.
883
     */
884
    public void setNullifyReferences(boolean flag) {
885
	boolean oldNullInstanceFields = this.nullifyReferences;
886
        this.nullifyReferences = flag;
887
        support.firePropertyChange("nullifyReferences",
888
                                   new Boolean(oldNullInstanceFields),
889
                                   new Boolean(this.nullifyReferences));
890
    }
878
891
892
        /**
893
     * @return Returns the nullInstanceFields.
894
     */
895
    public boolean getNullifyReferences() {
896
        return nullifyReferences;
897
    }
879
898
880
    /**
899
    /**
881
     * Set the antiJARLocking feature for this Context.
900
     * Set the antiJARLocking feature for this Context.
(-)catalina/src/share/org/apache/catalina/loader/WebappLoader.java (-2 / +3 lines)
Lines 667-675 Link Here
667
            classLoader = createClassLoader();
667
            classLoader = createClassLoader();
668
            classLoader.setResources(container.getResources());
668
            classLoader.setResources(container.getResources());
669
            classLoader.setDelegate(this.delegate);
669
            classLoader.setDelegate(this.delegate);
670
            if (container instanceof StandardContext)
670
            if (container instanceof StandardContext){
671
                classLoader.setAntiJARLocking(((StandardContext) container).getAntiJARLocking());
671
                classLoader.setAntiJARLocking(((StandardContext) container).getAntiJARLocking());
672
672
		classLoader.setNullifyReferences(((StandardContext) container).getNullifyReferences());
673
	    }
673
            for (int i = 0; i < repositories.length; i++) {
674
            for (int i = 0; i < repositories.length; i++) {
674
                classLoader.addRepository(repositories[i]);
675
                classLoader.addRepository(repositories[i]);
675
            }
676
            }
(-)catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java (-3 / +23 lines)
Lines 168-173 Link Here
168
     */
168
     */
169
    boolean antiJARLocking = false; 
169
    boolean antiJARLocking = false; 
170
    
170
    
171
    /**
172
     * Set static fields of loaded classes to null when undeploying to prevent
173
     * memory leaks.
174
     */
175
    boolean nullifyReferences = true;
171
176
172
    // ----------------------------------------------------------- Constructors
177
    // ----------------------------------------------------------- Constructors
173
178
Lines 424-438 Link Here
424
        return antiJARLocking;
429
        return antiJARLocking;
425
    }
430
    }
426
    
431
    
427
    
432
   /**
428
    /**
429
     * @param antiJARLocking The antiJARLocking to set.
433
     * @param antiJARLocking The antiJARLocking to set.
430
     */
434
     */
431
    public void setAntiJARLocking(boolean antiJARLocking) {
435
    public void setAntiJARLocking(boolean antiJARLocking) {
432
        this.antiJARLocking = antiJARLocking;
436
        this.antiJARLocking = antiJARLocking;
433
    }
437
    }
438
    
439
    /**
440
     * @param flag The nullifyReferences to set.
441
     */
442
    public void setNullifyReferences(boolean flag) {
443
        this.nullifyReferences = flag;
444
    }
434
445
446
        /**
447
     * @return Returns the nullifyReferences.
448
     */
449
    public boolean getNullifyReferences() {
450
        return nullifyReferences;
451
    }
435
    
452
    
453
    
454
    
436
    /**
455
    /**
437
     * If there is a Java SecurityManager create a read FilePermission
456
     * If there is a Java SecurityManager create a read FilePermission
438
     * or JndiPermission for the file directory path.
457
     * or JndiPermission for the file directory path.
Lines 1587-1592 Link Here
1587
            }
1606
            }
1588
        }
1607
        }
1589
        
1608
        
1609
        if(nullifyReferences) {
1590
        // Null out any static or final fields from loaded classes,
1610
        // Null out any static or final fields from loaded classes,
1591
        // as a workaround for apparent garbage collection bugs
1611
        // as a workaround for apparent garbage collection bugs
1592
        Iterator loadedClasses = ((HashMap) resourceEntries.clone()).values().iterator();
1612
        Iterator loadedClasses = ((HashMap) resourceEntries.clone()).values().iterator();
Lines 1633-1639 Link Here
1633
                }
1653
                }
1634
            }
1654
            }
1635
        }
1655
        }
1636
        
1656
    }
1637
        // Remove entries for this webapp from the JSP EL BeanInfo cache
1657
        // Remove entries for this webapp from the JSP EL BeanInfo cache
1638
        cleanElCache();
1658
        cleanElCache();
1639
        
1659
        

Return to bug 37956