throw new RuntimeException("Missing PersistenceUnitMetadataImpl (thread local wasn't set)");
}
if (jartoScan == null) {
throw new IllegalArgumentException("Null jar to scan url");
}
Index index = getJarFileIndex(jartoScan, pu);
if (index == null) {
log.tracef("No classes to scan for annotations in jar '%s'"
+" (jars with classes '%s')", jartoScan.getPath(), pu.getAnnotationIndex().keySet());
return new HashSet<Package>();
}
Collection<ClassInfo> allClasses = index.getKnownClasses();
for (ClassInfo classInfo : allClasses) {
String className = classInfo.name().toString();
try {
resultClasses.add(pu.getClassLoader().loadClass(className));
// TODO: fix temp classloader (get CFNE on entity class)