mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more accurate error messages for field refs (IDEA-164919)
This commit is contained in:
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -171,7 +171,8 @@ public class TestOnlyInspection extends BaseJavaBatchLocalInspectionTool {
|
||||
private static void reportProblem(PsiElement e, PsiMember target, ProblemsHolder h) {
|
||||
String message = InspectionsBundle.message(target instanceof PsiClass
|
||||
? "inspection.test.only.problems.test.only.class.reference"
|
||||
: "inspection.test.only.problems.test.only.method.call");
|
||||
: target instanceof PsiField ? "inspection.test.only.problems.test.only.field.reference"
|
||||
: "inspection.test.only.problems.test.only.method.call");
|
||||
h.registerProblem(e, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<file>B.java</file>
|
||||
<line>11</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
<description>Test-only field is referenced in production code</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
@@ -55,19 +55,19 @@
|
||||
<file>B.java</file>
|
||||
<line>18</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
<description>Test-only field is referenced in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>19</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
<description>Test-only field is referenced in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>20</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
<description>Test-only field is referenced in production code</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<module>testInsideField</module>
|
||||
<package><default></package>
|
||||
<entry_point TYPE="method" FQNAME="A$2 void run()"/>
|
||||
<description>Test-only method is called in production code</description>
|
||||
<description>Test-only field is referenced in production code</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ inspection.nullable.problems.NotNull.parameter.receives.null.literal=Parameter a
|
||||
inspection.test.only.problems.display.name=Test-only class or method call in production code
|
||||
inspection.test.only.problems.test.only.method.call=Test-only method is called in production code
|
||||
inspection.test.only.problems.test.only.class.reference=Test-only class is referenced in production code
|
||||
inspection.test.only.problems.test.only.field.reference=Test-only field is referenced in production code
|
||||
|
||||
inspection.visibility.display.name=Declaration access can be weaker
|
||||
inspection.visibility.option=Suggest package-private visibility level for class members
|
||||
|
||||
Reference in New Issue
Block a user