// Only install Eclipse-based resource loader if enabled in project properties
// IMPORTANT: the following block needs to stay before the w.lock()
// as it could otherwise create a runtime deadlock
final ResourceLoader resourceLoader;
if (getElementParent() instanceof IBeansProject && ((IBeansProject) getElementParent()).isImportsEnabled()) {
resourceLoader = new EclipsePathMatchingResourcePatternResolver(file.getProject(), projectIncludingClassloader);
}
else {
resourceLoader = new ClassResourceFilteringPatternResolver(file.getProject(), projectIncludingClassloader);
}