I don't think it's a bug. Indeed, the class loader will invoke loadClass,
and the loadClass method will checking the parent class loader for the
requested class, if it is not found,then invoke findClass of current class
loader implementation to find the requested class as describe in loadClass
javadoc
<https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String,%20boolean)>
.

The DynamicClassLoader extends the URLClassLoader, and wraps a class cache
for it.

Also see the javadoc of findClass:

protected Class
<https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html><?>
findClass(String
<https://docs.oracle.com/javase/7/docs/api/java/lang/String.html>
name)
                      throws ClassNotFoundException
<https://docs.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.html>

Finds the class with the specified binary name
<https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#name>.
This method should be overridden by class loader implementations that
follow the delegation model for loading classes, and will be invoked by the
loadClass
<https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)>
method
*after checking the parent class loader for the requested class*. The
default implementation throws a ClassNotFoundException.

2015-09-16 21:23 GMT+08:00 András Pálinkás <pal...@gmail.com>:

> Can anyone explain to me why do we call super.findClass here:
>
> https://github.com/clojure/clojure/blob/41af6b24dd5be8bd62dc2b463bc53b55e18cd1e5/src/jvm/clojure/lang/DynamicClassLoader.java#L69
>
> I believe, on this line, instead of super.findClass, it should call
> getParent().findClass, otherwise we'll get to the system classloader almost
> immediately (and the parent classloader will never be used).
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
庄晓丹
Email:        killme2...@gmail.com xzhu...@avos.com
Site:           http://fnil.net
Twitter:      @killme2008

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to