private JavaClass lookupJavaClass(ClassPathManager classPath, String name) {
if (classPath == null) {
try {
ensureRepositorySetup();
JavaClass jc = delegate.loadClass(name);
if (trace.isTraceEnabled()) {
trace.event("lookupJavaClass", this, new Object[] { name, jc });
}
return jc;
} catch (ClassNotFoundException e) {
if (trace.isTraceEnabled()) {
trace.error("Unable to find class '" + name + "' in repository", e);
}
return null;
}
}
ClassPathManager.ClassFile file = null;
try {
file = classPath.find(UnresolvedType.forName(name));
if (file == null) {
return null;
}
ClassParser parser = new ClassParser(file.getInputStream(), file.getPath());
JavaClass jc = parser.parse();
return jc;
} catch (IOException ioe) {
return null;
} finally {
if (file != null) {