You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/06/24 16:15:32 UTC

svn commit: r1496063 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/listeners.xml

Author: markt
Date: Mon Jun 24 14:15:31 2013
New Revision: 1496063

URL: http://svn.apache.org/r1496063
Log:
Tomcat 8 requires a minimum of Java 7 so simplify.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
    tomcat/trunk/webapps/docs/config/listeners.xml

Modified: tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1496063&r1=1496062&r2=1496063&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Mon Jun 24 14:15:31 2013
@@ -59,30 +59,15 @@ public class JreMemoryLeakPreventionList
     private static final StringManager sm =
         StringManager.getManager(Constants.Package);
 
-    private static final boolean IS_JAVA_7_OR_LATER;
-
-    static {
-        boolean isJava7OrLater;
-        try {
-            Class.forName("java.util.Objects");
-            isJava7OrLater = true;
-        } catch (ClassNotFoundException e) {
-            isJava7OrLater = false;
-        }
-        IS_JAVA_7_OR_LATER = isJava7OrLater;
-    }
-
     /**
      * Protect against the memory leak caused when the first call to
      * <code>sun.awt.AppContext.getAppContext()</code> is triggered by a web
-     * application. Defaults to <code>true</code> for Java 6 and earlier (since
-     * it is used by {@link java.beans.Introspector#flushCaches()}) but defaults
-     * to <code>false</code> for Java 7 and later since
+     * application. Defaults to <code>false</code> since
      * {@link java.beans.Introspector#flushCaches()} no longer uses AppContext
      * from 1.7.0_02 onwards. Also, from 1.7.0_25 onwards, calling this method
      * requires a graphical environment and starts an AWT thread.
      */
-    private boolean appContextProtection = !IS_JAVA_7_OR_LATER;
+    private boolean appContextProtection = false;
     public boolean isAppContextProtection() { return appContextProtection; }
     public void setAppContextProtection(boolean appContextProtection) {
         this.appContextProtection = appContextProtection;
@@ -268,7 +253,7 @@ public class JreMemoryLeakPreventionList
                  * due to eventual calls to getAppContext() are:
                  * - Google Web Toolkit via its use of javax.imageio
                  * - Tomcat via its use of java.beans.Introspector.flushCaches()
-                 *   in 1.6.0_15 to 1.7.0_01. From 1.7.0_02 onwards use of
+                 *   in 1.7.0 to 1.7.0_01. From 1.7.0_02 onwards use of
                  *   AppContext by Introspector.flushCaches() was replaced with
                  *   ThreadGroupContext
                  * - others TBD

Modified: tomcat/trunk/webapps/docs/config/listeners.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1496063&r1=1496062&r2=1496063&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/trunk/webapps/docs/config/listeners.xml Mon Jun 24 14:15:31 2013
@@ -177,12 +177,10 @@
       <attribute name="appContextProtection" required="false">
         <p>Enables protection so that calls to
         <code>sun.awt.AppContext.getAppContext()</code> triggered by a web
-        application do not result in a memory leak. Note that a call to this
-        method will be triggered as part of the web application stop process
-        when running on Java 6 and earlier. It is therefore strongly recommended
-        that this protection is enabled when running on Java 6 and earlier. The
-        default is <code>true</code> for Java 6 and earlier versions. The
-        default is <code>false</code> for Java 7 and later versions.</p>
+        application do not result in a memory leak. Note that enabling this
+        protection will trigger a requirement for a graphical environment unless
+        Java is started in head-less mode. The default is <code>false</code>.
+        </p>
       </attribute>
 
       <attribute name="AWTThreadProtection" required="false">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org