Mark,

On 3/19/12 4:46 PM, ma...@apache.org wrote:
> Author: markt
> Date: Mon Mar 19 20:46:15 2012
> New Revision: 1302649
> 
> URL: http://svn.apache.org/viewvc?rev=1302649&view=rev
> Log:
> Make implementation of getParentClassLoader() consistent with the other 
> implementations across the code base.
> 
> Modified:
>     tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
> 
> Modified: tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Catalina.java?rev=1302649&r1=1302648&r2=1302649&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/startup/Catalina.java (original)
> +++ tomcat/trunk/java/org/apache/catalina/startup/Catalina.java Mon Mar 19 
> 20:46:15 2012
> @@ -177,7 +177,10 @@ public class Catalina {
>      }
>  
>      public ClassLoader getParentClassLoader() {
> -        return parentClassLoader;
> +        if (parentClassLoader != null) {
> +            return (parentClassLoader);
> +        }
> +        return ClassLoader.getSystemClassLoader();
>      }

Not sure if this nit is too find to pick, but ClassLoader Javadoc says
that if getParent() returns null, then the parent is the "bootstrap"
ClassLoader. There seems to be a difference between "system" and
"bootstrap" but it's not evident merely from reading the javadoc.

In this case, system ~= bootstrap, but I wanted to make sure that was an
intentional decision. On the other hand, there's no way to directly get
the bootstrap ClassLoader via the API anyway, so I'm not sure it matters
at all.

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to