You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by David Hovemeyer <da...@cs.umd.edu> on 2003/08/04 19:33:16 UTC

SyntheticRepository bug, patch

The loadClass(String) method of org.apache.util.SyntheticRepository
has a bug where classes already in the repository but not on the
classpath are ignored.  The problem is that the check to see if
the class is already present in the repository is done in
the private loadClass(InputStream, String) method.  However,
when the ClassPath object is used to generate the InputStream
in loadClass(String), it will throw an IOException (because the class
is not on the classpath), and this will cause ClassNotFoundException to
be thrown.

The solution is to move the check to see if the class is in the repository
into the public loadClass() methods.  I've attached a patch to do this.
If someone could commit this, I'd appreciate it.

Thanks,
Dave