IFile tld = (IFile) resource;
if (tld.isAccessible()) {
try {
final IJavaProject javaProject = JavaCore.create(tld.getProject());
if (javaProject.exists()) {
IScopeContext[] scopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
ProjectScope projectScope = new ProjectScope(tld.getProject());
if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
scopes = new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
}
Map[] problems = detectProblems(javaProject, tld, scopes);
for (int i = 0; i < problems.length; i++) {
ValidatorMessage message = ValidatorMessage.create(problems[i].get(IMarker.MESSAGE).toString(), resource);
message.setType(MARKER_TYPE);