Java: don't consider constructors used when the class is used externally (IDEA-206602)

for global "Unused declaration" inspection

GitOrigin-RevId: e671cef5b81a2e148ec747e91e876959c0481d8d
This commit is contained in:
Bas Leijdekkers
2024-05-03 16:06:52 +00:00
committed by intellij-monorepo-bot
parent 02f130cf0e
commit 734fd63f37
6 changed files with 33 additions and 11 deletions
@@ -1,3 +1,7 @@
class B extends A {
public static void main(String[] args) {
new B();
}
}
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>UsefulClass.java</file>
<line>4</line>
<entry_point TYPE="method" FQNAME="a.UsefulClass UsefulClass()" />
<description>Constructor is never used.</description>
</problem>
</problems>
@@ -0,0 +1,6 @@
package a;
public class UsefulClass {
public UsefulClass() {
}
}
@@ -0,0 +1,6 @@
package b;
import a.UsefulClass;
public class Another {
}