tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: svn commit: r1496061 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/listeners.xml
Date Mon, 24 Jun 2013 16:23:52 GMT
Mark,

On 6/24/13 10:06 AM, markt@apache.org wrote:
> Author: markt
> Date: Mon Jun 24 14:06:24 2013
> New Revision: 1496061
> 
> URL: http://svn.apache.org/r1496061
> Log:
> Changes to java.beans.Introspector#flushCaches() mean that AppContext protection is not
required from 1.7.0_02 onwards.
> Changes to AppContext meant the memory leak protection required a graphical environment
from 1.7.0_25 onwards.
> 
> 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=1496061&r1=1496060&r2=1496061&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:06:24 2013
> @@ -59,12 +59,30 @@ 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;
> +    }

Isn't there a better way to detect Java versions? Maybe detect the
version string and do a comparison?

-chris


Mime
View raw message