mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
global inspections: don't create incorrect link between class and its field initializer targets
GitOrigin-RevId: 838fc87a71409dc722a9821525845e573242a883
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e61d97c6e1
commit
63c4ffc2bc
@@ -284,14 +284,6 @@ public final class RefClassImpl extends RefJavaElementImpl implements RefClass {
|
||||
}
|
||||
}
|
||||
|
||||
UField[] uFields = uClass.getFields();
|
||||
for (UField uField : uFields) {
|
||||
final UExpression initializer = uField.getUastInitializer();
|
||||
if (initializer != null) {
|
||||
refUtil.addReferencesTo(uClass, this, initializer);
|
||||
}
|
||||
}
|
||||
|
||||
final RefMethodImpl defaultConstructor = (RefMethodImpl)getDefaultConstructor();
|
||||
if (defaultConstructor != null) {
|
||||
for (RefClass superClass : getBaseClasses()) {
|
||||
@@ -308,6 +300,7 @@ public final class RefClassImpl extends RefJavaElementImpl implements RefClass {
|
||||
UMethod[] uMethods = uClass.getMethods();
|
||||
for (UMethod uMethod : uMethods) {
|
||||
if (uMethod.getSourcePsi() == classSourcePsi) {
|
||||
// Kotlin implicit constructor
|
||||
refUtil.addReferencesTo(uClass, this, uMethod.getUastBody());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,11 +97,26 @@
|
||||
<line>6</line>
|
||||
<description>Field has no usages.</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>AnonymousClass.java</file>
|
||||
<line>9</line>
|
||||
<description><ul><li>Method owner class is never instantiated OR</li><li>An instantiation is not reachable from entry points.</li></ul></description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>AnonymousClass.java</file>
|
||||
<line>10</line>
|
||||
<description>Variable <code>i1</code> is never used</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>AnonymousClass.java</file>
|
||||
<line>14</line>
|
||||
<description><ul><li>Method owner class is never instantiated OR</li><li>An instantiation is not reachable from entry points.</li></ul></description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>AnonymousClass.java</file>
|
||||
<line>19</line>
|
||||
<description><ul><li>Method owner class is never instantiated OR</li><li>An instantiation is not reachable from entry points.</li></ul></description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>AnonymousClass.java</file>
|
||||
<line>21</line>
|
||||
|
||||
Reference in New Issue
Block a user