IDEA-82634 (Inspection warning on entire file not displayed)

This commit is contained in:
Bas Leijdekkers
2012-03-19 12:34:36 +01:00
parent 54407462dd
commit 4fdf47bb4c
3 changed files with 8 additions and 1 deletions
@@ -173,7 +173,7 @@ public abstract class BaseInspectionVisitor extends JavaElementVisitor {
protected final void registerError(@NotNull PsiElement location,
Object... infos) {
if (location.getTextLength() == 0) {
if (location.getTextLength() == 0 && !(location instanceof PsiFile)) {
return;
}
final InspectionGadgetsFix[] fixes = createFixes(infos);
@@ -6,4 +6,11 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Empty class</problem_class>
<description>Class &lt;code&gt;ReportMe&lt;/code&gt; is empty #loc</description>
</problem>
<problem>
<file>EmptyFile.java</file>
<line>1</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Empty class</problem_class>
<description>Java file does not declare any class #loc</description>
</problem>
</problems>