IDEA-224056 - prevent visiting local classes inside methods during launching unused declaration inspection

GitOrigin-RevId: 5c6edec3a58e4237e410dc54f9762f9d7149f292
This commit is contained in:
Ilyas Selimov
2020-11-26 08:20:59 +00:00
committed by intellij-monorepo-bot
parent 9fc2324704
commit 88b3709251
3 changed files with 41 additions and 0 deletions
@@ -30,5 +30,25 @@
<line>21</line>
<description>Variable &lt;code&gt;unusedStr7&lt;/code&gt; is never used</description>
</problem>
<problem>
<file>A.java</file>
<line>26</line>
<description>Variable &lt;code&gt;unusedStr8&lt;/code&gt; is never used</description>
</problem>
<problem>
<file>A.java</file>
<line>27</line>
<description>Variable &lt;code&gt;unusedStr9&lt;/code&gt; is never used</description>
</problem>
<problem>
<file>A.java</file>
<line>34</line>
<description>Variable &lt;code&gt;unusedStr10&lt;/code&gt; is never used</description>
</problem>
<problem>
<file>A.java</file>
<line>35</line>
<description>Variable &lt;code&gt;unusedStr11&lt;/code&gt; is never used</description>
</problem>
</problems>
@@ -20,6 +20,22 @@ class A {
String unusedStr6 = "s";
String unusedStr7;
initializeSup(() -> unusedStr6);
class Local {
void test() {
String unusedStr8;
String unusedStr9 = "Str";
}
}
new Local().test();
Local o = new Local() {
void test() {
String unusedStr10;
String unusedStr11 = "Str";
}
}
System.out.println(o);
});
});
}