void (RefEntity element, CommonProblemDescriptor[] descriptors) { if (!(element instanceof RefElement)) return; SmartPsiElementPointer<?> pointer = ((RefElement)element).getPointer(); if (pointer == null) return; VirtualFile entityFile = ensureNotInjectedFile(pointer.getVirtualFile()); if (entityFile == null) return; for (CommonProblemDescriptor d : descriptors) { if (d instanceof ProblemDescriptorBase) { VirtualFile file = ((ProblemDescriptorBase)d).getContainingFile(); if (file != null) { LOG.assertTrue(ensureNotInjectedFile(file).equals(entityFile), "descriptor and containing entity files should be the same; descriptor: " + d.getDescriptionTemplate() + ", entityFile: " + entityFile.getName()); } } } }